Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
e86db0bd
Commit
e86db0bd
authored
Sep 10, 2022
by
LoveSy
Committed by
John Wu
Sep 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reset stack guard after fork from Zygote
parent
a29fc117
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
gen_jni_hooks.py
native/src/zygisk/gen_jni_hooks.py
+1
-1
jni_hooks.hpp
native/src/zygisk/jni_hooks.hpp
+15
-15
No files found.
native/src/zygisk/gen_jni_hooks.py
View file @
e86db0bd
...
@@ -209,7 +209,7 @@ def gen_jni_def(clz, methods):
...
@@ -209,7 +209,7 @@ def gen_jni_def(clz, methods):
decl
=
''
decl
=
''
for
m
in
methods
:
for
m
in
methods
:
decl
+=
ind
(
0
)
+
f
'{m.ret.type.cpp} {m.name}(JNIEnv *env, jclass clazz, {m.cpp()}) {{'
decl
+=
ind
(
0
)
+
f
'
[[clang::no_stack_protector]]
{m.ret.type.cpp} {m.name}(JNIEnv *env, jclass clazz, {m.cpp()}) {{'
decl
+=
m
.
body
()
decl
+=
m
.
body
()
if
m
.
ret
.
value
:
if
m
.
ret
.
value
:
decl
+=
ind
(
1
)
+
f
'return {m.ret.value};'
decl
+=
ind
(
1
)
+
f
'return {m.ret.value};'
...
...
native/src/zygisk/jni_hooks.hpp
View file @
e86db0bd
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
namespace
{
namespace
{
void
*
nativeForkAndSpecialize_orig
=
nullptr
;
void
*
nativeForkAndSpecialize_orig
=
nullptr
;
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
)
{
[[
clang
::
no_stack_protector
]]
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
)
{
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
HookContext
ctx
;
HookContext
ctx
;
ctx
.
env
=
env
;
ctx
.
env
=
env
;
...
@@ -15,7 +15,7 @@ jint nativeForkAndSpecialize_l(JNIEnv *env, jclass clazz, jint uid, jint gid, ji
...
@@ -15,7 +15,7 @@ jint nativeForkAndSpecialize_l(JNIEnv *env, jclass clazz, jint uid, jint gid, ji
ctx
.
nativeForkAndSpecialize_post
();
ctx
.
nativeForkAndSpecialize_post
();
return
ctx
.
pid
;
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
)
{
[[
clang
::
no_stack_protector
]]
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
)
{
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
args
.
fds_to_ignore
=
&
fds_to_ignore
;
args
.
fds_to_ignore
=
&
fds_to_ignore
;
HookContext
ctx
;
HookContext
ctx
;
...
@@ -28,7 +28,7 @@ jint nativeForkAndSpecialize_o(JNIEnv *env, jclass clazz, jint uid, jint gid, ji
...
@@ -28,7 +28,7 @@ jint nativeForkAndSpecialize_o(JNIEnv *env, jclass clazz, jint uid, jint gid, ji
ctx
.
nativeForkAndSpecialize_post
();
ctx
.
nativeForkAndSpecialize_post
();
return
ctx
.
pid
;
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
)
{
[[
clang
::
no_stack_protector
]]
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
)
{
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
args
.
fds_to_ignore
=
&
fds_to_ignore
;
args
.
fds_to_ignore
=
&
fds_to_ignore
;
args
.
is_child_zygote
=
&
is_child_zygote
;
args
.
is_child_zygote
=
&
is_child_zygote
;
...
@@ -42,7 +42,7 @@ jint nativeForkAndSpecialize_p(JNIEnv *env, jclass clazz, jint uid, jint gid, ji
...
@@ -42,7 +42,7 @@ jint nativeForkAndSpecialize_p(JNIEnv *env, jclass clazz, jint uid, jint gid, ji
ctx
.
nativeForkAndSpecialize_post
();
ctx
.
nativeForkAndSpecialize_post
();
return
ctx
.
pid
;
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
)
{
[[
clang
::
no_stack_protector
]]
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
)
{
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
args
.
fds_to_ignore
=
&
fds_to_ignore
;
args
.
fds_to_ignore
=
&
fds_to_ignore
;
args
.
is_child_zygote
=
&
is_child_zygote
;
args
.
is_child_zygote
=
&
is_child_zygote
;
...
@@ -57,7 +57,7 @@ jint nativeForkAndSpecialize_q_alt(JNIEnv *env, jclass clazz, jint uid, jint gid
...
@@ -57,7 +57,7 @@ jint nativeForkAndSpecialize_q_alt(JNIEnv *env, jclass clazz, jint uid, jint gid
ctx
.
nativeForkAndSpecialize_post
();
ctx
.
nativeForkAndSpecialize_post
();
return
ctx
.
pid
;
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
)
{
[[
clang
::
no_stack_protector
]]
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
)
{
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
args
.
fds_to_ignore
=
&
fds_to_ignore
;
args
.
fds_to_ignore
=
&
fds_to_ignore
;
args
.
is_child_zygote
=
&
is_child_zygote
;
args
.
is_child_zygote
=
&
is_child_zygote
;
...
@@ -76,7 +76,7 @@ jint nativeForkAndSpecialize_r(JNIEnv *env, jclass clazz, jint uid, jint gid, ji
...
@@ -76,7 +76,7 @@ jint nativeForkAndSpecialize_r(JNIEnv *env, jclass clazz, jint uid, jint gid, ji
ctx
.
nativeForkAndSpecialize_post
();
ctx
.
nativeForkAndSpecialize_post
();
return
ctx
.
pid
;
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
_0
,
jint
_1
,
jstring
nice_name
,
jintArray
fds_to_close
,
jstring
instruction_set
,
jstring
app_data_dir
)
{
[[
clang
::
no_stack_protector
]]
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
_0
,
jint
_1
,
jstring
nice_name
,
jintArray
fds_to_close
,
jstring
instruction_set
,
jstring
app_data_dir
)
{
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
HookContext
ctx
;
HookContext
ctx
;
ctx
.
env
=
env
;
ctx
.
env
=
env
;
...
@@ -88,7 +88,7 @@ jint nativeForkAndSpecialize_samsung_m(JNIEnv *env, jclass clazz, jint uid, jint
...
@@ -88,7 +88,7 @@ jint nativeForkAndSpecialize_samsung_m(JNIEnv *env, jclass clazz, jint uid, jint
ctx
.
nativeForkAndSpecialize_post
();
ctx
.
nativeForkAndSpecialize_post
();
return
ctx
.
pid
;
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
_2
,
jint
_3
,
jstring
nice_name
,
jintArray
fds_to_close
,
jstring
instruction_set
,
jstring
app_data_dir
,
jint
_4
)
{
[[
clang
::
no_stack_protector
]]
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
_2
,
jint
_3
,
jstring
nice_name
,
jintArray
fds_to_close
,
jstring
instruction_set
,
jstring
app_data_dir
,
jint
_4
)
{
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
HookContext
ctx
;
HookContext
ctx
;
ctx
.
env
=
env
;
ctx
.
env
=
env
;
...
@@ -100,7 +100,7 @@ jint nativeForkAndSpecialize_samsung_n(JNIEnv *env, jclass clazz, jint uid, jint
...
@@ -100,7 +100,7 @@ jint nativeForkAndSpecialize_samsung_n(JNIEnv *env, jclass clazz, jint uid, jint
ctx
.
nativeForkAndSpecialize_post
();
ctx
.
nativeForkAndSpecialize_post
();
return
ctx
.
pid
;
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
_5
,
jint
_6
,
jstring
nice_name
,
jintArray
fds_to_close
,
jintArray
fds_to_ignore
,
jstring
instruction_set
,
jstring
app_data_dir
)
{
[[
clang
::
no_stack_protector
]]
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
_5
,
jint
_6
,
jstring
nice_name
,
jintArray
fds_to_close
,
jintArray
fds_to_ignore
,
jstring
instruction_set
,
jstring
app_data_dir
)
{
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
args
.
fds_to_ignore
=
&
fds_to_ignore
;
args
.
fds_to_ignore
=
&
fds_to_ignore
;
HookContext
ctx
;
HookContext
ctx
;
...
@@ -113,7 +113,7 @@ jint nativeForkAndSpecialize_samsung_o(JNIEnv *env, jclass clazz, jint uid, jint
...
@@ -113,7 +113,7 @@ jint nativeForkAndSpecialize_samsung_o(JNIEnv *env, jclass clazz, jint uid, jint
ctx
.
nativeForkAndSpecialize_post
();
ctx
.
nativeForkAndSpecialize_post
();
return
ctx
.
pid
;
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
_7
,
jint
_8
,
jstring
nice_name
,
jintArray
fds_to_close
,
jintArray
fds_to_ignore
,
jboolean
is_child_zygote
,
jstring
instruction_set
,
jstring
app_data_dir
)
{
[[
clang
::
no_stack_protector
]]
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
_7
,
jint
_8
,
jstring
nice_name
,
jintArray
fds_to_close
,
jintArray
fds_to_ignore
,
jboolean
is_child_zygote
,
jstring
instruction_set
,
jstring
app_data_dir
)
{
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
args
.
fds_to_ignore
=
&
fds_to_ignore
;
args
.
fds_to_ignore
=
&
fds_to_ignore
;
args
.
is_child_zygote
=
&
is_child_zygote
;
args
.
is_child_zygote
=
&
is_child_zygote
;
...
@@ -177,7 +177,7 @@ const JNINativeMethod nativeForkAndSpecialize_methods[] = {
...
@@ -177,7 +177,7 @@ const JNINativeMethod nativeForkAndSpecialize_methods[] = {
constexpr
int
nativeForkAndSpecialize_methods_num
=
std
::
size
(
nativeForkAndSpecialize_methods
);
constexpr
int
nativeForkAndSpecialize_methods_num
=
std
::
size
(
nativeForkAndSpecialize_methods
);
void
*
nativeSpecializeAppProcess_orig
=
nullptr
;
void
*
nativeSpecializeAppProcess_orig
=
nullptr
;
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
)
{
[[
clang
::
no_stack_protector
]]
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
)
{
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
args
.
is_child_zygote
=
&
is_child_zygote
;
args
.
is_child_zygote
=
&
is_child_zygote
;
HookContext
ctx
;
HookContext
ctx
;
...
@@ -189,7 +189,7 @@ void nativeSpecializeAppProcess_q(JNIEnv *env, jclass clazz, jint uid, jint gid,
...
@@ -189,7 +189,7 @@ void nativeSpecializeAppProcess_q(JNIEnv *env, jclass clazz, jint uid, jint gid,
);
);
ctx
.
nativeSpecializeAppProcess_post
();
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
)
{
[[
clang
::
no_stack_protector
]]
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
)
{
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
args
.
is_child_zygote
=
&
is_child_zygote
;
args
.
is_child_zygote
=
&
is_child_zygote
;
args
.
is_top_app
=
&
is_top_app
;
args
.
is_top_app
=
&
is_top_app
;
...
@@ -202,7 +202,7 @@ void nativeSpecializeAppProcess_q_alt(JNIEnv *env, jclass clazz, jint uid, jint
...
@@ -202,7 +202,7 @@ void nativeSpecializeAppProcess_q_alt(JNIEnv *env, jclass clazz, jint uid, jint
);
);
ctx
.
nativeSpecializeAppProcess_post
();
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
)
{
[[
clang
::
no_stack_protector
]]
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
)
{
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
args
.
is_child_zygote
=
&
is_child_zygote
;
args
.
is_child_zygote
=
&
is_child_zygote
;
args
.
is_top_app
=
&
is_top_app
;
args
.
is_top_app
=
&
is_top_app
;
...
@@ -219,7 +219,7 @@ void nativeSpecializeAppProcess_r(JNIEnv *env, jclass clazz, jint uid, jint gid,
...
@@ -219,7 +219,7 @@ void nativeSpecializeAppProcess_r(JNIEnv *env, jclass clazz, jint uid, jint gid,
);
);
ctx
.
nativeSpecializeAppProcess_post
();
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
_9
,
jint
_10
,
jstring
nice_name
,
jboolean
is_child_zygote
,
jstring
instruction_set
,
jstring
app_data_dir
)
{
[[
clang
::
no_stack_protector
]]
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
_9
,
jint
_10
,
jstring
nice_name
,
jboolean
is_child_zygote
,
jstring
instruction_set
,
jstring
app_data_dir
)
{
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
AppSpecializeArgs_v3
args
(
uid
,
gid
,
gids
,
runtime_flags
,
rlimits
,
mount_external
,
se_info
,
nice_name
,
instruction_set
,
app_data_dir
);
args
.
is_child_zygote
=
&
is_child_zygote
;
args
.
is_child_zygote
=
&
is_child_zygote
;
HookContext
ctx
;
HookContext
ctx
;
...
@@ -256,7 +256,7 @@ const JNINativeMethod nativeSpecializeAppProcess_methods[] = {
...
@@ -256,7 +256,7 @@ const JNINativeMethod nativeSpecializeAppProcess_methods[] = {
constexpr
int
nativeSpecializeAppProcess_methods_num
=
std
::
size
(
nativeSpecializeAppProcess_methods
);
constexpr
int
nativeSpecializeAppProcess_methods_num
=
std
::
size
(
nativeSpecializeAppProcess_methods
);
void
*
nativeForkSystemServer_orig
=
nullptr
;
void
*
nativeForkSystemServer_orig
=
nullptr
;
jint
nativeForkSystemServer_l
(
JNIEnv
*
env
,
jclass
clazz
,
jint
uid
,
jint
gid
,
jintArray
gids
,
jint
runtime_flags
,
jobjectArray
rlimits
,
jlong
permitted_capabilities
,
jlong
effective_capabilities
)
{
[[
clang
::
no_stack_protector
]]
jint
nativeForkSystemServer_l
(
JNIEnv
*
env
,
jclass
clazz
,
jint
uid
,
jint
gid
,
jintArray
gids
,
jint
runtime_flags
,
jobjectArray
rlimits
,
jlong
permitted_capabilities
,
jlong
effective_capabilities
)
{
ServerSpecializeArgs_v1
args
(
uid
,
gid
,
gids
,
runtime_flags
,
permitted_capabilities
,
effective_capabilities
);
ServerSpecializeArgs_v1
args
(
uid
,
gid
,
gids
,
runtime_flags
,
permitted_capabilities
,
effective_capabilities
);
HookContext
ctx
;
HookContext
ctx
;
ctx
.
env
=
env
;
ctx
.
env
=
env
;
...
@@ -268,7 +268,7 @@ jint nativeForkSystemServer_l(JNIEnv *env, jclass clazz, jint uid, jint gid, jin
...
@@ -268,7 +268,7 @@ jint nativeForkSystemServer_l(JNIEnv *env, jclass clazz, jint uid, jint gid, jin
ctx
.
nativeForkSystemServer_post
();
ctx
.
nativeForkSystemServer_post
();
return
ctx
.
pid
;
return
ctx
.
pid
;
}
}
jint
nativeForkSystemServer_samsung_q
(
JNIEnv
*
env
,
jclass
clazz
,
jint
uid
,
jint
gid
,
jintArray
gids
,
jint
runtime_flags
,
jint
_11
,
jint
_12
,
jobjectArray
rlimits
,
jlong
permitted_capabilities
,
jlong
effective_capabilities
)
{
[[
clang
::
no_stack_protector
]]
jint
nativeForkSystemServer_samsung_q
(
JNIEnv
*
env
,
jclass
clazz
,
jint
uid
,
jint
gid
,
jintArray
gids
,
jint
runtime_flags
,
jint
_11
,
jint
_12
,
jobjectArray
rlimits
,
jlong
permitted_capabilities
,
jlong
effective_capabilities
)
{
ServerSpecializeArgs_v1
args
(
uid
,
gid
,
gids
,
runtime_flags
,
permitted_capabilities
,
effective_capabilities
);
ServerSpecializeArgs_v1
args
(
uid
,
gid
,
gids
,
runtime_flags
,
permitted_capabilities
,
effective_capabilities
);
HookContext
ctx
;
HookContext
ctx
;
ctx
.
env
=
env
;
ctx
.
env
=
env
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment