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
1421e775
Commit
1421e775
authored
Jan 01, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove system root
parent
f8eab72c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
2 deletions
+29
-2
flash_script.sh
scripts/flash_script.sh
+29
-2
No files found.
scripts/flash_script.sh
View file @
1421e775
...
@@ -190,6 +190,31 @@ repack_boot() {
...
@@ -190,6 +190,31 @@ repack_boot() {
mv
new-boot.img
$NEWBOOT
mv
new-boot.img
$NEWBOOT
}
}
remove_system_su
()
{
if
[
-f
/system/bin/su
-o
-f
/system/xbin/su
]
&&
[
!
-f
/su/bin/su
]
;
then
ui_print
"! System installed root detected, mount rw :("
mount
-o
rw,remount /system
# SuperSU
if
[
-e
/system/bin/.ext/.su
]
;
then
mv
-f
/system/bin/app_process32_original /system/bin/app_process32 2>/dev/null
mv
-f
/system/bin/app_process64_original /system/bin/app_process64 2>/dev/null
mv
-f
/system/bin/install-recovery_original.sh /system/bin/install-recovery.sh 2>/dev/null
cd
/system/bin
if
[
-e
app_process64
]
;
then
ln
-sf
app_process64 app_process
else
ln
-sf
app_process32 app_process
fi
fi
rm
-rf
/system/.pin /system/bin/.ext /system/etc/.installed_su_daemon /system/etc/.has_su_daemon
\
/system/xbin/daemonsu /system/xbin/su /system/xbin/sugote /system/xbin/sugote-mksh /system/xbin/supolicy
\
/system/bin/app_process_init /system/bin/su /cache/su /system/lib/libsupol.so /system/lib64/libsupol.so
\
/system/su.d /system/etc/install-recovery.sh /system/etc/init.d/99SuperSUDaemon /cache/install-recovery.sh
\
/system/.supersu /cache/.supersu /data/.supersu
\
/system/app/Superuser.apk /system/app/SuperSU /cache/Superuser.apk 2>/dev/null
fi
}
##########################################################################################
##########################################################################################
# Detection
# Detection
##########################################################################################
##########################################################################################
...
@@ -229,6 +254,9 @@ if [ -z "$KEEPFORCEENCRYPT" ]; then
...
@@ -229,6 +254,9 @@ if [ -z "$KEEPFORCEENCRYPT" ]; then
KEEPFORCEENCRYPT
=
false
KEEPFORCEENCRYPT
=
false
fi
fi
# Check if system root is installed and remove
remove_system_su
SAMSUNG
=
false
SAMSUNG
=
false
SAMSUNG_CHECK
=
$(
cat
/system/build.prop |
grep
"ro.build.fingerprint="
|
grep
-i
"samsung"
)
SAMSUNG_CHECK
=
$(
cat
/system/build.prop |
grep
"ro.build.fingerprint="
|
grep
-i
"samsung"
)
if
[
$?
-eq
0
]
;
then
if
[
$?
-eq
0
]
;
then
...
@@ -427,8 +455,7 @@ else
...
@@ -427,8 +455,7 @@ else
unpack_boot
$ORIGBOOT
unpack_boot
$ORIGBOOT
fi
fi
# Removing possible modifications
# Removing possible modifications
rm
-rf
magisk init.magisk.rc sbin/magic_mask.sh 2>/dev/null
rm
-rf
magisk init.magisk.rc sbin/magic_mask.sh sbin/su init.xposed.rc sbin/mount_xposed.sh 2>/dev/null
rm
-rf
init.xposed.rc sbin/mount_xposed.sh 2>/dev/null
ORIGBOOT
=
false
ORIGBOOT
=
false
fi
fi
...
...
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