mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-25 21:57:39 +00:00
300 lines
18 KiB
C++
300 lines
18 KiB
C++
// Generated by gen_jni_hooks.py
|
|
|
|
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) {
|
|
SpecializeAppProcessArgs args(uid, gid, gids, runtime_flags, mount_external, se_info, nice_name, instruction_set, app_data_dir);
|
|
HookContext ctx;
|
|
ctx.env = env;
|
|
ctx.clazz = clazz;
|
|
ctx.raw_args = &args;
|
|
ctx.nativeForkAndSpecialize_pre();
|
|
reinterpret_cast<decltype(&nativeForkAndSpecialize_l)>(HookContext::nativeForkAndSpecialize_orig)(
|
|
env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, nice_name, fds_to_close, instruction_set, app_data_dir
|
|
);
|
|
ctx.nativeForkAndSpecialize_post();
|
|
return ctx.pid;
|
|
}
|
|
jint nativeForkAndSpecialize_o(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, jintArray fds_to_ignore, jstring instruction_set, jstring app_data_dir) {
|
|
SpecializeAppProcessArgs args(uid, gid, gids, runtime_flags, mount_external, se_info, nice_name, instruction_set, app_data_dir);
|
|
HookContext ctx;
|
|
ctx.env = env;
|
|
ctx.clazz = clazz;
|
|
ctx.raw_args = &args;
|
|
ctx.nativeForkAndSpecialize_pre();
|
|
reinterpret_cast<decltype(&nativeForkAndSpecialize_o)>(HookContext::nativeForkAndSpecialize_orig)(
|
|
env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, nice_name, fds_to_close, fds_to_ignore, instruction_set, app_data_dir
|
|
);
|
|
ctx.nativeForkAndSpecialize_post();
|
|
return ctx.pid;
|
|
}
|
|
jint nativeForkAndSpecialize_p(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, jintArray fds_to_ignore, jboolean is_child_zygote, jstring instruction_set, jstring app_data_dir) {
|
|
SpecializeAppProcessArgs args(uid, gid, gids, runtime_flags, mount_external, se_info, nice_name, instruction_set, app_data_dir);
|
|
args.is_child_zygote = &is_child_zygote;
|
|
HookContext ctx;
|
|
ctx.env = env;
|
|
ctx.clazz = clazz;
|
|
ctx.raw_args = &args;
|
|
ctx.nativeForkAndSpecialize_pre();
|
|
reinterpret_cast<decltype(&nativeForkAndSpecialize_p)>(HookContext::nativeForkAndSpecialize_orig)(
|
|
env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, nice_name, fds_to_close, fds_to_ignore, is_child_zygote, instruction_set, app_data_dir
|
|
);
|
|
ctx.nativeForkAndSpecialize_post();
|
|
return ctx.pid;
|
|
}
|
|
jint nativeForkAndSpecialize_q_alt(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, jintArray fds_to_ignore, jboolean is_child_zygote, jstring instruction_set, jstring app_data_dir, jboolean is_top_app) {
|
|
SpecializeAppProcessArgs args(uid, gid, gids, runtime_flags, mount_external, se_info, nice_name, instruction_set, app_data_dir);
|
|
args.is_child_zygote = &is_child_zygote;
|
|
args.is_top_app = &is_top_app;
|
|
HookContext ctx;
|
|
ctx.env = env;
|
|
ctx.clazz = clazz;
|
|
ctx.raw_args = &args;
|
|
ctx.nativeForkAndSpecialize_pre();
|
|
reinterpret_cast<decltype(&nativeForkAndSpecialize_q_alt)>(HookContext::nativeForkAndSpecialize_orig)(
|
|
env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, nice_name, fds_to_close, fds_to_ignore, is_child_zygote, instruction_set, app_data_dir, is_top_app
|
|
);
|
|
ctx.nativeForkAndSpecialize_post();
|
|
return ctx.pid;
|
|
}
|
|
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 nice_name, jintArray fds_to_close, jintArray fds_to_ignore, jboolean is_child_zygote, jstring instruction_set, jstring app_data_dir, jboolean is_top_app, jobjectArray pkg_data_info_list, jobjectArray whitelisted_data_info_list, jboolean mount_data_dirs, jboolean mount_storage_dirs) {
|
|
SpecializeAppProcessArgs args(uid, gid, gids, runtime_flags, mount_external, se_info, nice_name, instruction_set, app_data_dir);
|
|
args.is_child_zygote = &is_child_zygote;
|
|
args.is_top_app = &is_top_app;
|
|
args.pkg_data_info_list = &pkg_data_info_list;
|
|
args.whitelisted_data_info_list = &whitelisted_data_info_list;
|
|
args.mount_data_dirs = &mount_data_dirs;
|
|
args.mount_storage_dirs = &mount_storage_dirs;
|
|
HookContext ctx;
|
|
ctx.env = env;
|
|
ctx.clazz = clazz;
|
|
ctx.raw_args = &args;
|
|
ctx.nativeForkAndSpecialize_pre();
|
|
reinterpret_cast<decltype(&nativeForkAndSpecialize_r)>(HookContext::nativeForkAndSpecialize_orig)(
|
|
env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, nice_name, fds_to_close, fds_to_ignore, 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
|
|
);
|
|
ctx.nativeForkAndSpecialize_post();
|
|
return ctx.pid;
|
|
}
|
|
jint nativeForkAndSpecialize_samsung_m(JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtime_flags, jobjectArray rlimits, jint mount_external, jstring se_info, jint i1, jint i2, jstring nice_name, jintArray fds_to_close, jstring instruction_set, jstring app_data_dir) {
|
|
SpecializeAppProcessArgs args(uid, gid, gids, runtime_flags, mount_external, se_info, nice_name, instruction_set, app_data_dir);
|
|
HookContext ctx;
|
|
ctx.env = env;
|
|
ctx.clazz = clazz;
|
|
ctx.raw_args = &args;
|
|
ctx.nativeForkAndSpecialize_pre();
|
|
reinterpret_cast<decltype(&nativeForkAndSpecialize_samsung_m)>(HookContext::nativeForkAndSpecialize_orig)(
|
|
env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, i1, i2, nice_name, fds_to_close, instruction_set, app_data_dir
|
|
);
|
|
ctx.nativeForkAndSpecialize_post();
|
|
return ctx.pid;
|
|
}
|
|
jint nativeForkAndSpecialize_samsung_n(JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtime_flags, jobjectArray rlimits, jint mount_external, jstring se_info, jint i1, jint i2, jstring nice_name, jintArray fds_to_close, jstring instruction_set, jstring app_data_dir, jint i3) {
|
|
SpecializeAppProcessArgs args(uid, gid, gids, runtime_flags, mount_external, se_info, nice_name, instruction_set, app_data_dir);
|
|
HookContext ctx;
|
|
ctx.env = env;
|
|
ctx.clazz = clazz;
|
|
ctx.raw_args = &args;
|
|
ctx.nativeForkAndSpecialize_pre();
|
|
reinterpret_cast<decltype(&nativeForkAndSpecialize_samsung_n)>(HookContext::nativeForkAndSpecialize_orig)(
|
|
env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, i1, i2, nice_name, fds_to_close, instruction_set, app_data_dir, i3
|
|
);
|
|
ctx.nativeForkAndSpecialize_post();
|
|
return ctx.pid;
|
|
}
|
|
jint nativeForkAndSpecialize_samsung_o(JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtime_flags, jobjectArray rlimits, jint mount_external, jstring se_info, jint i1, jint i2, jstring nice_name, jintArray fds_to_close, jintArray fds_to_ignore, jstring instruction_set, jstring app_data_dir) {
|
|
SpecializeAppProcessArgs args(uid, gid, gids, runtime_flags, mount_external, se_info, nice_name, instruction_set, app_data_dir);
|
|
HookContext ctx;
|
|
ctx.env = env;
|
|
ctx.clazz = clazz;
|
|
ctx.raw_args = &args;
|
|
ctx.nativeForkAndSpecialize_pre();
|
|
reinterpret_cast<decltype(&nativeForkAndSpecialize_samsung_o)>(HookContext::nativeForkAndSpecialize_orig)(
|
|
env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, i1, i2, nice_name, fds_to_close, fds_to_ignore, instruction_set, app_data_dir
|
|
);
|
|
ctx.nativeForkAndSpecialize_post();
|
|
return ctx.pid;
|
|
}
|
|
jint nativeForkAndSpecialize_samsung_p(JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtime_flags, jobjectArray rlimits, jint mount_external, jstring se_info, jint i1, jint i2, jstring nice_name, jintArray fds_to_close, jintArray fds_to_ignore, jboolean is_child_zygote, jstring instruction_set, jstring app_data_dir) {
|
|
SpecializeAppProcessArgs args(uid, gid, gids, runtime_flags, mount_external, se_info, nice_name, instruction_set, app_data_dir);
|
|
args.is_child_zygote = &is_child_zygote;
|
|
HookContext ctx;
|
|
ctx.env = env;
|
|
ctx.clazz = clazz;
|
|
ctx.raw_args = &args;
|
|
ctx.nativeForkAndSpecialize_pre();
|
|
reinterpret_cast<decltype(&nativeForkAndSpecialize_samsung_p)>(HookContext::nativeForkAndSpecialize_orig)(
|
|
env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, i1, i2, nice_name, fds_to_close, fds_to_ignore, is_child_zygote, instruction_set, app_data_dir
|
|
);
|
|
ctx.nativeForkAndSpecialize_post();
|
|
return ctx.pid;
|
|
}
|
|
const JNINativeMethod nativeForkAndSpecialize_methods[] = {
|
|
{
|
|
"nativeForkAndSpecialize",
|
|
"(II[II[[IILjava/lang/String;Ljava/lang/String;[ILjava/lang/String;Ljava/lang/String;)I",
|
|
(void *) &nativeForkAndSpecialize_l
|
|
},
|
|
{
|
|
"nativeForkAndSpecialize",
|
|
"(II[II[[IILjava/lang/String;Ljava/lang/String;[I[ILjava/lang/String;Ljava/lang/String;)I",
|
|
(void *) &nativeForkAndSpecialize_o
|
|
},
|
|
{
|
|
"nativeForkAndSpecialize",
|
|
"(II[II[[IILjava/lang/String;Ljava/lang/String;[I[IZLjava/lang/String;Ljava/lang/String;)I",
|
|
(void *) &nativeForkAndSpecialize_p
|
|
},
|
|
{
|
|
"nativeForkAndSpecialize",
|
|
"(II[II[[IILjava/lang/String;Ljava/lang/String;[I[IZLjava/lang/String;Ljava/lang/String;Z)I",
|
|
(void *) &nativeForkAndSpecialize_q_alt
|
|
},
|
|
{
|
|
"nativeForkAndSpecialize",
|
|
"(II[II[[IILjava/lang/String;Ljava/lang/String;[I[IZLjava/lang/String;Ljava/lang/String;Z[Ljava/lang/String;[Ljava/lang/String;ZZ)I",
|
|
(void *) &nativeForkAndSpecialize_r
|
|
},
|
|
{
|
|
"nativeForkAndSpecialize",
|
|
"(II[II[[IILjava/lang/String;IILjava/lang/String;[ILjava/lang/String;Ljava/lang/String;)I",
|
|
(void *) &nativeForkAndSpecialize_samsung_m
|
|
},
|
|
{
|
|
"nativeForkAndSpecialize",
|
|
"(II[II[[IILjava/lang/String;IILjava/lang/String;[ILjava/lang/String;Ljava/lang/String;I)I",
|
|
(void *) &nativeForkAndSpecialize_samsung_n
|
|
},
|
|
{
|
|
"nativeForkAndSpecialize",
|
|
"(II[II[[IILjava/lang/String;IILjava/lang/String;[I[ILjava/lang/String;Ljava/lang/String;)I",
|
|
(void *) &nativeForkAndSpecialize_samsung_o
|
|
},
|
|
{
|
|
"nativeForkAndSpecialize",
|
|
"(II[II[[IILjava/lang/String;IILjava/lang/String;[I[IZLjava/lang/String;Ljava/lang/String;)I",
|
|
(void *) &nativeForkAndSpecialize_samsung_p
|
|
},
|
|
};
|
|
constexpr int nativeForkAndSpecialize_methods_num = std::size(nativeForkAndSpecialize_methods);
|
|
|
|
void nativeSpecializeAppProcess_q(JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtime_flags, jobjectArray rlimits, jint mount_external, jstring se_info, jstring nice_name, jboolean is_child_zygote, jstring instruction_set, jstring app_data_dir) {
|
|
SpecializeAppProcessArgs args(uid, gid, gids, runtime_flags, mount_external, se_info, nice_name, instruction_set, app_data_dir);
|
|
args.is_child_zygote = &is_child_zygote;
|
|
HookContext ctx;
|
|
ctx.env = env;
|
|
ctx.clazz = clazz;
|
|
ctx.raw_args = &args;
|
|
ctx.nativeSpecializeAppProcess_pre();
|
|
reinterpret_cast<decltype(&nativeSpecializeAppProcess_q)>(HookContext::nativeSpecializeAppProcess_orig)(
|
|
env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, nice_name, is_child_zygote, instruction_set, app_data_dir
|
|
);
|
|
ctx.nativeSpecializeAppProcess_post();
|
|
}
|
|
void nativeSpecializeAppProcess_q_alt(JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtime_flags, jobjectArray rlimits, jint mount_external, jstring se_info, jstring nice_name, jboolean is_child_zygote, jstring instruction_set, jstring app_data_dir, jboolean is_top_app) {
|
|
SpecializeAppProcessArgs args(uid, gid, gids, runtime_flags, mount_external, se_info, nice_name, instruction_set, app_data_dir);
|
|
args.is_child_zygote = &is_child_zygote;
|
|
args.is_top_app = &is_top_app;
|
|
HookContext ctx;
|
|
ctx.env = env;
|
|
ctx.clazz = clazz;
|
|
ctx.raw_args = &args;
|
|
ctx.nativeSpecializeAppProcess_pre();
|
|
reinterpret_cast<decltype(&nativeSpecializeAppProcess_q_alt)>(HookContext::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
|
|
);
|
|
ctx.nativeSpecializeAppProcess_post();
|
|
}
|
|
void nativeSpecializeAppProcess_r(JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtime_flags, jobjectArray rlimits, jint mount_external, jstring se_info, jstring nice_name, jboolean is_child_zygote, jstring instruction_set, jstring app_data_dir, jboolean is_top_app, jobjectArray pkg_data_info_list, jobjectArray whitelisted_data_info_list, jboolean mount_data_dirs, jboolean mount_storage_dirs) {
|
|
SpecializeAppProcessArgs args(uid, gid, gids, runtime_flags, mount_external, se_info, nice_name, instruction_set, app_data_dir);
|
|
args.is_child_zygote = &is_child_zygote;
|
|
args.is_top_app = &is_top_app;
|
|
args.pkg_data_info_list = &pkg_data_info_list;
|
|
args.whitelisted_data_info_list = &whitelisted_data_info_list;
|
|
args.mount_data_dirs = &mount_data_dirs;
|
|
args.mount_storage_dirs = &mount_storage_dirs;
|
|
HookContext ctx;
|
|
ctx.env = env;
|
|
ctx.clazz = clazz;
|
|
ctx.raw_args = &args;
|
|
ctx.nativeSpecializeAppProcess_pre();
|
|
reinterpret_cast<decltype(&nativeSpecializeAppProcess_r)>(HookContext::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
|
|
);
|
|
ctx.nativeSpecializeAppProcess_post();
|
|
}
|
|
void nativeSpecializeAppProcess_samsung_q(JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtime_flags, jobjectArray rlimits, jint mount_external, jstring se_info, jint i1, jint i2, jstring nice_name, jboolean is_child_zygote, jstring instruction_set, jstring app_data_dir) {
|
|
SpecializeAppProcessArgs args(uid, gid, gids, runtime_flags, mount_external, se_info, nice_name, instruction_set, app_data_dir);
|
|
args.is_child_zygote = &is_child_zygote;
|
|
HookContext ctx;
|
|
ctx.env = env;
|
|
ctx.clazz = clazz;
|
|
ctx.raw_args = &args;
|
|
ctx.nativeSpecializeAppProcess_pre();
|
|
reinterpret_cast<decltype(&nativeSpecializeAppProcess_samsung_q)>(HookContext::nativeSpecializeAppProcess_orig)(
|
|
env, clazz, uid, gid, gids, runtime_flags, rlimits, mount_external, se_info, i1, i2, nice_name, is_child_zygote, instruction_set, app_data_dir
|
|
);
|
|
ctx.nativeSpecializeAppProcess_post();
|
|
}
|
|
const JNINativeMethod nativeSpecializeAppProcess_methods[] = {
|
|
{
|
|
"nativeSpecializeAppProcess",
|
|
"(II[II[[IILjava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;)V",
|
|
(void *) &nativeSpecializeAppProcess_q
|
|
},
|
|
{
|
|
"nativeSpecializeAppProcess",
|
|
"(II[II[[IILjava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Z)V",
|
|
(void *) &nativeSpecializeAppProcess_q_alt
|
|
},
|
|
{
|
|
"nativeSpecializeAppProcess",
|
|
"(II[II[[IILjava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Z[Ljava/lang/String;[Ljava/lang/String;ZZ)V",
|
|
(void *) &nativeSpecializeAppProcess_r
|
|
},
|
|
{
|
|
"nativeSpecializeAppProcess",
|
|
"(II[II[[IILjava/lang/String;IILjava/lang/String;ZLjava/lang/String;Ljava/lang/String;)V",
|
|
(void *) &nativeSpecializeAppProcess_samsung_q
|
|
},
|
|
};
|
|
constexpr int nativeSpecializeAppProcess_methods_num = std::size(nativeSpecializeAppProcess_methods);
|
|
|
|
jint nativeForkSystemServer_l(JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtime_flags, jobjectArray rlimits, jlong permitted_capabilities, jlong effective_capabilities) {
|
|
ForkSystemServerArgs args(uid, gid, gids, runtime_flags, permitted_capabilities, effective_capabilities);
|
|
HookContext ctx;
|
|
ctx.env = env;
|
|
ctx.clazz = clazz;
|
|
ctx.raw_args = &args;
|
|
ctx.nativeForkSystemServer_pre();
|
|
reinterpret_cast<decltype(&nativeForkSystemServer_l)>(HookContext::nativeForkSystemServer_orig)(
|
|
env, clazz, uid, gid, gids, runtime_flags, rlimits, permitted_capabilities, effective_capabilities
|
|
);
|
|
ctx.nativeForkSystemServer_post();
|
|
return ctx.pid;
|
|
}
|
|
jint nativeForkSystemServer_samsung_q(JNIEnv *env, jclass clazz, jint uid, jint gid, jintArray gids, jint runtime_flags, jint i1, jint i2, jobjectArray rlimits, jlong permitted_capabilities, jlong effective_capabilities) {
|
|
ForkSystemServerArgs args(uid, gid, gids, runtime_flags, permitted_capabilities, effective_capabilities);
|
|
HookContext ctx;
|
|
ctx.env = env;
|
|
ctx.clazz = clazz;
|
|
ctx.raw_args = &args;
|
|
ctx.nativeForkSystemServer_pre();
|
|
reinterpret_cast<decltype(&nativeForkSystemServer_samsung_q)>(HookContext::nativeForkSystemServer_orig)(
|
|
env, clazz, uid, gid, gids, runtime_flags, i1, i2, rlimits, permitted_capabilities, effective_capabilities
|
|
);
|
|
ctx.nativeForkSystemServer_post();
|
|
return ctx.pid;
|
|
}
|
|
const JNINativeMethod nativeForkSystemServer_methods[] = {
|
|
{
|
|
"nativeForkSystemServer",
|
|
"(II[II[[IJJ)I",
|
|
(void *) &nativeForkSystemServer_l
|
|
},
|
|
{
|
|
"nativeForkSystemServer",
|
|
"(II[IIII[[IJJ)I",
|
|
(void *) &nativeForkSystemServer_samsung_q
|
|
},
|
|
};
|
|
constexpr int nativeForkSystemServer_methods_num = std::size(nativeForkSystemServer_methods);
|