From 63b470f2ebd3472e7821a81e842adcaf93ac2c13 Mon Sep 17 00:00:00 2001 From: RikkaW Date: Sun, 19 Apr 2020 16:25:16 +0800 Subject: [PATCH] support Android R also remove things only for old Q beta --- module/build.gradle | 4 +- module/src/main/cpp/jni_native_method.cpp | 139 +++++++++++----------- module/src/main/cpp/jni_native_method.h | 35 +++--- module/src/main/cpp/main.cpp | 17 +-- module/src/main/cpp/module.h | 13 +- template/magisk_module/README.md | 4 + 6 files changed, 109 insertions(+), 103 deletions(-) diff --git a/module/build.gradle b/module/build.gradle index cd35b037..9c6cc547 100644 --- a/module/build.gradle +++ b/module/build.gradle @@ -9,8 +9,8 @@ def apiVersion = 5 def moduleProp = [ id : "riru-core", name : "Riru (Riru - Core)", - version : "v20.0", - versionCode: "31", + version : "v20.1", + versionCode: "32", author : "Rikka", description: "Inject zygote process by replace libmemtrack.so, provide interface to other Riru modules." ] diff --git a/module/src/main/cpp/jni_native_method.cpp b/module/src/main/cpp/jni_native_method.cpp index 620ef162..d7d365eb 100644 --- a/module/src/main/cpp/jni_native_method.cpp +++ b/module/src/main/cpp/jni_native_method.cpp @@ -64,8 +64,7 @@ static void nativeForkAndSpecialize_pre( JNIEnv *env, jclass clazz, jint &uid, jint &gid, jintArray &gids, jint &runtime_flags, jobjectArray &rlimits, jint &mount_external, jstring &se_info, jstring &se_name, jintArray &fdsToClose, jintArray &fdsToIgnore, jboolean &is_child_zygote, - jstring &instructionSet, jstring &appDataDir, jstring &packageName, - jobjectArray &packagesForUID, jstring &sandboxId) { + jstring &instructionSet, jstring &appDataDir, jboolean &isTopApp, jobjectArray &pkgDataInfoList) { nativeForkAndSpecialize_calls_count++; @@ -79,7 +78,16 @@ static void nativeForkAndSpecialize_pre( if (!module->shouldSkipUid && shouldSkipUid(uid)) continue; - if (module->apiVersion >= 3) { + if (module->apiVersion >= 5) { + ((nativeForkAndSpecialize_pre_v5_t *) module->forkAndSpecializePre)( + env, clazz, &uid, &gid, &gids, &runtime_flags, &rlimits, &mount_external, + &se_info, &se_name, &fdsToClose, &fdsToIgnore, &is_child_zygote, + &instructionSet, &appDataDir, &isTopApp, &pkgDataInfoList); + } else if (module->apiVersion >= 3) { + jstring packageName = nullptr; + jobjectArray packagesForUID = nullptr; + jstring sandboxId = nullptr; + ((nativeForkAndSpecialize_pre_v3_t *) module->forkAndSpecializePre)( env, clazz, &uid, &gid, &gids, &runtime_flags, &rlimits, &mount_external, &se_info, &se_name, &fdsToClose, &fdsToIgnore, &is_child_zygote, @@ -133,8 +141,8 @@ static void nativeForkAndSpecialize_post(JNIEnv *env, jclass clazz, jint uid, ji static void nativeSpecializeAppProcess_pre( JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtimeFlags, jobjectArray rlimits, jint mountExternal, jstring seInfo, jstring niceName, - jboolean startChildZygote, jstring instructionSet, jstring appDataDir, jstring packageName, - jobjectArray packagesForUID, jstring sandboxId) { + jboolean startChildZygote, jstring instructionSet, jstring appDataDir, + jboolean &isTopApp, jobjectArray &pkgDataInfoList) { nativeSpecializeAppProcess_calls_count++; @@ -142,8 +150,17 @@ static void nativeSpecializeAppProcess_pre( if (!module->specializeAppProcessPre) continue; - if (module->apiVersion >= 4) { - ((nativeSpecializeAppProcess_pre_t *) module->specializeAppProcessPre)( + if (module->apiVersion >= 5) { + ((nativeSpecializeAppProcess_pre_v5_t *) module->specializeAppProcessPre)( + env, clazz, &uid, &gid, &gids, &runtimeFlags, &rlimits, &mountExternal, &seInfo, + &niceName, &startChildZygote, &instructionSet, &appDataDir, &isTopApp, + &pkgDataInfoList); + } else if (module->apiVersion >= 4) { + jstring packageName = nullptr; + jobjectArray packagesForUID = nullptr; + jstring sandboxId = nullptr; + + ((nativeSpecializeAppProcess_pre_v4_t *) module->specializeAppProcessPre)( env, clazz, &uid, &gid, &gids, &runtimeFlags, &rlimits, &mountExternal, &seInfo, &niceName, &startChildZygote, &instructionSet, &appDataDir, &packageName, &packagesForUID, &sandboxId); @@ -209,14 +226,12 @@ jint nativeForkAndSpecialize_marshmallow( jintArray fdsToIgnore = nullptr; jboolean is_child_zygote = JNI_FALSE; - jstring packageName = nullptr; - jobjectArray packagesForUID = nullptr; - jstring sandboxId = nullptr; + jboolean isTopApp = JNI_FALSE; + jobjectArray pkgDataInfoList = nullptr; nativeForkAndSpecialize_pre(env, clazz, uid, gid, gids, debug_flags, rlimits, mount_external, se_info, se_name, fdsToClose, fdsToIgnore, is_child_zygote, - instructionSet, appDataDir, packageName, packagesForUID, - sandboxId); + instructionSet, appDataDir, isTopApp, pkgDataInfoList); jint res = ((nativeForkAndSpecialize_marshmallow_t *) _nativeForkAndSpecialize)( env, clazz, uid, gid, gids, debug_flags, rlimits, mount_external, se_info, se_name, @@ -232,14 +247,12 @@ jint nativeForkAndSpecialize_oreo( jintArray fdsToClose, jintArray fdsToIgnore, jstring instructionSet, jstring appDataDir) { jboolean is_child_zygote = JNI_FALSE; - jstring packageName = nullptr; - jobjectArray packagesForUID = nullptr; - jstring sandboxId = nullptr; + jboolean isTopApp = JNI_FALSE; + jobjectArray pkgDataInfoList = nullptr; nativeForkAndSpecialize_pre(env, clazz, uid, gid, gids, debug_flags, rlimits, mount_external, se_info, se_name, fdsToClose, fdsToIgnore, is_child_zygote, - instructionSet, appDataDir, packageName, packagesForUID, - sandboxId); + instructionSet, appDataDir, isTopApp, pkgDataInfoList); jint res = ((nativeForkAndSpecialize_oreo_t *) _nativeForkAndSpecialize)( env, clazz, uid, gid, gids, debug_flags, rlimits, mount_external, se_info, se_name, @@ -255,14 +268,12 @@ jint nativeForkAndSpecialize_p( jintArray fdsToClose, jintArray fdsToIgnore, jboolean is_child_zygote, jstring instructionSet, jstring appDataDir) { - jstring packageName = nullptr; - jobjectArray packagesForUID = nullptr; - jstring sandboxId = nullptr; + jboolean isTopApp = JNI_FALSE; + jobjectArray pkgDataInfoList = nullptr; nativeForkAndSpecialize_pre(env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, se_name, fdsToClose, fdsToIgnore, is_child_zygote, - instructionSet, appDataDir, packageName, packagesForUID, - sandboxId); + instructionSet, appDataDir, isTopApp, pkgDataInfoList); jint res = ((nativeForkAndSpecialize_p_t *) _nativeForkAndSpecialize)( env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, se_name, @@ -272,22 +283,19 @@ jint nativeForkAndSpecialize_p( return res; } -jint nativeForkAndSpecialize_q_beta4( +jint nativeForkAndSpecialize_r( JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtime_flags, jobjectArray rlimits, jint mount_external, jstring se_info, jstring se_name, jintArray fdsToClose, jintArray fdsToIgnore, jboolean is_child_zygote, - jstring instructionSet, jstring appDataDir, jstring packageName, - jobjectArray packagesForUID, jstring sandboxId) { + jstring instructionSet, jstring appDataDir, jboolean isTopApp, jobjectArray pkgDataInfoList) { nativeForkAndSpecialize_pre(env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, se_name, fdsToClose, fdsToIgnore, is_child_zygote, - instructionSet, appDataDir, packageName, packagesForUID, - sandboxId); + instructionSet, appDataDir, isTopApp, pkgDataInfoList); - jint res = ((nativeForkAndSpecialize_q_beta4_t *) _nativeForkAndSpecialize)( + jint res = ((nativeForkAndSpecialize_r_t *) _nativeForkAndSpecialize)( env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, se_name, - fdsToClose, fdsToIgnore, is_child_zygote, instructionSet, appDataDir, packageName, - packagesForUID, sandboxId); + fdsToClose, fdsToIgnore, is_child_zygote, instructionSet, appDataDir, isTopApp, pkgDataInfoList); nativeForkAndSpecialize_post(env, clazz, uid, res); return res; @@ -299,14 +307,12 @@ jint nativeForkAndSpecialize_samsung_p( jstring se_name, jintArray fdsToClose, jintArray fdsToIgnore, jboolean is_child_zygote, jstring instructionSet, jstring appDataDir) { - jstring packageName = nullptr; - jobjectArray packagesForUID = nullptr; - jstring sandboxId = nullptr; + jboolean isTopApp = JNI_FALSE; + jobjectArray pkgDataInfoList = nullptr; nativeForkAndSpecialize_pre(env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, se_name, fdsToClose, fdsToIgnore, is_child_zygote, - instructionSet, appDataDir, packageName, packagesForUID, - sandboxId); + instructionSet, appDataDir, isTopApp, pkgDataInfoList); jint res = ((nativeForkAndSpecialize_samsung_p_t *) _nativeForkAndSpecialize)( env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, category, @@ -324,14 +330,12 @@ jint nativeForkAndSpecialize_samsung_o( jstring appDataDir) { jboolean is_child_zygote = JNI_FALSE; - jstring packageName = nullptr; - jobjectArray packagesForUID = nullptr; - jstring sandboxId = nullptr; + jboolean isTopApp = JNI_FALSE; + jobjectArray pkgDataInfoList = nullptr; nativeForkAndSpecialize_pre(env, clazz, uid, gid, gids, debug_flags, rlimits, mount_external, se_info, se_name, fdsToClose, fdsToIgnore, is_child_zygote, - instructionSet, appDataDir, packageName, packagesForUID, - sandboxId); + instructionSet, appDataDir, isTopApp, pkgDataInfoList); jint res = ((nativeForkAndSpecialize_samsung_o_t *) _nativeForkAndSpecialize)( env, clazz, uid, gid, gids, debug_flags, rlimits, mount_external, se_info, category, @@ -349,14 +353,12 @@ jint nativeForkAndSpecialize_samsung_n( jintArray fdsToIgnore = nullptr; jboolean is_child_zygote = JNI_FALSE; - jstring packageName = nullptr; - jobjectArray packagesForUID = nullptr; - jstring sandboxId = nullptr; + jboolean isTopApp = JNI_FALSE; + jobjectArray pkgDataInfoList = nullptr; nativeForkAndSpecialize_pre(env, clazz, uid, gid, gids, debug_flags, rlimits, mount_external, se_info, se_name, fdsToClose, fdsToIgnore, is_child_zygote, - instructionSet, appDataDir, packageName, packagesForUID, - sandboxId); + instructionSet, appDataDir, isTopApp, pkgDataInfoList); jint res = ((nativeForkAndSpecialize_samsung_n_t *) _nativeForkAndSpecialize)( env, clazz, uid, gid, gids, debug_flags, rlimits, mount_external, se_info, category, @@ -373,14 +375,12 @@ jint nativeForkAndSpecialize_samsung_m( jintArray fdsToIgnore = nullptr; jboolean is_child_zygote = JNI_FALSE; - jstring packageName = nullptr; - jobjectArray packagesForUID = nullptr; - jstring sandboxId = nullptr; + jboolean isTopApp = JNI_FALSE; + jobjectArray pkgDataInfoList = nullptr; nativeForkAndSpecialize_pre(env, clazz, uid, gid, gids, debug_flags, rlimits, mount_external, se_info, se_name, fdsToClose, fdsToIgnore, is_child_zygote, - instructionSet, appDataDir, packageName, packagesForUID, - sandboxId); + instructionSet, appDataDir, isTopApp, pkgDataInfoList); jint res = ((nativeForkAndSpecialize_samsung_m_t *) _nativeForkAndSpecialize)( env, clazz, uid, gid, gids, debug_flags, rlimits, mount_external, se_info, category, @@ -392,57 +392,54 @@ jint nativeForkAndSpecialize_samsung_m( // ----------------------------------------------------------------- -void nativeSpecializeAppProcess_q_beta4( +void nativeSpecializeAppProcess( JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtimeFlags, jobjectArray rlimits, jint mountExternal, jstring seInfo, jstring niceName, - jboolean startChildZygote, jstring instructionSet, jstring appDataDir, jstring packageName, - jobjectArray packagesForUID, jstring sandboxId) { + jboolean startChildZygote, jstring instructionSet, jstring appDataDir) { + + jboolean isTopApp = JNI_FALSE; + jobjectArray pkgDataInfoList = nullptr; nativeSpecializeAppProcess_pre( env, clazz, uid, gid, gids, runtimeFlags, rlimits, mountExternal, seInfo, niceName, - startChildZygote, instructionSet, appDataDir, packageName, packagesForUID, - sandboxId); + startChildZygote, instructionSet, appDataDir, isTopApp, pkgDataInfoList); - ((nativeSpecializeAppProcess_q_beta4_t *) _nativeSpecializeAppProcess)( + ((nativeSpecializeAppProcess_t *) _nativeSpecializeAppProcess)( env, clazz, uid, gid, gids, runtimeFlags, rlimits, mountExternal, seInfo, niceName, - startChildZygote, instructionSet, appDataDir, packageName, packagesForUID, - sandboxId); + startChildZygote, instructionSet, appDataDir); nativeSpecializeAppProcess_post(env, clazz); } -void nativeSpecializeAppProcess( +void nativeSpecializeAppProcess_r( JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtimeFlags, jobjectArray rlimits, jint mountExternal, jstring seInfo, jstring niceName, - jboolean startChildZygote, jstring instructionSet, jstring appDataDir) { - - jstring packageName = nullptr; - jobjectArray packagesForUID = nullptr; - jstring sandboxId = nullptr; + jboolean startChildZygote, jstring instructionSet, jstring appDataDir, + jboolean isTopApp, jobjectArray pkgDataInfoList) { nativeSpecializeAppProcess_pre( env, clazz, uid, gid, gids, runtimeFlags, rlimits, mountExternal, seInfo, niceName, - startChildZygote, instructionSet, appDataDir, packageName, packagesForUID, sandboxId); + startChildZygote, instructionSet, appDataDir, isTopApp, pkgDataInfoList); - ((nativeSpecializeAppProcess_t *) _nativeSpecializeAppProcess)( + ((nativeSpecializeAppProcess_r_t *) _nativeSpecializeAppProcess)( env, clazz, uid, gid, gids, runtimeFlags, rlimits, mountExternal, seInfo, niceName, - startChildZygote, instructionSet, appDataDir); + startChildZygote, instructionSet, appDataDir, isTopApp, pkgDataInfoList); nativeSpecializeAppProcess_post(env, clazz); } + void nativeSpecializeAppProcess_samsung( JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtimeFlags, jobjectArray rlimits, jint mountExternal, jstring seInfo, jint space, jint accessInfo, jstring niceName, jboolean startChildZygote, jstring instructionSet, jstring appDataDir) { - jstring packageName = nullptr; - jobjectArray packagesForUID = nullptr; - jstring sandboxId = nullptr; + jboolean isTopApp = JNI_FALSE; + jobjectArray pkgDataInfoList = nullptr; nativeSpecializeAppProcess_pre( env, clazz, uid, gid, gids, runtimeFlags, rlimits, mountExternal, seInfo, niceName, - startChildZygote, instructionSet, appDataDir, packageName, packagesForUID, sandboxId); + startChildZygote, instructionSet, appDataDir, isTopApp, pkgDataInfoList); ((nativeSpecializeAppProcess_samsung_t *) _nativeSpecializeAppProcess)( env, clazz, uid, gid, gids, runtimeFlags, rlimits, mountExternal, seInfo, space, diff --git a/module/src/main/cpp/jni_native_method.h b/module/src/main/cpp/jni_native_method.h index 07706595..8954e909 100644 --- a/module/src/main/cpp/jni_native_method.h +++ b/module/src/main/cpp/jni_native_method.h @@ -45,19 +45,17 @@ jint nativeForkAndSpecialize_p( jintArray fdsToClose, jintArray fdsToIgnore, jboolean is_child_zygote, jstring instructionSet, jstring appDataDir); -// removed from beta5 -const static char *nativeForkAndSpecialize_q_beta4_sig = "(II[II[[IILjava/lang/String;Ljava/lang/String;[I[IZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)I"; +const static char *nativeForkAndSpecialize_r_sig ="(II[II[[IILjava/lang/String;Ljava/lang/String;[I[IZLjava/lang/String;Ljava/lang/String;Z[Ljava/lang/String;)I"; -using nativeForkAndSpecialize_q_beta4_t = jint( +using nativeForkAndSpecialize_r_t = jint( JNIEnv *, jclass, jint, jint, jintArray, jint, jobjectArray, jint, jstring, jstring, - jintArray, jintArray, jboolean, jstring, jstring, jstring, jobjectArray, jstring); + jintArray, jintArray, jboolean, jstring, jstring, jboolean, jobjectArray); -jint nativeForkAndSpecialize_q_beta4( +jint nativeForkAndSpecialize_r( JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtime_flags, jobjectArray rlimits, jint mount_external, jstring se_info, jstring se_name, jintArray fdsToClose, jintArray fdsToIgnore, jboolean is_child_zygote, - jstring instructionSet, jstring appDataDir, jstring packageName, - jobjectArray packagesForUID, jstring sandboxId); + jstring instructionSet, jstring appDataDir, jboolean isTopApp, jobjectArray pkgDataInfoList); const static char *nativeForkAndSpecialize_samsung_p_sig = "(II[II[[IILjava/lang/String;IILjava/lang/String;[I[IZLjava/lang/String;Ljava/lang/String;)I"; @@ -107,29 +105,28 @@ jint nativeForkAndSpecialize_samsung_m( // ----------------------------------------------------------------- -// removed from beta5 -const static char *nativeSpecializeAppProcess_sig_q_beta4 = "(II[II[[IILjava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V"; +const static char *nativeSpecializeAppProcess_sig = "(II[II[[IILjava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;)V"; -using nativeSpecializeAppProcess_q_beta4_t = void( +using nativeSpecializeAppProcess_t = void( JNIEnv *, jclass, jint, jint, jintArray, jint, jobjectArray, jint, jstring, jstring, - jboolean, jstring, jstring, jstring, jobjectArray, jstring); + jboolean, jstring, jstring); -void nativeSpecializeAppProcess_q_beta4( +void nativeSpecializeAppProcess( JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtimeFlags, jobjectArray rlimits, jint mountExternal, jstring seInfo, jstring niceName, - jboolean startChildZygote, jstring instructionSet, jstring appDataDir, jstring packageName, - jobjectArray packagesForUID, jstring sandboxId); + jboolean startChildZygote, jstring instructionSet, jstring appDataDir); -const static char *nativeSpecializeAppProcess_sig = "(II[II[[IILjava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;)V"; +const static char *nativeSpecializeAppProcess_r_sig = "(II[II[[IILjava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Z[Ljava/lang/String;)V"; -using nativeSpecializeAppProcess_t = void( +using nativeSpecializeAppProcess_r_t = void( JNIEnv *, jclass, jint, jint, jintArray, jint, jobjectArray, jint, jstring, jstring, - jboolean, jstring, jstring); + jboolean, jstring, jstring, jboolean, jobjectArray); -void nativeSpecializeAppProcess( +void nativeSpecializeAppProcess_r( JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtimeFlags, jobjectArray rlimits, jint mountExternal, jstring seInfo, jstring niceName, - jboolean startChildZygote, jstring instructionSet, jstring appDataDir); + jboolean startChildZygote, jstring instructionSet, jstring appDataDir, + jboolean isTopApp, jobjectArray pkgDataInfoList); const static char *nativeSpecializeAppProcess_sig_samsung ="(II[II[[IILjava/lang/String;IILjava/lang/String;ZLjava/lang/String;Ljava/lang/String;)V"; diff --git a/module/src/main/cpp/main.cpp b/module/src/main/cpp/main.cpp index ba5aefcc..a8882697 100644 --- a/module/src/main/cpp/main.cpp +++ b/module/src/main/cpp/main.cpp @@ -161,14 +161,15 @@ static JNINativeMethod *onRegisterZygote(JNIEnv *env, const char *className, if (strcmp(method.name, "nativeForkAndSpecialize") == 0) { set_nativeForkAndSpecialize(method.fnPtr); - if (strcmp(nativeForkAndSpecialize_marshmallow_sig, method.signature) == 0) - newMethods[i].fnPtr = (void *) nativeForkAndSpecialize_marshmallow; - else if (strcmp(nativeForkAndSpecialize_oreo_sig, method.signature) == 0) - newMethods[i].fnPtr = (void *) nativeForkAndSpecialize_oreo; + if (strcmp(nativeForkAndSpecialize_r_sig, method.signature) == 0) + newMethods[i].fnPtr = (void *) nativeForkAndSpecialize_r; else if (strcmp(nativeForkAndSpecialize_p_sig, method.signature) == 0) newMethods[i].fnPtr = (void *) nativeForkAndSpecialize_p; - else if (strcmp(nativeForkAndSpecialize_q_beta4_sig, method.signature) == 0) - newMethods[i].fnPtr = (void *) nativeForkAndSpecialize_q_beta4; + else if (strcmp(nativeForkAndSpecialize_oreo_sig, method.signature) == 0) + newMethods[i].fnPtr = (void *) nativeForkAndSpecialize_oreo; + else if (strcmp(nativeForkAndSpecialize_marshmallow_sig, method.signature) == 0) + newMethods[i].fnPtr = (void *) nativeForkAndSpecialize_marshmallow; + else if (strcmp(nativeForkAndSpecialize_samsung_p_sig, method.signature) == 0) newMethods[i].fnPtr = (void *) nativeForkAndSpecialize_samsung_p; else if (strcmp(nativeForkAndSpecialize_samsung_o_sig, method.signature) == 0) @@ -190,8 +191,8 @@ static JNINativeMethod *onRegisterZygote(JNIEnv *env, const char *className, } else if (strcmp(method.name, "nativeSpecializeAppProcess") == 0) { set_nativeSpecializeAppProcess(method.fnPtr); - if (strcmp(nativeSpecializeAppProcess_sig_q_beta4, method.signature) == 0) - newMethods[i].fnPtr = (void *) nativeSpecializeAppProcess_q_beta4; + if (strcmp(nativeSpecializeAppProcess_r_sig, method.signature) == 0) + newMethods[i].fnPtr = (void *) nativeSpecializeAppProcess_r; else if (strcmp(nativeSpecializeAppProcess_sig, method.signature) == 0) newMethods[i].fnPtr = (void *) nativeSpecializeAppProcess; else if (strcmp(nativeSpecializeAppProcess_sig_samsung, method.signature) == 0) diff --git a/module/src/main/cpp/module.h b/module/src/main/cpp/module.h index d40534c6..78dd995f 100644 --- a/module/src/main/cpp/module.h +++ b/module/src/main/cpp/module.h @@ -24,14 +24,17 @@ using nativeForkAndSpecialize_pre_v3_t = void( jstring *, jintArray *, jintArray *, jboolean *, jstring *, jstring *, jstring *, jobjectArray *, jstring *); +using nativeForkAndSpecialize_pre_v5_t = void( + JNIEnv *, jclass, jint *, jint *, jintArray *, jint *, jobjectArray *, jint *, jstring *, + jstring *, jintArray *, jintArray *, jboolean *, jstring *, jstring *, jboolean *, jobjectArray *); + using nativeForkAndSpecialize_post_t = int( JNIEnv *, jclass, jint); // --------------------------------------------------------- using nativeForkSystemServer_pre_t = void( - JNIEnv *, jclass, uid_t, gid_t, jintArray, - jint, jobjectArray, jlong, jlong); + JNIEnv *, jclass, uid_t, gid_t, jintArray, jint, jobjectArray, jlong, jlong); using nativeForkSystemServer_pre_v2_t = void( JNIEnv *, jclass, uid_t *, gid_t *, jintArray *, jint *, jobjectArray *, jlong *, jlong *); @@ -40,10 +43,14 @@ using nativeForkSystemServer_post_t = int(JNIEnv *, jclass, jint); // --------------------------------------------------------- -using nativeSpecializeAppProcess_pre_t = void( +using nativeSpecializeAppProcess_pre_v4_t = void( JNIEnv *, jclass, jint *, jint *, jintArray *, jint *, jobjectArray *, jint *, jstring *, jstring *, jboolean *, jstring *, jstring *, jstring *, jobjectArray *, jstring *); +using nativeSpecializeAppProcess_pre_v5_t = void( + JNIEnv *, jclass, jint *, jint *, jintArray *, jint *, jobjectArray *, jint *, jstring *, + jstring *, jboolean *, jstring *, jstring *, jboolean *, jobjectArray *); + using nativeSpecializeAppProcess_post_t = int(JNIEnv *, jclass); using shouldSkipUid_t = int(int); diff --git a/template/magisk_module/README.md b/template/magisk_module/README.md index cddc4b32..d236e827 100644 --- a/template/magisk_module/README.md +++ b/template/magisk_module/README.md @@ -8,6 +8,10 @@ See [https://github.com/RikkaApps/Riru](https://github.com/RikkaApps/Riru) for m ## Changelog +### v20.1 (32) (2020-04-21) + +- Works Android R DP2 + ### v19.8 (30) - Fix install script for x86 ([#91](https://github.com/RikkaApps/Riru/pull/91))