From f1bbc0cd0ef4c7bef8b8ba988168df85d7b608c4 Mon Sep 17 00:00:00 2001 From: 5ec1cff Date: Thu, 18 Jul 2024 12:24:55 +0800 Subject: [PATCH] extract daemon --- module/build.gradle.kts | 4 ++-- module/template/customize.sh | 5 +++-- module/template/daemon | 3 +++ module/template/service.sh | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 module/template/daemon diff --git a/module/build.gradle.kts b/module/build.gradle.kts index dfd8973..bc84efa 100644 --- a/module/build.gradle.kts +++ b/module/build.gradle.kts @@ -76,7 +76,7 @@ androidComponents.onVariants { variant -> into(moduleDir) from(rootProject.layout.projectDirectory.file("README.md")) from(layout.projectDirectory.file("template")) { - exclude("module.prop", "customize.sh", "post-fs-data.sh", "service.sh") + exclude("module.prop", "customize.sh", "post-fs-data.sh", "service.sh", "daemon") filter("eol" to FixCrLfFilter.CrLf.newInstance("lf")) } from(layout.projectDirectory.file("template")) { @@ -89,7 +89,7 @@ androidComponents.onVariants { variant -> ) } from(layout.projectDirectory.file("template")) { - include("customize.sh", "post-fs-data.sh", "service.sh") + include("customize.sh", "post-fs-data.sh", "service.sh", "daemon") val tokens = mapOf( "DEBUG" to if (buildTypeLowered == "debug") "true" else "false", "SONAME" to moduleId, diff --git a/module/template/customize.sh b/module/template/customize.sh index a3b8086..48d449b 100644 --- a/module/template/customize.sh +++ b/module/template/customize.sh @@ -60,14 +60,15 @@ fi . "$TMPDIR/verify.sh" extract "$ZIPFILE" 'customize.sh' "$TMPDIR/.vunzip" extract "$ZIPFILE" 'verify.sh' "$TMPDIR/.vunzip" -extract "$ZIPFILE" 'sepolicy.rule' "$TMPDIR" ui_print "- Extracting module files" extract "$ZIPFILE" 'module.prop' "$MODPATH" extract "$ZIPFILE" 'post-fs-data.sh' "$MODPATH" extract "$ZIPFILE" 'service.sh' "$MODPATH" extract "$ZIPFILE" 'service.apk' "$MODPATH" -mv "$TMPDIR/sepolicy.rule" "$MODPATH" +extract "$ZIPFILE" 'sepolicy.rule' "$MODPATH" +extract "$ZIPFILE" 'daemon' "$MODPATH" +chmod +x "$MODPATH/daemon" mkdir "$MODPATH/zygisk" diff --git a/module/template/daemon b/module/template/daemon new file mode 100644 index 0000000..8d391f4 --- /dev/null +++ b/module/template/daemon @@ -0,0 +1,3 @@ +#!/system/bin/sh + +exec /system/bin/app_process -Djava.class.path=./service.apk / --nice-name=TrickyStore io.github.a13e300.tricky_store.MainKt diff --git a/module/template/service.sh b/module/template/service.sh index 17ba60f..9acbb09 100644 --- a/module/template/service.sh +++ b/module/template/service.sh @@ -6,7 +6,7 @@ cd $MODDIR ( while [ true ]; do - /system/bin/app_process -Djava.class.path=./service.apk / --nice-name=TrickyStore io.github.a13e300.tricky_store.MainKt + ./daemon if [ $? -ne 0 ]; then exit 1 fi