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
fd19fbf3
Commit
fd19fbf3
authored
Nov 03, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve Magisk direct install
parent
16646982
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
InstallMagisk.java
.../main/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java
+18
-13
No files found.
app/src/main/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java
View file @
fd19fbf3
...
...
@@ -183,18 +183,23 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
shell
.
run
(
mList
,
"cd "
+
install
,
"KEEPFORCEENCRYPT="
+
mKeepEnc
+
" KEEPVERITY="
+
mKeepVerity
+
" sh "
+
"update-binary indep boot_patch.sh "
+
boot
+
" && echo 'Success!' || echo 'Failed!'"
"update-binary indep boot_patch.sh "
+
boot
+
" || echo 'Failed!'"
);
if
(
!
TextUtils
.
equals
(
mList
.
get
(
mList
.
size
()
-
1
),
"Success
!"
))
if
(
TextUtils
.
equals
(
mList
.
get
(
mList
.
size
()
-
1
),
"Failed
!"
))
return
false
;
File
patched_boot
=
new
File
(
install
,
"new-boot.img"
);
shell
.
run
(
mList
,
"mv -f new-boot.img ../ 2>/dev/null"
,
"mv bin/busybox busybox 2>/dev/null"
,
"rm -rf bin *.img update-binary 2>/dev/null"
,
"cd /"
);
File
patched_boot
=
new
File
(
install
.
getParent
(),
"new-boot.img"
);
if
(
isSigned
)
{
mList
.
add
(
"- Signing boot image"
);
File
signed
=
new
File
(
install
,
"signed.img"
);
File
signed
=
new
File
(
install
.
getParent
()
,
"signed.img"
);
AssetManager
assets
=
mm
.
getAssets
();
try
(
InputStream
in
=
new
FileInputStream
(
patched_boot
);
...
...
@@ -207,7 +212,6 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
shell
.
run_raw
(
false
,
"mv -f "
+
signed
+
" "
+
patched_boot
);
}
mList
.
add
(
""
);
switch
(
mode
)
{
case
PATCH_MODE:
File
dest
=
new
File
(
Environment
.
getExternalStorageDirectory
()
+
"/MagiskManager/patched_boot"
+
mm
.
bootFormat
);
...
...
@@ -226,6 +230,7 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
}
break
;
}
mList
.
add
(
""
);
mList
.
add
(
"*********************************"
);
mList
.
add
(
" Patched Boot Image is placed in "
);
mList
.
add
(
" "
+
dest
+
" "
);
...
...
@@ -233,18 +238,18 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
break
;
case
DIRECT_MODE:
// Direct flash boot image
Shell
.
su
(
mList
,
"flash_boot_image "
+
patched_boot
+
" "
+
mBootLocation
);
Shell
.
su
(
mList
,
"rm -rf /data/magisk/*"
,
"mv -f "
+
install
+
"/* /data/magisk"
,
"rm -rf "
+
install
,
"flash_boot_image "
+
patched_boot
+
" "
+
mBootLocation
,
"rm -rf "
+
patched_boot
);
break
;
default
:
return
false
;
}
// Finals
shell
.
run_raw
(
false
,
"cd "
+
install
,
"mv bin/busybox busybox"
,
"rm -rf bin *.img update-binary"
,
"cd /"
);
mList
.
add
(
"- All done!"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
...
...
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