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
Show 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 @@
...
@@ -10,6 +10,12 @@
INSTALLER
=
/tmp/uninstall
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
# Default permissions
umask
022
umask
022
...
@@ -73,7 +79,7 @@ find_boot_image() {
...
@@ -73,7 +79,7 @@ find_boot_image() {
if
[
-z
"
$BOOTIMAGE
"
]
;
then
if
[
-z
"
$BOOTIMAGE
"
]
;
then
FSTAB
=
"/etc/recovery.fstab"
FSTAB
=
"/etc/recovery.fstab"
[
!
-f
"
$FSTAB
"
]
&&
FSTAB
=
"/etc/recovery.fstab.bak"
[
!
-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
fi
}
}
...
@@ -101,7 +107,7 @@ unpack_boot() {
...
@@ -101,7 +107,7 @@ unpack_boot() {
mkdir
-p
$UNPACKDIR
mkdir
-p
$UNPACKDIR
mkdir
-p
$RAMDISK
mkdir
-p
$RAMDISK
cd
$UNPACKDIR
cd
$UNPACKDIR
$BINDIR
/bootimgtools
--extract
$1
LD_LIBRARY_PATH
=
$SYSTEMLIB
$BINDIR
/bootimgtools
--extract
$1
cd
$RAMDISK
cd
$RAMDISK
gunzip
-c
<
$UNPACKDIR
/ramdisk.gz | cpio
-i
gunzip
-c
<
$UNPACKDIR
/ramdisk.gz | cpio
-i
...
@@ -111,11 +117,11 @@ repack_boot() {
...
@@ -111,11 +117,11 @@ repack_boot() {
cd
$RAMDISK
cd
$RAMDISK
find
.
| cpio
-o
-H
newc 2>/dev/null |
gzip
-9
>
$UNPACKDIR
/ramdisk.gz
find
.
| cpio
-o
-H
newc 2>/dev/null |
gzip
-9
>
$UNPACKDIR
/ramdisk.gz
cd
$UNPACKDIR
cd
$UNPACKDIR
$BINDIR
/bootimgtools
--repack
$ORIGBOOT
LD_LIBRARY_PATH
=
$SYSTEMLIB
$BINDIR
/bootimgtools
--repack
$ORIGBOOT
if
[
-f
chromeos
]
;
then
if
[
-f
chromeos
]
;
then
echo
" "
>
config
echo
" "
>
config
echo
" "
>
bootloader
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
rm
-f
new-boot.img
mv
new-boot.img.signed new-boot.img
mv
new-boot.img.signed new-boot.img
fi
fi
...
@@ -132,11 +138,6 @@ revert_boot() {
...
@@ -132,11 +138,6 @@ revert_boot() {
rm
-rf
$TMPDIR
/boottmp 2>/dev/null
rm
-rf
$TMPDIR
/boottmp 2>/dev/null
mkdir
-p
$TMPDIR
/boottmp
mkdir
-p
$TMPDIR
/boottmp
CHROMEDIR
=
$INSTALLER
/chromeos
NEWBOOT
=
$TMPDIR
/boottmp/new-boot.img
UNPACKDIR
=
$TMPDIR
/boottmp/bootunpack
RAMDISK
=
$TMPDIR
/boottmp/ramdisk
ORIGBOOT
=
$BOOTIMAGE
ORIGBOOT
=
$BOOTIMAGE
ui_print
"- Unpacking boot image"
ui_print
"- Unpacking boot image"
...
@@ -145,8 +146,7 @@ revert_boot() {
...
@@ -145,8 +146,7 @@ revert_boot() {
if
[
-d
".backup"
]
;
then
if
[
-d
".backup"
]
;
then
ui_print
"- Restoring ramdisk with backup"
ui_print
"- Restoring ramdisk with backup"
cp
-af
.backup/.
.
cp
-af
.backup/.
.
rm
-rf
magisk init.magisk.rc sbin/magic_mask.sh 2>/dev/null
rm
-rf
magisk init.magisk.rc sbin/magic_mask.sh .backup 2>/dev/null
rm
-rf
.backup
else
else
ui_print
"! No ramdisk backup found"
ui_print
"! No ramdisk backup found"
ui_print
"! Unable to revert completely"
ui_print
"! Unable to revert completely"
...
@@ -205,6 +205,9 @@ ui_print "- Device platform: $ARCH"
...
@@ -205,6 +205,9 @@ ui_print "- Device platform: $ARCH"
BINDIR
=
$INSTALLER
/
$ARCH
BINDIR
=
$INSTALLER
/
$ARCH
chmod
-R
755
$CHROMEDIR
/futility
$BINDIR
chmod
-R
755
$CHROMEDIR
/futility
$BINDIR
SYSTEMLIB
=
/system/lib
(
$IS64BIT
)
&&
SYSTEMLIB
=
/system/lib64
find_boot_image
find_boot_image
if
[
-z
"
$BOOTIMAGE
"
]
;
then
if
[
-z
"
$BOOTIMAGE
"
]
;
then
ui_print
"! Unable to detect boot image"
ui_print
"! Unable to detect boot image"
...
@@ -215,7 +218,10 @@ fi
...
@@ -215,7 +218,10 @@ fi
# Detection all done, start installing
# Detection all done, start installing
##########################################################################################
##########################################################################################
ui_print
"- Found Boot Image:
$BOOTIMAGE
"
if
(
is_mounted /data
)
;
then
if
(
is_mounted /data
)
;
then
PATH
=
/data/busybox:
$PATH
cp
-af
/data/stock_boot_
*
.gz /data/stock_boot.img.gz 2>/dev/null
cp
-af
/data/stock_boot_
*
.gz /data/stock_boot.img.gz 2>/dev/null
gzip
-d
/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
rm
-rf
/data/stock_boot.img.gz 2>/dev/null
...
@@ -232,7 +238,7 @@ if (is_mounted /data); then
...
@@ -232,7 +238,7 @@ if (is_mounted /data); then
/data/Magisk.apk /data/magisk.img /data/magisk_merge.img
\
/data/Magisk.apk /data/magisk.img /data/magisk_merge.img
\
/data/busybox /data/magisk /data/custom_ramdisk_patch.sh 2>/dev/null
/data/busybox /data/magisk /data/custom_ramdisk_patch.sh 2>/dev/null
else
else
ui_print
"! Data unava
li
ble"
ui_print
"! Data unava
ila
ble"
ui_print
"! Impossible to restore original boot image"
ui_print
"! Impossible to restore original boot image"
ui_print
"! Try using ramdisk backup"
ui_print
"! Try using ramdisk backup"
revert_boot
revert_boot
...
...
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