Skip to content

Commit

Permalink
fix 10
Browse files Browse the repository at this point in the history
  • Loading branch information
ggsasda authored Oct 24, 2024
1 parent 0e920ae commit c723a4f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions loader/src/injector/jni_hooks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ void *nativeSpecializeAppProcess_orig = nullptr;
jboolean is_top_app, jobjectArray pkg_data_info_list, jobjectArray whitelisted_data_info_list,
jboolean mount_data_dirs, jboolean mount_storage_dirs, jboolean mount_sysprop_overrides, jlongArray _14
) {
// Initialize the AppSpecializeArgs_v5 structure
AppSpecializeArgs_v5 args(uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, nice_name, instruction_set, app_data_dir);

// Set pointers for specific fields
args.is_child_zygote = &is_child_zygote;
args.is_top_app = &is_top_app;
args.pkg_data_info_list = &pkg_data_info_list;
Expand All @@ -304,16 +307,18 @@ void *nativeSpecializeAppProcess_orig = nullptr;
args.mount_storage_dirs = &mount_storage_dirs;
args.mount_sysprop_overrides = &mount_sysprop_overrides;

// Create the Zygisk context
ZygiskContext ctx(env, &args);
ctx.nativeSpecializeAppProcess_pre();

// Call the appropriate `zygote_methods` function pointer based on GrapheneOS
reinterpret_cast<decltype(&nativeSpecializeAppProcess_grapheneos_u)>(g_hook->zygote_methods[12].fnPtr)(
// Call the original method
reinterpret_cast<decltype(&nativeSpecializeAppProcess_grapheneos_u)>(nativeSpecializeAppProcess_orig)(
env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, nice_name,
is_child_zygote, instruction_set, app_data_dir, is_top_app, pkg_data_info_list,
whitelisted_data_info_list, mount_data_dirs, mount_storage_dirs, mount_sysprop_overrides, _14
);

// Post-process
ctx.nativeSpecializeAppProcess_post();
}

Expand Down

0 comments on commit c723a4f

Please sign in to comment.