From bc9baa522652f7cee81be4186015b8dc05ff4e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sat, 29 May 2021 17:49:10 +0800 Subject: [PATCH] Refine stuffs --- .github/workflows/debug.yml | 18 +----------------- app/proguard-rules.pro | 4 +--- .../nekohasekai/sagernet/ui/ScannerActivity.kt | 1 + bin/init/action/naive.sh | 2 +- bin/update_assets.sh | 2 +- buildSrc/src/main/kotlin/Helpers.kt | 3 ++- 6 files changed, 7 insertions(+), 23 deletions(-) diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index ba6ee77d..bf61b74a 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -311,20 +311,4 @@ jobs: echo "sdk.dir=${ANDROID_HOME}" > local.properties echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties ./run update_assets - ./gradlew app:assembleOssDebug - - uses: actions/upload-artifact@v2 - with: - name: "SHA256-ARM ${{ env.SHA256_ARM }}" - path: ${{ env.SUM_ARM }} - - uses: actions/upload-artifact@v2 - with: - name: "SHA256-ARM64 ${{ env.SHA256_ARM64 }}" - path: ${{ env.SUM_ARM64 }} - - uses: actions/upload-artifact@v2 - with: - name: "SHA256-X64 ${{ env.SHA256_X64 }}" - path: ${{ env.SUM_X64 }} - - uses: actions/upload-artifact@v2 - with: - name: "SHA256-X86 ${{ env.SHA256_X86 }}" - path: ${{ env.SUM_X86 }} \ No newline at end of file + ./gradlew app:assembleOssDebug \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 8d1d02ed..9284ee0c 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -4,7 +4,5 @@ # SnakeYaml -keep class org.yaml.snakeyaml.** { *; } --keep class org.yaml.snakeyaml.** { *; } --keepattributes SourceFile, LineNumberTable --dontobfuscate \ No newline at end of file +-keepattributes SourceFile, LineNumberTable \ No newline at end of file diff --git a/app/src/main/java/io/nekohasekai/sagernet/ui/ScannerActivity.kt b/app/src/main/java/io/nekohasekai/sagernet/ui/ScannerActivity.kt index 8615da86..14fa9312 100644 --- a/app/src/main/java/io/nekohasekai/sagernet/ui/ScannerActivity.kt +++ b/app/src/main/java/io/nekohasekai/sagernet/ui/ScannerActivity.kt @@ -103,6 +103,7 @@ class ScannerActivity : ThemedActivity(), BarcodeCallback { decoder.isMutableRequired = true } } else { + @Suppress("DEPRECATION") MediaStore.Images.Media.getBitmap(contentResolver, uri) } val intArray = IntArray(bitmap.width * bitmap.height) diff --git a/bin/init/action/naive.sh b/bin/init/action/naive.sh index 375bca40..e883bb06 100755 --- a/bin/init/action/naive.sh +++ b/bin/init/action/naive.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash -sudo apt install ninja-build pkg-config qemu-user ccache +sudo apt install ninja-build pkg-config sudo apt remove libc6-i386 --autoremove diff --git a/bin/update_assets.sh b/bin/update_assets.sh index 62e0d723..35d55d0a 100755 --- a/bin/update_assets.sh +++ b/bin/update_assets.sh @@ -6,7 +6,7 @@ mkdir -p app/src/main/assets/v2ray curl -L -o app/src/main/assets/v2ray/geoip.dat "https://github.com/v2fly/geoip/raw/release/geoip.dat" curl -L -o app/src/main/assets/v2ray/geosite.dat "https://github.com/v2fly/domain-list-community/raw/release/dlc.dat" -curl -L -o v2ray-extra.zip https://github.com/v2fly/v2ray-core/releases/download/v4.39.1/v2ray-extra.zip +curl -L -o v2ray-extra.zip https://github.com/v2fly/v2ray-core/releases/download/v4.39.2/v2ray-extra.zip unzip -o v2ray-extra.zip -d app/src/main/assets rm v2ray-extra.zip mv app/src/main/assets/browserforwarder/* app/src/main/assets/v2ray diff --git a/buildSrc/src/main/kotlin/Helpers.kt b/buildSrc/src/main/kotlin/Helpers.kt index 3049e35c..97e07f8b 100644 --- a/buildSrc/src/main/kotlin/Helpers.kt +++ b/buildSrc/src/main/kotlin/Helpers.kt @@ -244,8 +244,9 @@ fun Project.setupAppCommon() { dependsOn("package${requireFlavor()}") } val assemble = "assemble${requireFlavor()}" + val install = "install${requireFlavor()}" tasks.whenTaskAdded { - if (name == assemble) dependsOn("calculateAPKsSha256") + if (name == assemble || name == install) dependsOn("calculateAPKsSha256") } } }