Adjust proguard for Android R8
1. Use JDK 21 2. Update android plugins for JDK 21 3. Update gradle wrapper The new R8 engine will change more class names than before, we thus need to save those needed ones.
This commit is contained in:
parent
f3beb8688f
commit
0a935413fc
|
|
@ -56,7 +56,7 @@ jobs:
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: "temurin"
|
distribution: "temurin"
|
||||||
java-version: "17"
|
java-version: "21"
|
||||||
|
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
uses: gradle/gradle-build-action@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
*.iml
|
*.iml
|
||||||
.gradle
|
.gradle
|
||||||
/local.properties
|
/local.properties
|
||||||
|
|
|
||||||
|
|
@ -70,9 +70,9 @@ val androidTargetSdkVersion by extra(34)
|
||||||
val androidMinSdkVersion by extra(27)
|
val androidMinSdkVersion by extra(27)
|
||||||
val androidBuildToolsVersion by extra("34.0.0")
|
val androidBuildToolsVersion by extra("34.0.0")
|
||||||
val androidCompileSdkVersion by extra(34)
|
val androidCompileSdkVersion by extra(34)
|
||||||
val androidCompileNdkVersion by extra("26.1.10909125")
|
val androidCompileNdkVersion by extra("26.3.11579264")
|
||||||
val androidSourceCompatibility by extra(JavaVersion.VERSION_17)
|
val androidSourceCompatibility by extra(JavaVersion.VERSION_21)
|
||||||
val androidTargetCompatibility by extra(JavaVersion.VERSION_17)
|
val androidTargetCompatibility by extra(JavaVersion.VERSION_21)
|
||||||
|
|
||||||
tasks.register("Delete", Delete::class) {
|
tasks.register("Delete", Delete::class) {
|
||||||
delete(rootProject.layout.buildDirectory)
|
delete(rootProject.layout.buildDirectory)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,12 @@
|
||||||
|
-keep class android.** { *; }
|
||||||
-keep class de.robv.android.xposed.** {*;}
|
-keep class de.robv.android.xposed.** {*;}
|
||||||
-keep class io.github.libxposed.** {*;}
|
-keep class io.github.libxposed.** {*;}
|
||||||
|
-keep class org.lsposed.lspd.core.* {*;}
|
||||||
|
-keep class org.lsposed.lspd.impl.LSPosedBridge$NativeHooker {*;}
|
||||||
|
-keep class org.lsposed.lspd.impl.LSPosedBridge$HookerCallback {*;}
|
||||||
|
-keep class org.lsposed.lspd.util.Hookers {*;}
|
||||||
|
|
||||||
-keepattributes RuntimeVisibleAnnotations
|
-keepattributes RuntimeVisibleAnnotations
|
||||||
-keep class android.** { *; }
|
|
||||||
-keepclasseswithmembers,includedescriptorclasses class * {
|
-keepclasseswithmembers,includedescriptorclasses class * {
|
||||||
native <methods>;
|
native <methods>;
|
||||||
}
|
}
|
||||||
|
|
@ -15,15 +20,6 @@
|
||||||
@io.github.libxposed.api.annotations.BeforeInvocation <methods>;
|
@io.github.libxposed.api.annotations.BeforeInvocation <methods>;
|
||||||
@io.github.libxposed.api.annotations.AfterInvocation <methods>;
|
@io.github.libxposed.api.annotations.AfterInvocation <methods>;
|
||||||
}
|
}
|
||||||
-keepclassmembers class org.lsposed.lspd.impl.LSPosedBridge$NativeHooker {
|
|
||||||
<init>(java.lang.reflect.Executable);
|
|
||||||
callback(...);
|
|
||||||
}
|
|
||||||
-keepclassmembers class org.lsposed.lspd.impl.LSPosedBridge$HookerCallback {
|
|
||||||
final *** beforeInvocation;
|
|
||||||
final *** afterInvocation;
|
|
||||||
HookerCallback(...);
|
|
||||||
}
|
|
||||||
-assumenosideeffects class android.util.Log {
|
-assumenosideeffects class android.util.Log {
|
||||||
public static *** v(...);
|
public static *** v(...);
|
||||||
public static *** d(...);
|
public static *** d(...);
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,5 @@
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
# org.gradle.parallel=true
|
# org.gradle.parallel=true
|
||||||
|
|
||||||
android.experimental.enableNewResourceShrinker.preciseShrinking=true
|
|
||||||
android.enableAppCompileTimeRClass=true
|
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.nonFinalResIds=false
|
android.nonFinalResIds=false
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
[versions]
|
[versions]
|
||||||
agp = "8.2.1"
|
agp = "8.4.0"
|
||||||
kotlin = "1.9.22"
|
kotlin = "1.9.23"
|
||||||
nav = "2.7.6"
|
nav = "2.7.7"
|
||||||
appcenter = "5.0.4"
|
appcenter = "5.0.4"
|
||||||
libxposed = "100"
|
libxposed = "100"
|
||||||
glide = "4.16.0"
|
glide = "4.16.0"
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,6 +1,6 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|
|
||||||
|
|
@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
|
@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,8 @@ fun afterEval() = android.applicationVariants.forEach { variant ->
|
||||||
rename(".*\\.apk", "daemon.apk")
|
rename(".*\\.apk", "daemon.apk")
|
||||||
}
|
}
|
||||||
into("lib") {
|
into("lib") {
|
||||||
from(layout.buildDirectory.dir("intermediates/stripped_native_libs/$variantCapped/out/lib")) {
|
val libDir = variantCapped + "/strip${variantCapped}DebugSymbols"
|
||||||
|
from(layout.buildDirectory.dir("intermediates/stripped_native_libs/$libDir/out/lib")) {
|
||||||
include("**/liblspd.so")
|
include("**/liblspd.so")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -303,7 +304,7 @@ val pushDaemonNative = task<Exec>("pushDaemonNative") {
|
||||||
}
|
}
|
||||||
outputStream.toString().trim()
|
outputStream.toString().trim()
|
||||||
}
|
}
|
||||||
workingDir(project(":daemon").layout.buildDirectory.dir("intermediates/stripped_native_libs/debug/out/lib/$abi"))
|
workingDir(project(":daemon").layout.buildDirectory.dir("intermediates/stripped_native_libs/debug/stripDebugDebugSymbols/out/lib/$abi"))
|
||||||
}
|
}
|
||||||
commandLine(adb, "push", "libdaemon.so", "/data/local/tmp/libdaemon.so")
|
commandLine(adb, "push", "libdaemon.so", "/data/local/tmp/libdaemon.so")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,3 +15,5 @@
|
||||||
-repackageclasses
|
-repackageclasses
|
||||||
-allowaccessmodification
|
-allowaccessmodification
|
||||||
-dontwarn org.slf4j.impl.StaticLoggerBinder
|
-dontwarn org.slf4j.impl.StaticLoggerBinder
|
||||||
|
-dontwarn org.lsposed.lspd.core.*
|
||||||
|
-dontwarn org.lsposed.lspd.util.Hookers
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue