diff --git a/.gitmodules b/.gitmodules index 954b512529..530a893a39 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,4 +16,4 @@ branch = shadowsocks-android [submodule "core/src/main/rust/shadowsocks-rust"] path = core/src/main/rust/shadowsocks-rust - url = https://github.com/madeye/shadowsocks-rust + url = https://github.com/shadowsocks/shadowsocks-rust.git diff --git a/core/build.gradle.kts b/core/build.gradle.kts index bca8568439..2c097bc047 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -50,7 +50,8 @@ cargo { "local-flow-stat", "local-dns-relay")) exec = { spec, toolchain -> - spec.environment("RUST_ANDROID_GRADLE_CC_LINK_ARG", "-o,target/${toolchain.target}/$profile/lib$libname.so") + spec.environment("RUST_ANDROID_GRADLE_LINKER_WRAPPER_PY", "$projectDir/$module/../linker-wrapper.py") + spec.environment("RUST_ANDROID_GRADLE_TARGET", "target/${toolchain.target}/$profile/lib$libname.so") } } diff --git a/core/src/main/rust/linker-wrapper.py b/core/src/main/rust/linker-wrapper.py new file mode 100755 index 0000000000..80dc1888b9 --- /dev/null +++ b/core/src/main/rust/linker-wrapper.py @@ -0,0 +1,18 @@ +from __future__ import absolute_import, print_function, unicode_literals + +import os +import pipes +import shutil +import subprocess +import sys + +args = [os.environ['RUST_ANDROID_GRADLE_CC'], os.environ['RUST_ANDROID_GRADLE_CC_LINK_ARG']] + sys.argv[1:] + +# This only appears when the subprocess call fails, but it's helpful then. +printable_cmd = ' '.join(pipes.quote(arg) for arg in args) +print(printable_cmd) + +code = subprocess.call(args) +if code == 0: + shutil.copyfile(sys.argv[sys.argv.index('-o') + 1], os.environ['RUST_ANDROID_GRADLE_TARGET']) +sys.exit(code) diff --git a/core/src/main/rust/shadowsocks-rust b/core/src/main/rust/shadowsocks-rust index 246b6c48bc..45a3469840 160000 --- a/core/src/main/rust/shadowsocks-rust +++ b/core/src/main/rust/shadowsocks-rust @@ -1 +1 @@ -Subproject commit 246b6c48bce6d4a83af046bd3feb4843f772b9d2 +Subproject commit 45a3469840fa423cecec90de5cc03ed5003c1a92 diff --git a/mobile/build.gradle.kts b/mobile/build.gradle.kts index 139b594fd8..4d004815c6 100644 --- a/mobile/build.gradle.kts +++ b/mobile/build.gradle.kts @@ -21,6 +21,6 @@ dependencies { implementation("com.google.zxing:core:3.4.0") implementation("com.takisoft.preferencex:preferencex-simplemenu:1.1.0") implementation("com.twofortyfouram:android-plugin-api-for-locale:1.0.4") - implementation("me.zhanghai.android.fastscroll:library:1.1.2") + implementation("me.zhanghai.android.fastscroll:library:1.1.3") implementation("xyz.belvi.mobilevision:barcodescanner:2.0.3") } diff --git a/repositories.gradle.kts b/repositories.gradle.kts index c094945c4f..cb9f89d82b 100644 --- a/repositories.gradle.kts +++ b/repositories.gradle.kts @@ -1,5 +1,5 @@ rootProject.extra.apply { - set("androidPlugin", "com.android.tools.build:gradle:4.1.0-alpha07") + set("androidPlugin", "com.android.tools.build:gradle:4.1.0-alpha08") set("kotlinVersion", "1.3.72") }