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
9ad03994
Commit
9ad03994
authored
Feb 05, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle disabling
parent
35228f80
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
custom_ramdisk_patch.sh
scripts/custom_ramdisk_patch.sh
+1
-1
magic_mask.sh
scripts/magic_mask.sh
+10
-3
No files found.
scripts/custom_ramdisk_patch.sh
View file @
9ad03994
...
@@ -51,7 +51,7 @@ for RC in init*.rc; do
...
@@ -51,7 +51,7 @@ for RC in init*.rc; do
sed
-i
"/import
\/
init
\.
environ
\.
rc/iimport /init.magisk.rc"
$RC
sed
-i
"/import
\/
init
\.
environ
\.
rc/iimport /init.magisk.rc"
$RC
cpio_add
$RC
750
cpio_add
$RC
750
fi
fi
if
file_contain
"selinux.reload_policy"
;
then
if
file_contain
"selinux.reload_policy"
$RC
;
then
sed
-i
"/selinux.reload_policy/d"
$RC
sed
-i
"/selinux.reload_policy/d"
$RC
cpio_add
$RC
750
cpio_add
$RC
750
fi
fi
...
...
scripts/magic_mask.sh
View file @
9ad03994
#!/system/bin/sh
#!/system/bin/sh
LOGFILE
=
/cache/magisk.log
LOGFILE
=
/cache/magisk.log
DISABLEFILE
=
/cache/.disable_magisk
IMG
=
/data/magisk.img
IMG
=
/data/magisk.img
WHITELIST
=
"/system/bin"
WHITELIST
=
"/system/bin"
...
@@ -253,6 +254,8 @@ case $1 in
...
@@ -253,6 +254,8 @@ case $1 in
# Cleanup legacy stuffs...
# Cleanup legacy stuffs...
rm
-rf
/cache/magisk /cache/magisk_merge /cache/magiskhide.log
rm
-rf
/cache/magisk /cache/magisk_merge /cache/magiskhide.log
[
-f
$DISABLEFILE
]
&&
unblock
if
[
-d
/cache/magisk_mount
]
;
then
if
[
-d
/cache/magisk_mount
]
;
then
log_print
"* Mounting cache files"
log_print
"* Mounting cache files"
find /cache/magisk_mount
-type
f 2>/dev/null |
while
read
ITEM
;
do
find /cache/magisk_mount
-type
f 2>/dev/null |
while
read
ITEM
;
do
...
@@ -323,7 +326,8 @@ case $1 in
...
@@ -323,7 +326,8 @@ case $1 in
# Remove empty directories, legacy paths, symlinks, old temporary images
# Remove empty directories, legacy paths, symlinks, old temporary images
find
$MOUNTPOINT
-type
d
-depth
!
-path
"*core*"
-exec
rmdir
{}
\;
2>/dev/null
find
$MOUNTPOINT
-type
d
-depth
!
-path
"*core*"
-exec
rmdir
{}
\;
2>/dev/null
rm
-rf
$MOUNTPOINT
/zzsupersu
$MOUNTPOINT
/phh
$COREDIR
/bin
$COREDIR
/dummy
$COREDIR
/mirror /data/magisk/
*
.img /data/busybox 2>/dev/null
rm
-rf
$MOUNTPOINT
/zzsupersu
$MOUNTPOINT
/phh
$COREDIR
/bin
$COREDIR
/dummy
$COREDIR
/mirror
\
$COREDIR
/busybox /data/magisk/
*
.img /data/busybox 2>/dev/null
# Remove modules that are labeled to be removed
# Remove modules that are labeled to be removed
for
MOD
in
$MOUNTPOINT
/
*
;
do
for
MOD
in
$MOUNTPOINT
/
*
;
do
...
@@ -356,8 +360,7 @@ case $1 in
...
@@ -356,8 +360,7 @@ case $1 in
[
!
-f
/sbin/launch_daemonsu.sh
]
&&
sh
$COREDIR
/su/magisksu.sh
[
!
-f
/sbin/launch_daemonsu.sh
]
&&
sh
$COREDIR
/su/magisksu.sh
export
PATH
=
$TOOLPATH
:
$OLDPATH
export
PATH
=
$TOOLPATH
:
$OLDPATH
# Disable Magic Mount if specified
[
-f
$DISABLEFILE
]
&&
unblock
[
-f
$APPDIR
/disable
]
&&
unblock
log_print
"* Preparing modules"
log_print
"* Preparing modules"
...
@@ -498,6 +501,10 @@ case $1 in
...
@@ -498,6 +501,10 @@ case $1 in
# Version info
# Version info
MAGISK_VERSION_STUB
MAGISK_VERSION_STUB
log_print
"** Magisk late_start service mode running..."
log_print
"** Magisk late_start service mode running..."
if
[
-f
$DISABLEFILE
]
;
then
setprop ro.magisk.disable 1
exit
fi
run_scripts service
run_scripts service
;;
;;
...
...
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