From 1ec33863bcf06d6a8ea46df9c8e0e6f210c12dc4 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Wed, 11 Aug 2021 17:14:22 -0700 Subject: [PATCH] Android 5.0 is actually supported --- native/jni/inject/gen_jni_hooks.py | 4 ++-- native/jni/inject/jni_hooks.hpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/native/jni/inject/gen_jni_hooks.py b/native/jni/inject/gen_jni_hooks.py index a5d12e1e0..27e2ae16a 100755 --- a/native/jni/inject/gen_jni_hooks.py +++ b/native/jni/inject/gen_jni_hooks.py @@ -87,7 +87,7 @@ permitted_capabilities = Argument('permitted_capabilities', jlong) effective_capabilities = Argument('effective_capabilities', jlong) # Method definitions -fork_m = Method('m', [uid, gid, gids, runtime_flags, rlimits, mount_external, +fork_l = Method('l', [uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, nice_name, fds_to_close, instruction_set, app_data_dir]) fork_o = Method('o', [uid, gid, gids, runtime_flags, rlimits, mount_external, @@ -183,7 +183,7 @@ def gen_definitions(methods, base_name): return decl def gen_fork(): - methods = [fork_m, fork_o, fork_p, fork_q_alt, fork_r, fork_samsung_m, fork_samsung_n, fork_samsung_o, fork_samsung_p] + methods = [fork_l, fork_o, fork_p, fork_q_alt, fork_r, fork_samsung_m, fork_samsung_n, fork_samsung_o, fork_samsung_p] return gen_definitions(methods, 'nativeForkAndSpecialize') def gen_spec(): diff --git a/native/jni/inject/jni_hooks.hpp b/native/jni/inject/jni_hooks.hpp index 3f326cbdb..522480805 100644 --- a/native/jni/inject/jni_hooks.hpp +++ b/native/jni/inject/jni_hooks.hpp @@ -1,11 +1,11 @@ // Generated by gen_jni_hooks.py -static jint nativeForkAndSpecialize_m(JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtime_flags, jobjectArray rlimits, jint mount_external, jstring se_info, jstring nice_name, jintArray fds_to_close, jstring instruction_set, jstring app_data_dir) { +static jint nativeForkAndSpecialize_l(JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtime_flags, jobjectArray rlimits, jint mount_external, jstring se_info, jstring nice_name, jintArray fds_to_close, jstring instruction_set, jstring app_data_dir) { HookContext ctx{}; SpecializeAppProcessArgs args(uid, gid, gids, runtime_flags, mount_external, se_info, nice_name, instruction_set, app_data_dir); ctx.raw_args = &args; nativeForkAndSpecialize_pre(&ctx, env, clazz); - reinterpret_cast(nativeForkAndSpecialize_orig)( + reinterpret_cast(nativeForkAndSpecialize_orig)( env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, nice_name, fds_to_close, instruction_set, app_data_dir ); nativeForkAndSpecialize_post(&ctx, env, clazz); @@ -114,7 +114,7 @@ const JNINativeMethod nativeForkAndSpecialize_methods[] = { { "nativeForkAndSpecialize", "(II[II[[IILjava/lang/String;Ljava/lang/String;[ILjava/lang/String;Ljava/lang/String;)I", - (void *) &nativeForkAndSpecialize_m + (void *) &nativeForkAndSpecialize_l }, { "nativeForkAndSpecialize",