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
493068c0
Commit
493068c0
authored
Nov 01, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attempt to rescan zygote multiple times
Close #1654
parent
f4299fbe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
5 deletions
+18
-5
bootstages.cpp
native/jni/core/bootstages.cpp
+2
-0
hide_utils.cpp
native/jni/magiskhide/hide_utils.cpp
+9
-5
magiskhide.h
native/jni/magiskhide/magiskhide.h
+1
-0
proc_monitor.cpp
native/jni/magiskhide/proc_monitor.cpp
+6
-0
No files found.
native/jni/core/bootstages.cpp
View file @
493068c0
...
...
@@ -757,6 +757,8 @@ void boot_complete(int client) {
if
(
!
pfs_done
)
return
;
auto_start_magiskhide
();
if
(
access
(
MANAGERAPK
,
F_OK
)
==
0
)
{
// Install Magisk Manager if exists
rename
(
MANAGERAPK
,
"/data/magisk.apk"
);
...
...
native/jni/magiskhide/hide_utils.cpp
View file @
493068c0
...
...
@@ -217,7 +217,7 @@ static void set_hide_config() {
db_err
(
err
);
}
static
inline
void
launch_err
(
int
client
,
int
code
=
DAEMON_ERROR
)
{
[[
noreturn
]]
static
void
launch_err
(
int
client
,
int
code
=
DAEMON_ERROR
)
{
if
(
code
!=
HIDE_IS_ENABLED
)
hide_enabled
=
false
;
if
(
client
>=
0
)
{
...
...
@@ -280,10 +280,14 @@ int stop_magiskhide() {
}
void
auto_start_magiskhide
()
{
db_settings
dbs
;
get_db_settings
(
dbs
,
HIDE_CONFIG
);
if
(
dbs
[
HIDE_CONFIG
])
{
new_daemon_thread
([]{
launch_magiskhide
(
-
1
);
});
if
(
hide_enabled
)
{
pthread_kill
(
proc_monitor_thread
,
SIGZYGOTE
);
}
else
if
(
SDK_INT
>=
19
)
{
db_settings
dbs
;
get_db_settings
(
dbs
,
HIDE_CONFIG
);
if
(
dbs
[
HIDE_CONFIG
])
{
new_daemon_thread
([]{
launch_magiskhide
(
-
1
);
});
}
}
}
...
...
native/jni/magiskhide/magiskhide.h
View file @
493068c0
...
...
@@ -13,6 +13,7 @@
#include <daemon.h>
#define SIGTERMTHRD SIGUSR1
#define SIGZYGOTE SIGUSR2
#define SAFETYNET_COMPONENT "com.google.android.gms/.droidguard.DroidGuardService"
#define SAFETYNET_PROCESS "com.google.android.gms.unstable"
...
...
native/jni/magiskhide/proc_monitor.cpp
View file @
493068c0
...
...
@@ -155,6 +155,10 @@ static void inotify_event(int) {
check_zygote
();
}
static
void
check_zygote
(
int
)
{
check_zygote
();
}
// Workaround for the lack of pthread_cancel
static
void
term_thread
(
int
)
{
LOGD
(
"proc_monitor: cleaning up
\n
"
);
...
...
@@ -312,6 +316,8 @@ void proc_monitor() {
sigaction
(
SIGTERMTHRD
,
&
act
,
nullptr
);
act
.
sa_handler
=
inotify_event
;
sigaction
(
SIGIO
,
&
act
,
nullptr
);
act
.
sa_handler
=
check_zygote
;
sigaction
(
SIGZYGOTE
,
&
act
,
nullptr
);
setup_inotify
();
...
...
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