File tree Expand file tree Collapse file tree 6 files changed +12
-11
lines changed
Expand file tree Collapse file tree 6 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ plugins {
88val verCode: Int by rootProject.extra
99val verName: String by rootProject.extra
1010val commitHash: String by rootProject.extra
11+ val workDirectory: String by rootProject.extra
1112
1213fun Project.findInPath (executable : String , property : String ): String? {
1314 val pathEnv = System .getenv(" PATH" )
@@ -29,7 +30,8 @@ val defaultCFlags = arrayOf(
2930 " -Wall" , " -Wextra" ,
3031 " -fno-rtti" , " -fno-exceptions" ,
3132 " -fno-stack-protector" , " -fomit-frame-pointer" ,
32- " -Wno-builtin-macro-redefined" , " -D__FILE__=__FILE_NAME__"
33+ " -Wno-builtin-macro-redefined" , " -D__FILE__=__FILE_NAME__" ,
34+ " -DWORK_DIRECTORY='\" ${workDirectory} \" '"
3335)
3436
3537val releaseFlags = arrayOf(
Original file line number Diff line number Diff line change 1010namespace zygiskd {
1111static std::string TMP_PATH;
1212
13- void Init (const char *path) { TMP_PATH = path; }
13+ void Init (const char *path) {
14+ TMP_PATH = path;
15+ setenv (" TMP_PATH" , TMP_PATH.data (), 0 );
16+ }
1417
1518std::string GetTmpPath () { return TMP_PATH; }
1619
Original file line number Diff line number Diff line change 1818// Use string_view literals for efficient, allocation-free string comparisons.
1919using namespace std ::string_view_literals;
2020
21+ const char *const kWorkDirectory = WORK_DIRECTORY;
22+
2123// The main entry point for the monitoring process.
2224void init_monitor () {
2325 LOGI (" NeoZygisk %s" , ZKSU_VERSION);
@@ -72,7 +74,7 @@ static int handle_version();
7274 */
7375int main (int argc, char **argv) {
7476 // This initialization is for the daemon's internal logic, not for CLI output.
75- zygiskd::Init (getenv ( " TMP_PATH " ) );
77+ zygiskd::Init (kWorkDirectory );
7678
7779 if (argc < 2 ) {
7880 print_usage (argv[0 ]);
Original file line number Diff line number Diff line change @@ -110,13 +110,11 @@ extract "$ZIPFILE" 'module.prop' "$MODPATH"
110110extract " $ZIPFILE " ' post-fs-data.sh' " $MODPATH "
111111extract " $ZIPFILE " ' service.sh' " $MODPATH "
112112extract " $ZIPFILE " ' uninstall.sh' " $MODPATH "
113- extract " $ZIPFILE " ' zygisk-ctl.sh' " $MODPATH "
114113mv " $TMPDIR /sepolicy.rule" " $MODPATH "
115114
116115mkdir " $MODPATH /bin"
117116mkdir " $MODPATH /lib"
118117mkdir " $MODPATH /lib64"
119- mv " $MODPATH /zygisk-ctl.sh" " $MODPATH /bin/zygisk-ctl"
120118
121119if [ " $ARCH " = " x86" ]; then
122120 ui_print " - Extracting x86 libraries"
@@ -148,6 +146,7 @@ elif [ "$ARCH" = "arm64" ]; then
148146 mv " $MODPATH /bin/libzygisk_ptrace.so" " $MODPATH /bin/zygisk-ptrace64"
149147fi
150148
149+ sleep 1
151150ui_print " - Setting permissions"
152151set_perm_recursive " $MODPATH /bin" 0 0 0755 0755
153152set_perm_recursive " $MODPATH /lib" 0 0 0755 0644 u:object_r:system_lib_file:s0
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ create_sys_perm() {
2626 chcon u:object_r:system_file:s0 $1
2727}
2828
29- export TMP_PATH=@WORK_DIRECTORY@
29+ TMP_PATH=@WORK_DIRECTORY@
3030
3131if [ -d $TMP_PATH ]; then
3232 rm -rf $TMP_PATH
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments