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
c8216f9b
Commit
c8216f9b
authored
Jun 26, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix uninstaller
parent
e579f314
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
18 deletions
+34
-18
flash_script.sh
scripts/flash_script.sh
+1
-8
magisk_uninstaller.sh
scripts/magisk_uninstaller.sh
+15
-5
uninstaller_loader.sh
scripts/uninstaller_loader.sh
+7
-5
util_functions.sh
scripts/util_functions.sh
+11
-0
No files found.
scripts/flash_script.sh
View file @
c8216f9b
...
@@ -76,14 +76,7 @@ remove_system_su
...
@@ -76,14 +76,7 @@ remove_system_su
ui_print
"- Constructing environment"
ui_print
"- Constructing environment"
DATA
=
false
check_data
DATA_DE
=
false
if
grep
' /data '
/proc/mounts |
grep
-vq
'tmpfs'
;
then
# Test if data is writable
touch
/data/.rw
&&
rm
/data/.rw
&&
DATA
=
true
# Test if DE storage is writable
$DATA
&&
[
-d
/data/adb
]
&&
touch
/data/adb/.rw
&&
rm
/data/adb/.rw
&&
DATA_DE
=
true
fi
if
$DATA
;
then
if
$DATA
;
then
MAGISKBIN
=
/data/magisk
MAGISKBIN
=
/data/magisk
...
...
scripts/magisk_uninstaller.sh
View file @
c8216f9b
...
@@ -36,17 +36,23 @@ if $BOOTMODE; then
...
@@ -36,17 +36,23 @@ if $BOOTMODE; then
.
$MAGISKBIN
/util_functions.sh
.
$MAGISKBIN
/util_functions.sh
BOOTMODE
=
true
BOOTMODE
=
true
boot_actions
boot_actions
mount_partitions
fi
fi
mount_partitions
find_boot_image
find_dtbo_image
[
-e
$BOOTIMAGE
]
||
abort
"! Unable to detect boot image"
ui_print
"- Found boot/ramdisk image:
$BOOTIMAGE
"
[
-z
$DTBOIMAGE
]
||
ui_print
"- Found dtbo image:
$DTBOIMAGE
"
cd
$MAGISKBIN
cd
$MAGISKBIN
[
-z
$BOOTIMAGE
]
&&
abort
"! Unable to detect boot image"
CHROMEOS
=
false
ui_print
"- Found Boot Image:
$BOOTIMAGE
"
ui_print
"- Unpacking boot image"
ui_print
"- Unpacking boot image"
./magiskboot
--unpack
"
$BOOTIMAGE
"
./magiskboot
--unpack
"
$BOOTIMAGE
"
CHROMEOS
=
false
case
$?
in
case
$?
in
1
)
1
)
...
@@ -71,7 +77,6 @@ ui_print "- Checking ramdisk status"
...
@@ -71,7 +77,6 @@ ui_print "- Checking ramdisk status"
case
$?
in
case
$?
in
0
)
# Stock boot
0
)
# Stock boot
ui_print
"- Stock boot image detected"
ui_print
"- Stock boot image detected"
abort
"! Magisk is not installed!"
;;
;;
1|2
)
# Magisk patched
1|2
)
# Magisk patched
ui_print
"- Magisk patched image detected"
ui_print
"- Magisk patched image detected"
...
@@ -103,4 +108,9 @@ rm -rf /cache/*magisk* /cache/unblock /data/*magisk* /data/cache/*magisk* /data
...
@@ -103,4 +108,9 @@ rm -rf /cache/*magisk* /cache/unblock /data/*magisk* /data/cache/*magisk* /data
/data/user
*
/
*
/magisk.db /data/user
*
/
*
/com.topjohnwu.magisk /data/user
*
/
*
/.tmp.magisk.config
\
/data/user
*
/
*
/magisk.db /data/user
*
/
*
/com.topjohnwu.magisk /data/user
*
/
*
/.tmp.magisk.config
\
/data/adb/
*
magisk
*
2>/dev/null
/data/adb/
*
magisk
*
2>/dev/null
if
[
-f
/system/addon.d/99-magisk.sh
]
;
then
mount
-o
rw,remount /system
rm
-f
/system/addon.d/99-magisk.sh
fi
$BOOTMODE
&&
/system/bin/reboot
$BOOTMODE
&&
/system/bin/reboot
scripts/uninstaller_loader.sh
View file @
c8216f9b
...
@@ -12,11 +12,12 @@
...
@@ -12,11 +12,12 @@
# Preparation
# Preparation
##########################################################################################
##########################################################################################
BOOTMODE
=
false
# This path should work in any cases
# This path should work in any cases
TMPDIR
=
/dev/tmp
TMPDIR
=
/dev/tmp
INSTALLER
=
$TMPDIR
/install
INSTALLER
=
$TMPDIR
/install
CHROMEDIR
=
$INSTALLER
/chromeos
# Default permissions
# Default permissions
umask
022
umask
022
...
@@ -30,6 +31,7 @@ fi
...
@@ -30,6 +31,7 @@ fi
# Load utility functions
# Load utility functions
.
$INSTALLER
/util_functions.sh
.
$INSTALLER
/util_functions.sh
get_outfd
get_outfd
##########################################################################################
##########################################################################################
...
@@ -42,23 +44,23 @@ ui_print "************************"
...
@@ -42,23 +44,23 @@ ui_print "************************"
is_mounted /data
||
mount /data
||
abort
"! Unable to mount partitions"
is_mounted /data
||
mount /data
||
abort
"! Unable to mount partitions"
is_mounted /cache
||
mount /cache 2>/dev/null
is_mounted /cache
||
mount /cache 2>/dev/null
mount_partitions
api_level_arch_detect
api_level_arch_detect
ui_print
"- Device platform:
$ARCH
"
ui_print
"- Device platform:
$ARCH
"
CHROMEDIR
=
$INSTALLER
/chromeos
BINDIR
=
$INSTALLER
/
$ARCH32
BINDIR
=
$INSTALLER
/
$ARCH32
chmod
-R
755
$CHROMEDIR
$BINDIR
##########################################################################################
##########################################################################################
# Detection all done, start installing
# Detection all done, start installing
##########################################################################################
##########################################################################################
if
is_mounted /data
;
then
check_data
if
$DATA_DE
;
then
recovery_actions
recovery_actions
# Save our stock boot image dump before removing it
# Save our stock boot image dump before removing it
mv
$MAGISKBIN
/stock_boot
*
/data 2>/dev/null
mv
$MAGISKBIN
/stock_boot
*
/data 2>/dev/null
# Copy the binaries to /data/magisk, in case they do not exist
rm
-rf
$MAGISKBIN
2>/dev/null
rm
-rf
$MAGISKBIN
2>/dev/null
mkdir
-p
$MAGISKBIN
mkdir
-p
$MAGISKBIN
cp
-af
$BINDIR
/.
$CHROMEDIR
$TMPDIR
/bin/busybox
$INSTALLER
/util_functions.sh
$MAGISKBIN
cp
-af
$BINDIR
/.
$CHROMEDIR
$TMPDIR
/bin/busybox
$INSTALLER
/util_functions.sh
$MAGISKBIN
...
...
scripts/util_functions.sh
View file @
c8216f9b
...
@@ -295,6 +295,17 @@ api_level_arch_detect() {
...
@@ -295,6 +295,17 @@ api_level_arch_detect() {
if
[
"
$ABILONG
"
=
"x86_64"
]
;
then
ARCH
=
x64
;
ARCH32
=
x86
;
IS64BIT
=
true
;
fi
;
if
[
"
$ABILONG
"
=
"x86_64"
]
;
then
ARCH
=
x64
;
ARCH32
=
x86
;
IS64BIT
=
true
;
fi
;
}
}
check_data
()
{
DATA
=
false
DATA_DE
=
false
if
grep
' /data '
/proc/mounts |
grep
-vq
'tmpfs'
;
then
# Test if data is writable
touch
/data/.rw
&&
rm
/data/.rw
&&
DATA
=
true
# Test if DE storage is writable
$DATA
&&
[
-d
/data/adb
]
&&
touch
/data/adb/.rw
&&
rm
/data/adb/.rw
&&
DATA_DE
=
true
fi
}
setup_bb
()
{
setup_bb
()
{
if
[
-x
/sbin/.core/busybox/busybox
]
;
then
if
[
-x
/sbin/.core/busybox/busybox
]
;
then
# Make sure this path is in the front
# Make sure this path is in the front
...
...
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