diff --git a/core/src/main/rust/linker-wrapper.py b/core/src/main/rust/linker-wrapper.py index 143c3bf2c0..785ba6f443 100755 --- a/core/src/main/rust/linker-wrapper.py +++ b/core/src/main/rust/linker-wrapper.py @@ -1,7 +1,6 @@ from __future__ import absolute_import, print_function, unicode_literals import os -import pipes import shutil import subprocess import sys @@ -25,6 +24,15 @@ def win2posix(path): args = [rustcc, os.environ['RUST_ANDROID_GRADLE_CC_LINK_ARG']] + sys.argv[1:] +def cmd_quote(string): + import sys + if int(sys.version[2]) < 3: + import pipes + return pipes.quote(string) + else: + import shlex + return shlex.quote(string) + def update_in_place(arglist): # The `gcc` library is not included starting from NDK version 23. # Work around by using `unwind` replacement. @@ -68,7 +76,7 @@ def posix2win(path): # This only appears when the subprocess call fails, but it's helpful then. -printable_cmd = " ".join(pipes.quote(arg) for arg in args) +printable_cmd = " ".join(cmd_quote(arg) for arg in args) print(printable_cmd) code = subprocess.call(args) diff --git a/mobile/src/main/java/com/github/shadowsocks/GlobalSettingsPreferenceFragment.kt b/mobile/src/main/java/com/github/shadowsocks/GlobalSettingsPreferenceFragment.kt index cc7ac91647..ca80149c8c 100644 --- a/mobile/src/main/java/com/github/shadowsocks/GlobalSettingsPreferenceFragment.kt +++ b/mobile/src/main/java/com/github/shadowsocks/GlobalSettingsPreferenceFragment.kt @@ -53,6 +53,7 @@ class GlobalSettingsPreferenceFragment : PreferenceFragmentCompat() { } else canToggleLocked.remove() val serviceMode = findPreference(Key.serviceMode)!! + val shareOverLan = findPreference(Key.shareOverLan)!! val portProxy = findPreference(Key.portProxy)!! portProxy.setOnBindEditTextListener(EditTextPreferenceModifiers.Port) val portLocalDns = findPreference(Key.portLocalDns)!! @@ -66,6 +67,7 @@ class GlobalSettingsPreferenceFragment : PreferenceFragmentCompat() { val listener: (BaseService.State) -> Unit = { val stopped = it == BaseService.State.Stopped serviceMode.isEnabled = stopped + shareOverLan.isEnabled = stopped portProxy.isEnabled = stopped portLocalDns.isEnabled = stopped if (stopped) onServiceModeChange.onPreferenceChange(serviceMode, DataStore.serviceMode) else { diff --git a/mobile/src/main/res/xml/pref_global.xml b/mobile/src/main/res/xml/pref_global.xml index 9a4808d8b3..3c358f975b 100644 --- a/mobile/src/main/res/xml/pref_global.xml +++ b/mobile/src/main/res/xml/pref_global.xml @@ -20,6 +20,9 @@ app:defaultValue="vpn" app:title="@string/service_mode" app:useSimpleSummaryProvider="true"/> +