[gradle] Add task to rerun lspd (#818)
This commit is contained in:
parent
1023e0e6ab
commit
dbce1ff67d
|
|
@ -33,7 +33,6 @@ plugins {
|
|||
}
|
||||
|
||||
val moduleName = "LSPosed"
|
||||
val isWindows = OperatingSystem.current().isWindows
|
||||
val moduleId = "riru_lsposed"
|
||||
val authors = "LSPosed Developers"
|
||||
|
||||
|
|
@ -227,7 +226,7 @@ androidComponents.onVariants { v ->
|
|||
from(magiskDir)
|
||||
}
|
||||
|
||||
val adb = androidComponents.sdkComponents.adb.get().asFile.absolutePath
|
||||
val adb: String = androidComponents.sdkComponents.adb.get().asFile.absolutePath
|
||||
val pushTask = task("push${variantCapped}", Exec::class) {
|
||||
dependsOn(zipTask)
|
||||
workingDir("${projectDir}/release")
|
||||
|
|
@ -235,7 +234,6 @@ androidComponents.onVariants { v ->
|
|||
}
|
||||
val flashTask = task("flash${variantCapped}", Exec::class) {
|
||||
dependsOn(pushTask)
|
||||
workingDir("${projectDir}/release")
|
||||
commandLine(
|
||||
adb, "shell", "su", "-c",
|
||||
"magisk --install-module /data/local/tmp/${zipFileName}"
|
||||
|
|
@ -243,11 +241,26 @@ androidComponents.onVariants { v ->
|
|||
}
|
||||
task("flashAndReboot${variantCapped}", Exec::class) {
|
||||
dependsOn(flashTask)
|
||||
workingDir("${projectDir}/release")
|
||||
commandLine(adb, "shell", "reboot")
|
||||
}
|
||||
}
|
||||
|
||||
val adb: String = androidComponents.sdkComponents.adb.get().asFile.absolutePath
|
||||
val killLspd = task("killLspd", Exec::class) {
|
||||
commandLine(adb, "shell", "su", "-c", "killall -w lspd")
|
||||
}
|
||||
val pushLspd = task("pushLspd", Exec::class) {
|
||||
dependsOn("mergeDexDebug")
|
||||
workingDir("$buildDir/intermediates/dex/debug/mergeDexDebug")
|
||||
commandLine(adb, "push", "classes.dex", "/data/local/tmp/lspd.dex")
|
||||
}
|
||||
task("reRunLspd", Exec::class) {
|
||||
dependsOn(pushLspd)
|
||||
dependsOn(killLspd)
|
||||
commandLine(adb, "shell", "su", "-c", "sh /data/adb/modules/riru_lsposed/service.sh&")
|
||||
isIgnoreExitValue = true
|
||||
}
|
||||
|
||||
val generateVersion = task("generateVersion", Copy::class) {
|
||||
inputs.property("VERSION_CODE", verCode)
|
||||
inputs.property("VERSION_NAME", verName)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,20 @@
|
|||
#!/system/bin/sh
|
||||
|
||||
dir=${0%/*}
|
||||
if [ -d "$dir/system" ]; then
|
||||
tmpLspdDex="/data/local/tmp/lspd.dex"
|
||||
debug="false"
|
||||
|
||||
if [ -r $tmpLspdDex ]; then
|
||||
java_options="-Djava.class.path=$tmpLspdDex"
|
||||
debug="true"
|
||||
elif [ -d "$dir/system" ]; then
|
||||
java_options="-Djava.class.path=$dir/system/framework/lspd.dex"
|
||||
debug="true"
|
||||
else
|
||||
java_options="-Djava.class.path=$dir/framework/lspd.dex"
|
||||
fi
|
||||
|
||||
if [ $debug = "true" ]; then
|
||||
os_version=$(getprop ro.build.version.sdk)
|
||||
if [ "$os_version" -eq "27" ]; then
|
||||
java_options="$java_options -Xrunjdwp:transport=dt_android_adb,suspend=n,server=y -Xcompiler-option --debuggable"
|
||||
|
|
@ -11,8 +23,6 @@ if [ -d "$dir/system" ]; then
|
|||
else
|
||||
java_options="$java_options -XjdwpProvider:adbconnection -XjdwpOptions:suspend=n,server=y"
|
||||
fi
|
||||
else
|
||||
java_options="-Djava.class.path=$dir/framework/lspd.dex"
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
|
|
|
|||
|
|
@ -135,4 +135,5 @@ if [ ! -z "${MISC_PATH}" ]; then
|
|||
start_log_catcher all "LSPosed:V XSharedPreferences:V LSPosed-Bridge:V LSPosedManager:V LSPosedService:V *:F" true ${LOG_VERBOSE}
|
||||
fi
|
||||
|
||||
rm -f "/data/local/tmp/lspd.dex"
|
||||
"$MODDIR/lspd"
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ android {
|
|||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles("proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue