From 1a82399e86aaab2d738a91b458b9046a48b17be4 Mon Sep 17 00:00:00 2001 From: ThePedroo Date: Sun, 30 Jun 2024 23:03:54 -0300 Subject: [PATCH] improve: hiding This commit improves hiding by moving monitor related files to /data/adb/rezygisk, where it's not accessable without root. --- loader/src/ptracer/main.cpp | 36 +----------------------------------- module/build.gradle.kts | 4 ++-- module/src/customize.sh | 1 + module/src/post-fs-data.sh | 3 +-- module/src/uninstall.sh | 5 +++++ 5 files changed, 10 insertions(+), 39 deletions(-) create mode 100644 module/src/uninstall.sh diff --git a/loader/src/ptracer/main.cpp b/loader/src/ptracer/main.cpp index aba0fe3..d1bbb39 100644 --- a/loader/src/ptracer/main.cpp +++ b/loader/src/ptracer/main.cpp @@ -9,41 +9,7 @@ #define DEBUG_RAMDISK_AS_TMP_PATH 2 int main(int argc, char **argv) { - int tmp_path_type = CUSTOM_TMP_PATH; - - if (getenv("TMP_PATH") == NULL) { - tmp_path_type = SBIN_AS_TMP_PATH; - - if (access("/sbin", F_OK) == -1) { - tmp_path_type = DEBUG_RAMDISK_AS_TMP_PATH; - - if (access("/debug_ramdisk", F_OK) == -1) { - printf("Cannot find TMP_PATH. You should make an issue about that.\n"); - - return 1; - } - } - } else { - tmp_path_type = CUSTOM_TMP_PATH; - } - - switch (tmp_path_type) { - case CUSTOM_TMP_PATH: { - zygiskd::Init(getenv("TMP_PATH")); - - break; - } - case SBIN_AS_TMP_PATH: { - zygiskd::Init("/sbin"); - - break; - } - case DEBUG_RAMDISK_AS_TMP_PATH: { - zygiskd::Init("/debug_ramdisk"); - - break; - } - } + zygiskd::Init("/data/adb/rezygisk"); printf("The ReZygisk Tracer %s\n\n", ZKSU_VERSION); diff --git a/module/build.gradle.kts b/module/build.gradle.kts index d021293..820e7c9 100644 --- a/module/build.gradle.kts +++ b/module/build.gradle.kts @@ -53,7 +53,7 @@ androidComponents.onVariants { variant -> into(moduleDir) from("${rootProject.projectDir}/README.md") from("$projectDir/src") { - exclude("module.prop", "customize.sh", "post-fs-data.sh", "service.sh", "mazoku") + exclude("module.prop", "customize.sh", "post-fs-data.sh", "service.sh", "uninstall.sh", "mazoku") filter("eol" to FixCrLfFilter.CrLf.newInstance("lf")) } from("$projectDir/src") { @@ -67,7 +67,7 @@ androidComponents.onVariants { variant -> } from("$projectDir/src/mazoku") from("$projectDir/src") { - include("customize.sh", "post-fs-data.sh", "service.sh") + include("customize.sh", "post-fs-data.sh", "service.sh", "uninstall.sh") val tokens = mapOf( "DEBUG" to if (buildTypeLowered == "debug") "true" else "false", "MIN_APATCH_VERSION" to "$minApatchVersion", diff --git a/module/src/customize.sh b/module/src/customize.sh index e5779c1..2e17fa3 100644 --- a/module/src/customize.sh +++ b/module/src/customize.sh @@ -103,6 +103,7 @@ ui_print "- Extracting module files" extract "$ZIPFILE" 'module.prop' "$MODPATH" extract "$ZIPFILE" 'post-fs-data.sh' "$MODPATH" extract "$ZIPFILE" 'service.sh' "$MODPATH" +extract "$ZIPFILE" 'uninstall.sh' "$MODPATH" extract "$ZIPFILE" 'mazoku' "$MODPATH" mv "$TMPDIR/sepolicy.rule" "$MODPATH" diff --git a/module/src/post-fs-data.sh b/module/src/post-fs-data.sh index cf744be..d18954a 100644 --- a/module/src/post-fs-data.sh +++ b/module/src/post-fs-data.sh @@ -26,8 +26,7 @@ create_sys_perm() { chcon u:object_r:system_file:s0 $1 } -export TMP_PATH=/sbin -[ -d /sbin ] || export TMP_PATH=/debug_ramdisk +export TMP_PATH=/data/adb/rezygisk create_sys_perm $TMP_PATH diff --git a/module/src/uninstall.sh b/module/src/uninstall.sh new file mode 100644 index 0000000..663bfad --- /dev/null +++ b/module/src/uninstall.sh @@ -0,0 +1,5 @@ +#!/system/bin/sh + +export TMP_PATH=/data/adb/rezygisk + +rm -rf $TMP_PATH \ No newline at end of file