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
c8dad43e
Commit
c8dad43e
authored
Nov 20, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix boot patching
parent
a8f12470
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
InstallMagisk.java
.../main/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java
+14
-12
No files found.
app/src/main/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java
View file @
c8dad43e
...
...
@@ -204,21 +204,22 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
switch
(
mode
)
{
case
PATCH_MODE:
File
dest
=
new
File
(
Const
.
EXTERNAL_PATH
,
patched_boot
+
mm
.
bootFormat
);
File
dest
=
new
File
(
Const
.
EXTERNAL_PATH
,
"patched_boot"
+
mm
.
bootFormat
);
dest
.
getParentFile
().
mkdirs
();
OutputStream
out
;
switch
(
mm
.
bootFormat
)
{
case
".img.tar"
:
out
=
new
TarOutputStream
(
new
BufferedOutputStream
(
new
FileOutputStream
(
dest
)));
((
TarOutputStream
)
out
).
putNextEntry
(
new
TarEntry
(
patched_boot
,
"boot.img"
));
break
;
default
:
case
".img"
:
shell
.
run_raw
(
false
,
false
,
"cp -f "
+
patched_boot
+
" "
+
dest
);
out
=
new
BufferedOutputStream
(
new
FileOutputStream
(
dest
)
);
break
;
case
".img.tar"
:
try
(
TarOutputStream
tar
=
new
TarOutputStream
(
new
BufferedOutputStream
(
new
FileOutputStream
(
dest
)));
InputStream
in
=
new
FileInputStream
(
patched_boot
)
)
{
tar
.
putNextEntry
(
new
TarEntry
(
patched_boot
,
"boot.img"
));
Utils
.
inToOut
(
in
,
tar
);
}
break
;
try
(
InputStream
in
=
new
BufferedInputStream
(
new
FileInputStream
(
patched_boot
)))
{
Utils
.
inToOut
(
in
,
out
);
out
.
close
();
}
console
.
add
(
""
);
console
.
add
(
"*********************************"
);
...
...
@@ -234,13 +235,14 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
"mv -f "
+
install
+
"/* /data/magisk"
,
"rm -rf "
+
install
,
"flash_boot_image "
+
patched_boot
+
" "
+
mBootLocation
,
"rm -rf "
+
patched_boot
,
"patch_dtbo_image"
);
break
;
default
:
return
false
;
}
patched_boot
.
delete
();
console
.
add
(
"- All done!"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
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