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
ce4b742b
Commit
ce4b742b
authored
Sep 03, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support .img.tar as input
parent
a9dc15bd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
9 deletions
+26
-9
build.gradle
app/build.gradle
+5
-5
MainActivity.java
app/src/main/java/com/topjohnwu/magisk/MainActivity.java
+1
-1
InstallMagisk.java
.../main/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java
+20
-3
No files found.
app/build.gradle
View file @
ce4b742b
...
@@ -8,7 +8,7 @@ android {
...
@@ -8,7 +8,7 @@ android {
applicationId
"com.topjohnwu.magisk"
applicationId
"com.topjohnwu.magisk"
minSdkVersion
21
minSdkVersion
21
targetSdkVersion
26
targetSdkVersion
26
versionCode
5
2
versionCode
5
3
versionName
"5.2.0"
versionName
"5.2.0"
ndk
{
ndk
{
moduleName
'zipadjust'
moduleName
'zipadjust'
...
@@ -54,10 +54,10 @@ repositories {
...
@@ -54,10 +54,10 @@ repositories {
dependencies
{
dependencies
{
implementation
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
implementation
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
implementation
project
(
':resource'
)
implementation
project
(
':resource'
)
implementation
'com.android.support:recyclerview-v7:26.0.
1
'
implementation
'com.android.support:recyclerview-v7:26.0.
2
'
implementation
'com.android.support:cardview-v7:26.0.
1
'
implementation
'com.android.support:cardview-v7:26.0.
2
'
implementation
'com.android.support:design:26.0.
1
'
implementation
'com.android.support:design:26.0.
2
'
implementation
'com.android.support:support-v4:26.0.
1
'
implementation
'com.android.support:support-v4:26.0.
2
'
implementation
'com.jakewharton:butterknife:8.8.1'
implementation
'com.jakewharton:butterknife:8.8.1'
implementation
'com.atlassian.commonmark:commonmark:0.9.0'
implementation
'com.atlassian.commonmark:commonmark:0.9.0'
implementation
'org.bouncycastle:bcprov-jdk15on:1.57'
implementation
'org.bouncycastle:bcprov-jdk15on:1.57'
...
...
app/src/main/java/com/topjohnwu/magisk/MainActivity.java
View file @
ce4b742b
...
@@ -51,7 +51,7 @@ public class MainActivity extends Activity
...
@@ -51,7 +51,7 @@ public class MainActivity extends Activity
setSupportActionBar
(
toolbar
);
setSupportActionBar
(
toolbar
);
ActionBarDrawerToggle
toggle
=
new
ActionBarDrawerToggle
(
this
,
drawer
,
toolbar
,
R
.
string
.
navigation_drawer_open
,
R
.
string
.
navigation_drawer_close
)
{
ActionBarDrawerToggle
toggle
=
new
ActionBarDrawerToggle
(
this
,
drawer
,
toolbar
,
R
.
string
.
magisk
,
R
.
string
.
magisk
)
{
@Override
@Override
public
void
onDrawerOpened
(
View
drawerView
)
{
public
void
onDrawerOpened
(
View
drawerView
)
{
super
.
onDrawerOpened
(
drawerView
);
super
.
onDrawerOpened
(
drawerView
);
...
...
app/src/main/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java
View file @
ce4b742b
...
@@ -10,8 +10,10 @@ import com.topjohnwu.magisk.MagiskManager;
...
@@ -10,8 +10,10 @@ import com.topjohnwu.magisk.MagiskManager;
import
com.topjohnwu.magisk.utils.AdaptiveList
;
import
com.topjohnwu.magisk.utils.AdaptiveList
;
import
com.topjohnwu.magisk.utils.Shell
;
import
com.topjohnwu.magisk.utils.Shell
;
import
com.topjohnwu.magisk.utils.TarEntry
;
import
com.topjohnwu.magisk.utils.TarEntry
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.ZipUtils
;
import
com.topjohnwu.magisk.utils.ZipUtils
;
import
org.kamranzafar.jtar.TarInputStream
;
import
org.kamranzafar.jtar.TarOutputStream
;
import
org.kamranzafar.jtar.TarOutputStream
;
import
java.io.BufferedInputStream
;
import
java.io.BufferedInputStream
;
...
@@ -113,12 +115,27 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
...
@@ -113,12 +115,27 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
// Copy boot image to local
// Copy boot image to local
try
(
try
(
InputStream
in
=
mm
.
getContentResolver
().
openInputStream
(
mBootImg
);
InputStream
in
=
mm
.
getContentResolver
().
openInputStream
(
mBootImg
);
OutputStream
out
=
new
FileOutputStream
(
boot
)
;
OutputStream
out
=
new
FileOutputStream
(
boot
)
)
{
)
{
InputStream
source
;
if
(
in
==
null
)
throw
new
FileNotFoundException
();
if
(
in
==
null
)
throw
new
FileNotFoundException
();
if
(
Utils
.
getNameFromUri
(
mm
,
mBootImg
).
endsWith
(
".tar"
))
{
// Extract boot.img from tar
TarInputStream
tar
=
new
TarInputStream
(
new
BufferedInputStream
(
in
));
org
.
kamranzafar
.
jtar
.
TarEntry
entry
;
while
((
entry
=
tar
.
getNextEntry
())
!=
null
)
{
if
(
entry
.
getName
().
equals
(
"boot.img"
))
break
;
}
source
=
tar
;
}
else
{
// Direct copy raw image
source
=
in
;
}
byte
buffer
[]
=
new
byte
[
1024
];
byte
buffer
[]
=
new
byte
[
1024
];
int
length
;
int
length
;
while
((
length
=
in
.
read
(
buffer
))
>
0
)
while
((
length
=
source
.
read
(
buffer
))
>
0
)
out
.
write
(
buffer
,
0
,
length
);
out
.
write
(
buffer
,
0
,
length
);
}
catch
(
FileNotFoundException
e
)
{
}
catch
(
FileNotFoundException
e
)
{
mList
.
add
(
"! Invalid Uri"
);
mList
.
add
(
"! Invalid Uri"
);
...
@@ -141,7 +158,7 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
...
@@ -141,7 +158,7 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
getShell
().
sh
(
mList
,
getShell
().
sh
(
mList
,
"cd "
+
install
,
"cd "
+
install
,
"KEEPFORCEENCRYPT="
+
mKeepEnc
+
" KEEPVERITY="
+
mKeepVerity
+
" sh "
+
"KEEPFORCEENCRYPT="
+
mKeepEnc
+
" KEEPVERITY="
+
mKeepVerity
+
" sh "
+
"update-binary indep boot_patch.sh "
+
boot
+
"update-binary indep boot_patch.sh "
+
boot
+
" 2>&1"
+
" && echo 'Success!' || echo 'Failed!'"
" && echo 'Success!' || echo 'Failed!'"
);
);
...
...
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