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
ef8d9be6
Commit
ef8d9be6
authored
Jun 02, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More improvements and fixes
parent
2cdbcc56
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
4 deletions
+28
-4
bootstages.c
jni/daemon/bootstages.c
+23
-3
magiskhide.c
jni/magiskhide/magiskhide.c
+3
-1
misc.c
jni/utils/misc.c
+2
-0
No files found.
jni/daemon/bootstages.c
View file @
ef8d9be6
...
...
@@ -505,17 +505,30 @@ void post_fs_data(int client) {
if
(
access
(
"/cache/data_bin"
,
F_OK
)
==
0
)
{
rm_rf
(
DATABIN
);
rename
(
"/cache/data_bin"
,
DATABIN
);
system
(
"mv /cache/stock_boot* /data"
);
// Lazy.... use bash glob....
}
// Magisk Manual Injector support
if
(
access
(
"/data/local/tmp/magisk"
,
F_OK
)
==
0
)
{
rm_rf
(
DATABIN
);
rename
(
"/data/local/tmp/magisk"
,
DATABIN
);
}
// Lazy.... use shell blob
system
(
"mv /data/magisk/stock_boot* /data;"
);
// Merge images
if
(
merge_img
(
"/cache/magisk.img"
,
MAINIMG
))
goto
unblock
;
if
(
merge_img
(
"/data/magisk_merge.img"
,
MAINIMG
))
goto
unblock
;
if
(
access
(
MAINIMG
,
F_OK
)
==
-
1
&&
create_img
(
MAINIMG
,
64
))
goto
unblock
;
int
new_img
=
0
;
if
(
access
(
MAINIMG
,
F_OK
)
==
-
1
)
{
if
(
create_img
(
MAINIMG
,
64
))
goto
unblock
;
new_img
=
1
;
}
LOGI
(
"* Mounting "
MAINIMG
"
\n
"
);
// Mounting magisk image
...
...
@@ -523,6 +536,13 @@ void post_fs_data(int client) {
if
(
magiskloop
==
NULL
)
goto
unblock
;
if
(
new_img
)
{
mkdir
(
COREDIR
,
0755
);
mkdir
(
COREDIR
"/post-fs-data.d"
,
0755
);
mkdir
(
COREDIR
"/service.d"
,
0755
);
mkdir
(
COREDIR
"/props"
,
0755
);
}
// Run common scripts
LOGI
(
"* Running post-fs-data.d scripts
\n
"
);
exec_common_script
(
"post-fs-data"
);
...
...
jni/magiskhide/magiskhide.c
View file @
ef8d9be6
...
...
@@ -141,7 +141,9 @@ int magiskhide_main(int argc, char *argv[]) {
}
else
if
(
strcmp
(
argv
[
1
],
"--rm"
)
==
0
&&
argc
>
2
)
{
req
=
RM_HIDELIST
;
}
else
if
(
strcmp
(
argv
[
1
],
"--ls"
)
==
0
)
{
FILE
*
fp
=
xfopen
(
HIDELIST
,
"r"
);
FILE
*
fp
=
fopen
(
HIDELIST
,
"r"
);
if
(
fp
==
NULL
)
return
1
;
char
buffer
[
512
];
while
(
fgets
(
buffer
,
sizeof
(
buffer
),
fp
))
{
printf
(
"%s"
,
buffer
);
...
...
jni/utils/misc.c
View file @
ef8d9be6
...
...
@@ -347,6 +347,8 @@ int clone_dir(const char *source, const char *target) {
}
int
rm_rf
(
const
char
*
target
)
{
if
(
access
(
target
,
F_OK
)
==
-
1
)
return
0
;
struct
stat
buf
;
xlstat
(
target
,
&
buf
);
char
*
next
;
...
...
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