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
160ff7bb
Commit
160ff7bb
authored
Mar 22, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update abort function to cleanup module installs
CLose #2373
parent
31142180
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
module_installer.sh
scripts/module_installer.sh
+12
-4
util_functions.sh
scripts/util_functions.sh
+6
-3
No files found.
scripts/module_installer.sh
View file @
160ff7bb
...
@@ -39,13 +39,9 @@ fi
...
@@ -39,13 +39,9 @@ fi
# Legacy Support
# Legacy Support
#################
#################
# Global vars
TMPDIR
=
/dev/tmp
TMPDIR
=
/dev/tmp
PERSISTDIR
=
/sbin/.magisk/mirror/persist
PERSISTDIR
=
/sbin/.magisk/mirror/persist
rm
-rf
$TMPDIR
2>/dev/null
mkdir
-p
$TMPDIR
is_legacy_script
()
{
is_legacy_script
()
{
unzip
-l
"
$ZIPFILE
"
install.sh |
grep
-q
install.sh
unzip
-l
"
$ZIPFILE
"
install.sh |
grep
-q
install.sh
return
$?
return
$?
...
@@ -64,6 +60,18 @@ print_modname() {
...
@@ -64,6 +60,18 @@ print_modname() {
ui_print
"*******************"
ui_print
"*******************"
}
}
# Override abort as old scripts have some issues
abort
()
{
ui_print
"
$1
"
$BOOTMODE
||
recovery_cleanup
[
-n
$MODPATH
]
&&
rm
-rf
$MODPATH
rm
-rf
$TMPDIR
exit
1
}
rm
-rf
$TMPDIR
2>/dev/null
mkdir
-p
$TMPDIR
# Preperation for flashable zips
# Preperation for flashable zips
setup_flashable
setup_flashable
...
...
scripts/util_functions.sh
View file @
160ff7bb
...
@@ -47,6 +47,8 @@ is_mounted() {
...
@@ -47,6 +47,8 @@ is_mounted() {
abort
()
{
abort
()
{
ui_print
"
$1
"
ui_print
"
$1
"
$BOOTMODE
||
recovery_cleanup
$BOOTMODE
||
recovery_cleanup
[
-n
$MODPATH
]
&&
rm
-rf
$MODPATH
rm
-rf
$TMPDIR
exit
1
exit
1
}
}
...
@@ -642,8 +644,9 @@ install_module() {
...
@@ -642,8 +644,9 @@ install_module() {
unzip
-o
"
$ZIPFILE
"
module.prop
-d
$TMPDIR
>
&2
unzip
-o
"
$ZIPFILE
"
module.prop
-d
$TMPDIR
>
&2
[
!
-f
$TMPDIR
/module.prop
]
&&
abort
"! Unable to extract zip file!"
[
!
-f
$TMPDIR
/module.prop
]
&&
abort
"! Unable to extract zip file!"
local
MODDIRNAME
$BOOTMODE
&&
MODDIRNAME
=
modules_update
||
MODDIRNAME
=
modules
$BOOTMODE
&&
MODDIRNAME
=
modules_update
||
MODDIRNAME
=
modules
MODULEROOT
=
$NVBASE
/
$MODDIRNAME
local
MODULEROOT
=
$NVBASE
/
$MODDIRNAME
MODID
=
`
grep_prop
id
$TMPDIR
/module.prop
`
MODID
=
`
grep_prop
id
$TMPDIR
/module.prop
`
MODPATH
=
$MODULEROOT
/
$MODID
MODPATH
=
$MODULEROOT
/
$MODID
MODNAME
=
`
grep_prop name
$TMPDIR
/module.prop
`
MODNAME
=
`
grep_prop name
$TMPDIR
/module.prop
`
...
@@ -732,11 +735,11 @@ install_module() {
...
@@ -732,11 +735,11 @@ install_module() {
MAGISKTMP
=
/sbin/.magisk
MAGISKTMP
=
/sbin/.magisk
NVBASE
=
/data/adb
NVBASE
=
/data/adb
[
-z
$TMPDIR
]
&&
TMPDIR
=
/dev/tmp
TMPDIR
=
/dev/tmp
# Bootsigner related stuff
# Bootsigner related stuff
BOOTSIGNERCLASS
=
a.a
BOOTSIGNERCLASS
=
a.a
BOOTSIGNER
=
"/system/bin/dalvikvm -Xnoimage-dex2oat -cp
\$
APK
\$
BOOTSIGNERCLASS"
BOOTSIGNER
=
'/system/bin/dalvikvm -Xnoimage-dex2oat -cp $APK $BOOTSIGNERCLASS'
BOOTSIGNED
=
false
BOOTSIGNED
=
false
resolve_vars
resolve_vars
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