From 117d1ed0801c0b9fa144d195c0a89cabc488d176 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Sat, 24 Jul 2021 01:46:27 +0800 Subject: [PATCH] Fix always enter safe mode `getprop("persist.sys.safemode", true) == "1"` -> `getprop("persist.sys.safemode", true) == ""` --- native/jni/include/magisk.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/native/jni/include/magisk.hpp b/native/jni/include/magisk.hpp index 55d4b3d74..0d528ff16 100644 --- a/native/jni/include/magisk.hpp +++ b/native/jni/include/magisk.hpp @@ -2,7 +2,9 @@ #include -#define MAIN_SOCKET "d30138f2310a9fb9c54a3e0c21f58591" +// magiskinit will hex patch this constant, +// appending \0 to prevent the compiler from reusing the string for "1" +#define MAIN_SOCKET "d30138f2310a9fb9c54a3e0c21f58591\0" #define JAVA_PACKAGE_NAME "com.topjohnwu.magisk" #define LOGFILE "/cache/magisk.log" #define UNBLOCKFILE "/dev/.magisk_unblock"