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
d9564bd0
Commit
d9564bd0
authored
Aug 01, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delay full sepolicy patch loading time
parent
35f1c396
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
bootstages.c
native/jni/core/bootstages.c
+8
-3
magisk.h
native/jni/include/magisk.h
+1
-0
No files found.
native/jni/core/bootstages.c
View file @
d9564bd0
...
...
@@ -678,7 +678,8 @@ void post_fs_data(int client) {
LOGI
(
"** post-fs-data mode running
\n
"
);
xmount
(
NULL
,
"/"
,
NULL
,
MS_REMOUNT
|
MS_RDONLY
,
NULL
);
full_patch_pid
=
exec_command
(
0
,
NULL
,
NULL
,
"/sbin/magiskpolicy"
,
"--live"
,
"allow "
SEPOL_PROC_DOMAIN
" * * *"
,
NULL
);
full_patch_pid
=
exec_command
(
0
,
NULL
,
NULL
,
"/sbin/magiskpolicy"
,
"--save"
,
TMPSEPOLICY
,
"allow "
SEPOL_PROC_DOMAIN
" * * *"
,
NULL
);
// Allocate buffer
buf
=
xmalloc
(
PATH_MAX
);
...
...
@@ -803,9 +804,13 @@ void late_start(int client) {
if
(
buf
==
NULL
)
buf
=
xmalloc
(
PATH_MAX
);
if
(
buf2
==
NULL
)
buf2
=
xmalloc
(
PATH_MAX
);
// Wait till the full patch is done
if
(
full_patch_pid
>
0
)
if
(
full_patch_pid
>
0
)
{
// Wait till the full patch is done
waitpid
(
full_patch_pid
,
NULL
,
0
);
// Load the policy
exec_command_sync
(
"/sbin/magiskpolicy"
,
"--live"
,
"--load"
,
TMPSEPOLICY
,
NULL
);
unlink
(
TMPSEPOLICY
);
}
// Run scripts after full patch, most reliable way to run scripts
LOGI
(
"* Running service.d scripts
\n
"
);
...
...
native/jni/include/magisk.h
View file @
d9564bd0
...
...
@@ -17,6 +17,7 @@
#define LOGFILE "/cache/magisk.log"
#define UNBLOCKFILE "/dev/.magisk.unblock"
#define TMPSEPOLICY "/dev/.tmp_sepolicy"
#define DISABLEFILE "/cache/.disable_magisk"
#define MAGISKTMP "/sbin/.core"
#define BLOCKDIR MAGISKTMP "/block"
...
...
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