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
98e21f9f
Commit
98e21f9f
authored
Sep 27, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update uninstaller
parent
83af0497
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
25 deletions
+16
-25
magisk_uninstaller.sh
scripts/magisk_uninstaller.sh
+10
-21
uninstaller_loader.sh
scripts/uninstaller_loader.sh
+6
-4
No files found.
scripts/magisk_uninstaller.sh
View file @
98e21f9f
...
@@ -36,8 +36,6 @@ if $BOOTMODE; then
...
@@ -36,8 +36,6 @@ if $BOOTMODE; then
.
$MAGISKBIN
/util_functions.sh
.
$MAGISKBIN
/util_functions.sh
boot_actions
boot_actions
mount_partitions
mount_partitions
else
recovery_actions
fi
fi
cd
$MAGISKBIN
cd
$MAGISKBIN
...
@@ -81,15 +79,17 @@ case $? in
...
@@ -81,15 +79,17 @@ case $? in
ui_print
"- Magisk patched image detected!"
ui_print
"- Magisk patched image detected!"
# Find SHA1 of stock boot image
# Find SHA1 of stock boot image
[
-z
$SHA1
]
&&
SHA1
=
`
./magiskboot
--cpio-stocksha1
ramdisk.cpio 2>/dev/null
`
[
-z
$SHA1
]
&&
SHA1
=
`
./magiskboot
--cpio-stocksha1
ramdisk.cpio 2>/dev/null
`
[
!
-z
$SHA1
]
&&
STOCK
DUMP
=
/data/stock_boot_
${
SHA1
}
.img
[
!
-z
$SHA1
]
&&
STOCK
BOOT
=
/data/stock_boot_
${
SHA1
}
.img.gz
if
[
-f
${
STOCKDUMP
}
.gz
]
;
then
if
[
-f
"
$STOCKBOOT
"
]
;
then
ui_print
"- Boot image backup found!"
ui_print
"- Boot image backup found!"
./magiskboot
--decompress
${
STOCKDUMP
}
.gz new-boot.img
else
else
ui_print
"! Boot image backup unavailable"
ui_print
"! Boot image backup unavailable"
ui_print
"- Restoring ramdisk with internal backup"
ui_print
"- Restoring ramdisk with internal backup"
./magiskboot
--cpio-restore
ramdisk.cpio
./magiskboot
--cpio-restore
ramdisk.cpio
./magiskboot
--repack
$BOOTIMAGE
new-boot.img
./magiskboot
--repack
$BOOTIMAGE
# Sign chromeos boot
$CHROMEOS
&&
sign_chromeos
STOCKBOOT
=
new-boot.img
fi
fi
;;
;;
2
)
# Other patched
2
)
# Other patched
...
@@ -98,24 +98,13 @@ case $? in
...
@@ -98,24 +98,13 @@ case $? in
;;
;;
esac
esac
# Sign chromeos boot
flash_boot_image
$STOCKBOOT
"
$BOOTIMAGE
"
$CHROMEOS
&&
sign_chromeos
ui_print
"- Flashing stock/reverted image"
if
[
-L
"
$BOOTIMAGE
"
]
;
then
dd
if
=
new-boot.img
of
=
"
$BOOTIMAGE
"
bs
=
4096
else
cat
new-boot.img /dev/zero |
dd
of
=
"
$BOOTIMAGE
"
bs
=
4096
>
/dev/null 2>&1
fi
rm
-f
new-boot.img
cd
/
cd
/
ui_print
"- Removing Magisk files"
ui_print
"- Removing Magisk files"
rm
-rf
/cache/magisk.log /cache/last_magisk.log /cache/magiskhide.log /cache/.disable_magisk
\
rm
-rf
/cache/
*
magisk
*
/cache/unblock /data/
*
magisk
*
/data/cache/
*
magisk
*
/data/property/
*
magisk
*
\
/cache/magisk /cache/magisk_merge /cache/magisk_mount /cache/unblock /cache/magisk_uninstaller.sh
\
/data/Magisk.apk /data/busybox /data/custom_ramdisk_patch.sh
\
/data/Magisk.apk /data/magisk.apk /data/magisk.img /data/magisk_merge.img /data/magisk_debug.log
\
/data/busybox /data/magisk /data/custom_ramdisk_patch.sh /data/property/
*
magisk
*
\
/data/app/com.topjohnwu.magisk
*
/data/user
*
/
*
/com.topjohnwu.magisk 2>/dev/null
/data/app/com.topjohnwu.magisk
*
/data/user
*
/
*
/com.topjohnwu.magisk 2>/dev/null
$BOOTMODE
&&
reboot
||
recovery_cleanup
$BOOTMODE
&&
reboot
scripts/uninstaller_loader.sh
View file @
98e21f9f
...
@@ -40,7 +40,8 @@ ui_print "************************"
...
@@ -40,7 +40,8 @@ ui_print "************************"
ui_print
" Magisk Uninstaller "
ui_print
" Magisk Uninstaller "
ui_print
"************************"
ui_print
"************************"
is_mounted /data
||
mount /data
is_mounted /data
||
mount /data
||
abort
"! Unable to mount partitions"
is_mounted /cache
||
mount /cache 2>/dev/null
mount_partitions
mount_partitions
api_level_arch_detect
api_level_arch_detect
...
@@ -56,21 +57,22 @@ BINDIR=$INSTALLER/$ARCH
...
@@ -56,21 +57,22 @@ BINDIR=$INSTALLER/$ARCH
MAGISKBIN
=
/data/magisk
MAGISKBIN
=
/data/magisk
if
is_mounted /data
;
then
if
is_mounted /data
;
then
recovery_actions
# Save our stock boot image dump before removing it
# Save our stock boot image dump before removing it
[
-f
$MAGISKBIN
/stock_boot
*
]
&&
mv
$MAGISKBIN
/stock_boot
*
/data
mv
$MAGISKBIN
/stock_boot
*
/data 2>/dev/null
# Copy the binaries to /data/magisk, in case they do not exist
# 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
chmod
-R
755
$MAGISKBIN
chmod
-R
755
$MAGISKBIN
# Run the act
t
ual uninstallation
# Run the actual uninstallation
.
$INSTALLER
/magisk_uninstaller.sh
.
$INSTALLER
/magisk_uninstaller.sh
recovery_cleanup
else
else
ui_print
"! Data unavailable"
ui_print
"! Data unavailable"
ui_print
"! Placing uninstall script to /cache"
ui_print
"! Placing uninstall script to /cache"
ui_print
"! The device might reboot multiple times"
ui_print
"! The device might reboot multiple times"
cp
-af
$INSTALLER
/magisk_uninstaller.sh /cache/magisk_uninstaller.sh
cp
-af
$INSTALLER
/magisk_uninstaller.sh /cache/magisk_uninstaller.sh
umount /system
ui_print
"- Rebooting....."
ui_print
"- Rebooting....."
sleep
5
sleep
5
reboot
reboot
...
...
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