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
cdb8ee39
Commit
cdb8ee39
authored
Dec 08, 2016
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #19 uninstaller issues
parent
1e358662
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
13 deletions
+19
-13
update-binary
uninstaller/META-INF/com/google/android/update-binary
+19
-13
No files found.
uninstaller/META-INF/com/google/android/update-binary
View file @
cdb8ee39
...
...
@@ -10,6 +10,12 @@
INSTALLER
=
/tmp/uninstall
# Boot Image Variables
CHROMEDIR
=
$INSTALLER
/chromeos
NEWBOOT
=
$TMPDIR
/boottmp/new-boot.img
UNPACKDIR
=
$TMPDIR
/boottmp/bootunpack
RAMDISK
=
$TMPDIR
/boottmp/ramdisk
# Default permissions
umask
022
...
...
@@ -73,7 +79,7 @@ find_boot_image() {
if
[
-z
"
$BOOTIMAGE
"
]
;
then
FSTAB
=
"/etc/recovery.fstab"
[
!
-f
"
$FSTAB
"
]
&&
FSTAB
=
"/etc/recovery.fstab.bak"
[
-f
"
$FSTAB
"
]
BOOTIMAGE
=
`
grep
-E
'\b/boot\b'
"
$FSTAB
"
|
grep
-oE
'/dev/[a-zA-Z0-9_./-]*'
`
[
-f
"
$FSTAB
"
]
&&
BOOTIMAGE
=
`
grep
-E
'\b/boot\b'
"
$FSTAB
"
|
grep
-oE
'/dev/[a-zA-Z0-9_./-]*'
`
fi
}
...
...
@@ -101,7 +107,7 @@ unpack_boot() {
mkdir
-p
$UNPACKDIR
mkdir
-p
$RAMDISK
cd
$UNPACKDIR
$BINDIR
/bootimgtools
--extract
$1
LD_LIBRARY_PATH
=
$SYSTEMLIB
$BINDIR
/bootimgtools
--extract
$1
cd
$RAMDISK
gunzip
-c
<
$UNPACKDIR
/ramdisk.gz | cpio
-i
...
...
@@ -111,11 +117,11 @@ repack_boot() {
cd
$RAMDISK
find
.
| cpio
-o
-H
newc 2>/dev/null |
gzip
-9
>
$UNPACKDIR
/ramdisk.gz
cd
$UNPACKDIR
$BINDIR
/bootimgtools
--repack
$ORIGBOOT
LD_LIBRARY_PATH
=
$SYSTEMLIB
$BINDIR
/bootimgtools
--repack
$ORIGBOOT
if
[
-f
chromeos
]
;
then
echo
" "
>
config
echo
" "
>
bootloader
$CHROMEDIR
/futility vbutil_kernel
--pack
new-boot.img.signed
--keyblock
$CHROMEDIR
/kernel.keyblock
--signprivate
$CHROMEDIR
/kernel_data_key.vbprivk
--version
1
--vmlinuz
new-boot.img
--config
config
--arch
arm
--bootloader
bootloader
--flags
0x1
LD_LIBRARY_PATH
=
$SYSTEMLIB
$CHROMEDIR
/futility vbutil_kernel
--pack
new-boot.img.signed
--keyblock
$CHROMEDIR
/kernel.keyblock
--signprivate
$CHROMEDIR
/kernel_data_key.vbprivk
--version
1
--vmlinuz
new-boot.img
--config
config
--arch
arm
--bootloader
bootloader
--flags
0x1
rm
-f
new-boot.img
mv
new-boot.img.signed new-boot.img
fi
...
...
@@ -132,11 +138,6 @@ revert_boot() {
rm
-rf
$TMPDIR
/boottmp 2>/dev/null
mkdir
-p
$TMPDIR
/boottmp
CHROMEDIR
=
$INSTALLER
/chromeos
NEWBOOT
=
$TMPDIR
/boottmp/new-boot.img
UNPACKDIR
=
$TMPDIR
/boottmp/bootunpack
RAMDISK
=
$TMPDIR
/boottmp/ramdisk
ORIGBOOT
=
$BOOTIMAGE
ui_print
"- Unpacking boot image"
...
...
@@ -145,8 +146,7 @@ revert_boot() {
if
[
-d
".backup"
]
;
then
ui_print
"- Restoring ramdisk with backup"
cp
-af
.backup/.
.
rm
-rf
magisk init.magisk.rc sbin/magic_mask.sh 2>/dev/null
rm
-rf
.backup
rm
-rf
magisk init.magisk.rc sbin/magic_mask.sh .backup 2>/dev/null
else
ui_print
"! No ramdisk backup found"
ui_print
"! Unable to revert completely"
...
...
@@ -205,6 +205,9 @@ ui_print "- Device platform: $ARCH"
BINDIR
=
$INSTALLER
/
$ARCH
chmod
-R
755
$CHROMEDIR
/futility
$BINDIR
SYSTEMLIB
=
/system/lib
(
$IS64BIT
)
&&
SYSTEMLIB
=
/system/lib64
find_boot_image
if
[
-z
"
$BOOTIMAGE
"
]
;
then
ui_print
"! Unable to detect boot image"
...
...
@@ -215,7 +218,10 @@ fi
# Detection all done, start installing
##########################################################################################
ui_print
"- Found Boot Image:
$BOOTIMAGE
"
if
(
is_mounted /data
)
;
then
PATH
=
/data/busybox:
$PATH
cp
-af
/data/stock_boot_
*
.gz /data/stock_boot.img.gz 2>/dev/null
gzip
-d
/data/stock_boot.img.gz 2>/dev/null
rm
-rf
/data/stock_boot.img.gz 2>/dev/null
...
...
@@ -232,13 +238,13 @@ if (is_mounted /data); then
/data/Magisk.apk /data/magisk.img /data/magisk_merge.img
\
/data/busybox /data/magisk /data/custom_ramdisk_patch.sh 2>/dev/null
else
ui_print
"! Data unava
li
ble"
ui_print
"! Data unava
ila
ble"
ui_print
"! Impossible to restore original boot image"
ui_print
"! Try using ramdisk backup"
revert_boot
ui_print
"- Removing Magisk files"
rm
-rf
/cache/magisk.log /cache/last_magisk.log /cache/magiskhide.log
\
/cache/magisk /cache/magisk_merge /cache/magisk_mount
/cache/unblock 2>/dev/null
/cache/magisk /cache/magisk_merge /cache/magisk_mount /cache/unblock 2>/dev/null
ui_print
"*****************************************"
ui_print
" Magisk is not fully removed yet "
ui_print
" Please manually remove /data/magisk.img "
...
...
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