From 0e853aad35f376492cf9c4e21831d504ca89f763 Mon Sep 17 00:00:00 2001 From: mlgmxyysd <1204074991@qq.com> Date: Mon, 18 Feb 2019 17:10:24 +0800 Subject: [PATCH 1/7] Migrate EdXposed Manager app --- .../riru/xposed/dexmaker/DexMakerUtils.java | 4 ++- .../de/robv/android/xposed/XposedInit.java | 2 +- Core/jni/main/inject/config_manager.cpp | 31 ++++++++++--------- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/Bridge/src/main/java/com/elderdrivers/riru/xposed/dexmaker/DexMakerUtils.java b/Bridge/src/main/java/com/elderdrivers/riru/xposed/dexmaker/DexMakerUtils.java index 472c8347c..132833c00 100644 --- a/Bridge/src/main/java/com/elderdrivers/riru/xposed/dexmaker/DexMakerUtils.java +++ b/Bridge/src/main/java/com/elderdrivers/riru/xposed/dexmaker/DexMakerUtils.java @@ -14,10 +14,12 @@ import external.com.android.dx.Local; import external.com.android.dx.TypeId; +import static de.robv.android.xposed.XposedInit.INSTALLER_DATA_BASE_DIR; + public class DexMakerUtils { private static final boolean IN_MEMORY_DEX_ELIGIBLE = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O; - private static final String COMPAT_LIST_PATH = "/data/misc/riru/modules/edxposed/compatlist/"; + private static final String COMPAT_LIST_PATH = INSTALLER_DATA_BASE_DIR + "/conf/compatlist/"; public static boolean shouldUseInMemoryHook() { if (!IN_MEMORY_DEX_ELIGIBLE) { diff --git a/Bridge/src/main/java/de/robv/android/xposed/XposedInit.java b/Bridge/src/main/java/de/robv/android/xposed/XposedInit.java index 390007ea6..b0f20f036 100644 --- a/Bridge/src/main/java/de/robv/android/xposed/XposedInit.java +++ b/Bridge/src/main/java/de/robv/android/xposed/XposedInit.java @@ -37,7 +37,7 @@ public final class XposedInit { public static boolean startsSystemServer = false; private static final String startClassName = ""; // ed: no support for tool process anymore - public static final String INSTALLER_PACKAGE_NAME = "com.solohsu.android.edxp.manager"; + public static final String INSTALLER_PACKAGE_NAME = "org.meowcat.edxposed.manager"; public static final String INSTALLER_LEGACY_PACKAGE_NAME = "de.robv.android.xposed.installer"; @SuppressLint("SdCardPath") public static final String INSTALLER_DATA_BASE_DIR = Build.VERSION.SDK_INT >= 24 diff --git a/Core/jni/main/inject/config_manager.cpp b/Core/jni/main/inject/config_manager.cpp index 478e5ace0..0f551d6a5 100644 --- a/Core/jni/main/inject/config_manager.cpp +++ b/Core/jni/main/inject/config_manager.cpp @@ -11,23 +11,26 @@ #include #include #include +#include #include "config_manager.h" -#define BLACK_LIST_PATH "/data/misc/riru/modules/edxposed/blacklist/" -#define WHITE_LIST_PATH "/data/misc/riru/modules/edxposed/whitelist/" -#define USE_WHITE_LIST "/data/misc/riru/modules/edxposed/usewhitelist" -#define GLOBAL_MODE "/data/misc/riru/modules/edxposed/forceglobal" -#define DYNAMIC_MODULES "/data/misc/riru/modules/edxposed/dynamicmodules" - static char package_name[256]; static bool global_mode = false; static bool dynamic_modules = false; static bool inited = false; +static bool use_prot_storage = GetAndroidApiLevel() >= ANDROID_N; +static std::string config_path = use_prot_storage ? "/data/user_de/0/org.meowcat.edxposed.manager/conf/" + : "/data/user/0/org.meowcat.edxposed.manager/conf/"; +static std::string blacklist_path = config_path + "blacklist/"; +static std::string whitelist_path = config_path + "whitelist/"; +static std::string use_whitelist_path = config_path + "usewhitelist"; +static std::string forceglobal_path = config_path + "forceglobal"; +static std::string dynamicmodules_path = config_path + "dynamicmodules"; void initOnce() { if (!inited) { - global_mode = access(GLOBAL_MODE, F_OK) == 0; - dynamic_modules = access(DYNAMIC_MODULES, F_OK) == 0; + global_mode = access(forceglobal_path.c_str(), F_OK) == 0; + dynamic_modules = access(dynamicmodules_path.c_str(), F_OK) == 0; inited = true; } } @@ -51,22 +54,22 @@ int is_app_need_hook(JNIEnv *env, jstring appDataDir) { } } env->ReleaseStringUTFChars(appDataDir, app_data_dir); - if (strcmp(package_name, "com.solohsu.android.edxp.manager") == 0) { + if (strcmp(package_name, "org.meowcat.edxposed.manager") == 0) { // always hook installer app return 1; } - bool use_white_list = access(USE_WHITE_LIST, F_OK) == 0; - bool white_list_exists = access(WHITE_LIST_PATH, F_OK) == 0; - bool black_list_exists = access(BLACK_LIST_PATH, F_OK) == 0; + bool use_white_list = access(use_whitelist_path.c_str(), F_OK) == 0; + bool white_list_exists = access(whitelist_path.c_str(), F_OK) == 0; + bool black_list_exists = access(blacklist_path.c_str(), F_OK) == 0; if (use_white_list && white_list_exists) { char path[PATH_MAX]; - snprintf(path, PATH_MAX, WHITE_LIST_PATH "%s", package_name); + snprintf(path, PATH_MAX, "%s%s", whitelist_path.c_str(), package_name); int res = access(path, F_OK) == 0; LOGD("use whitelist, res=%d", res); return res; } else if (!use_white_list && black_list_exists) { char path[PATH_MAX]; - snprintf(path, PATH_MAX, BLACK_LIST_PATH "%s", package_name); + snprintf(path, PATH_MAX, "%s%s", blacklist_path.c_str(), package_name); int res = access(path, F_OK) != 0; LOGD("use blacklist, res=%d", res); return res; From 1d950a68c787154388dc437799633f2e10e7b1ef Mon Sep 17 00:00:00 2001 From: mlgmxyysd <1204074991@qq.com> Date: Mon, 18 Feb 2019 17:13:54 +0800 Subject: [PATCH 2/7] Bump version --- Core/template_override/module.prop | 4 ++-- Core/template_override/riru_module.prop | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/template_override/module.prop b/Core/template_override/module.prop index 76a5b95ed..f47fa3dfa 100644 --- a/Core/template_override/module.prop +++ b/Core/template_override/module.prop @@ -1,7 +1,7 @@ id=riru_edxposed name=Riru - Ed Xposed version=v0.2.9.8_beta1 -versionCode=1 -author=givein2u +versionCode=2981 +author=givein2u & MlgmXyysd description=Magisk version of Xposed. Require Riru - Core installed. minMagisk=17000 diff --git a/Core/template_override/riru_module.prop b/Core/template_override/riru_module.prop index 93b1b15ee..4b86b124d 100644 --- a/Core/template_override/riru_module.prop +++ b/Core/template_override/riru_module.prop @@ -1,5 +1,5 @@ name=Ed Xposed version=v0.2.9.8_beta1 -versionCode=1 -author=givein2u -description=Elder driver Xposed for Android Pie. Require Riru - Core installed. \ No newline at end of file +versionCode=2981 +author=givein2u & MlgmXyysd +description=Magisk version of Xposed. Require Riru - Core installed. From ddf0465f45e4a221d3c53047a62fbe1296f00e78 Mon Sep 17 00:00:00 2001 From: Jim Wu Date: Tue, 19 Feb 2019 00:00:35 +0800 Subject: [PATCH 3/7] Bump version --- Core/template_override/system/framework/edconfig.dex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/template_override/system/framework/edconfig.dex b/Core/template_override/system/framework/edconfig.dex index 4508604a9..1d34badda 100644 --- a/Core/template_override/system/framework/edconfig.dex +++ b/Core/template_override/system/framework/edconfig.dex @@ -1,4 +1,4 @@ -version=90.0-0.2.9.8 (by Elder Driver) +version=0.2.9.9 arch=arm64 minsdk=23 maxsdk=28 From 59c0f58ca707da6b2dc5be48cebad39d6ac31119 Mon Sep 17 00:00:00 2001 From: Jim Wu Date: Tue, 19 Feb 2019 00:01:27 +0800 Subject: [PATCH 4/7] Bump version --- Core/template_override/module.prop | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/template_override/module.prop b/Core/template_override/module.prop index f47fa3dfa..4ba343cc3 100644 --- a/Core/template_override/module.prop +++ b/Core/template_override/module.prop @@ -1,7 +1,7 @@ id=riru_edxposed name=Riru - Ed Xposed -version=v0.2.9.8_beta1 -versionCode=2981 +version=v0.2.9.9 +versionCode=2990 author=givein2u & MlgmXyysd description=Magisk version of Xposed. Require Riru - Core installed. minMagisk=17000 From 6f9b7cef3e5b585ce97b7659e3a07ea93da0d3f7 Mon Sep 17 00:00:00 2001 From: Jim Wu Date: Tue, 19 Feb 2019 00:04:23 +0800 Subject: [PATCH 5/7] Bump version --- Core/template_override/module.prop | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/template_override/module.prop b/Core/template_override/module.prop index 4ba343cc3..620fd0b3e 100644 --- a/Core/template_override/module.prop +++ b/Core/template_override/module.prop @@ -1,7 +1,7 @@ id=riru_edxposed name=Riru - Ed Xposed -version=v0.2.9.9 -versionCode=2990 +version=v0.2.8.9 +versionCode=2890 author=givein2u & MlgmXyysd description=Magisk version of Xposed. Require Riru - Core installed. minMagisk=17000 From 0f8a2616931da6a8e097598508206ffe62e08b75 Mon Sep 17 00:00:00 2001 From: Jim Wu Date: Tue, 19 Feb 2019 00:05:21 +0800 Subject: [PATCH 6/7] Bump version --- Core/template_override/module.prop | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/template_override/module.prop b/Core/template_override/module.prop index 620fd0b3e..4ba343cc3 100644 --- a/Core/template_override/module.prop +++ b/Core/template_override/module.prop @@ -1,7 +1,7 @@ id=riru_edxposed name=Riru - Ed Xposed -version=v0.2.8.9 -versionCode=2890 +version=v0.2.9.9 +versionCode=2990 author=givein2u & MlgmXyysd description=Magisk version of Xposed. Require Riru - Core installed. minMagisk=17000 From e253fee44fafa529a26569d5e24495ae650f73cd Mon Sep 17 00:00:00 2001 From: Jim Wu Date: Tue, 19 Feb 2019 00:05:44 +0800 Subject: [PATCH 7/7] Bump version --- Core/template_override/riru_module.prop | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/template_override/riru_module.prop b/Core/template_override/riru_module.prop index 4b86b124d..ce78c8faf 100644 --- a/Core/template_override/riru_module.prop +++ b/Core/template_override/riru_module.prop @@ -1,5 +1,5 @@ name=Ed Xposed -version=v0.2.9.8_beta1 -versionCode=2981 +version=v0.2.9.9 +versionCode=2990 author=givein2u & MlgmXyysd description=Magisk version of Xposed. Require Riru - Core installed.