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
68c448bc
Commit
68c448bc
authored
Jul 11, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let ShellInitializer run in BusyBox environment
parent
b885ccbd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
build.gradle
build.gradle
+1
-1
ShellInitializer.java
...ull/java/com/topjohnwu/magisk/utils/ShellInitializer.java
+9
-3
No files found.
build.gradle
View file @
68c448bc
...
@@ -57,7 +57,7 @@ dependencies {
...
@@ -57,7 +57,7 @@ dependencies {
fullImplementation
"com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}"
fullImplementation
"com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}"
fullImplementation
"com.android.support:cardview-v7:${rootProject.ext.supportLibVersion}"
fullImplementation
"com.android.support:cardview-v7:${rootProject.ext.supportLibVersion}"
fullImplementation
"com.android.support:design:${rootProject.ext.supportLibVersion}"
fullImplementation
"com.android.support:design:${rootProject.ext.supportLibVersion}"
fullImplementation
'com.github.topjohnwu:libsu:1.
2
.0'
fullImplementation
'com.github.topjohnwu:libsu:1.
3
.0'
fullImplementation
'com.atlassian.commonmark:commonmark:0.11.0'
fullImplementation
'com.atlassian.commonmark:commonmark:0.11.0'
fullImplementation
'org.kamranzafar:jtar:2.3'
fullImplementation
'org.kamranzafar:jtar:2.3'
fullImplementation
'com.jakewharton:butterknife:8.8.1'
fullImplementation
'com.jakewharton:butterknife:8.8.1'
...
...
src/full/java/com/topjohnwu/magisk/utils/ShellInitializer.java
View file @
68c448bc
...
@@ -6,20 +6,26 @@ import android.support.annotation.NonNull;
...
@@ -6,20 +6,26 @@ import android.support.annotation.NonNull;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.superuser.BusyBox
;
import
com.topjohnwu.superuser.BusyBox
;
import
com.topjohnwu.superuser.Shell
;
import
com.topjohnwu.superuser.Shell
;
import
com.topjohnwu.superuser.ShellUtils
;
import
java.io.File
;
import
java.io.File
;
import
java.io.InputStream
;
import
java.io.InputStream
;
public
class
ShellInitializer
extends
Shell
.
Initializer
{
public
class
ShellInitializer
extends
Shell
.
Initializer
{
static
{
BusyBox
.
BB_PATH
=
new
File
(
Const
.
BUSYBOX_PATH
);
}
@Override
@Override
public
boolean
onRootShellInit
(
Context
context
,
@NonNull
Shell
shell
)
throws
Exception
{
public
boolean
onRootShellInit
(
Context
context
,
@NonNull
Shell
shell
)
throws
Exception
{
BusyBox
.
BB_PATH
=
new
File
(
Const
.
BUSYBOX_PATH
);
try
(
InputStream
magiskUtils
=
context
.
getResources
().
openRawResource
(
R
.
raw
.
util_functions
);
try
(
InputStream
magiskUtils
=
context
.
getResources
().
openRawResource
(
R
.
raw
.
util_functions
);
InputStream
managerUtils
=
context
.
getResources
().
openRawResource
(
R
.
raw
.
utils
)
InputStream
managerUtils
=
context
.
getResources
().
openRawResource
(
R
.
raw
.
utils
)
)
{
)
{
shell
.
loadInputStream
(
null
,
null
,
magiskUtils
);
shell
.
execTask
((
in
,
err
,
out
)
->
{
shell
.
loadInputStream
(
null
,
null
,
managerUtils
);
ShellUtils
.
pump
(
magiskUtils
,
in
);
ShellUtils
.
pump
(
managerUtils
,
in
);
});
}
}
shell
.
run
(
null
,
null
,
shell
.
run
(
null
,
null
,
"mount_partitions"
,
"mount_partitions"
,
...
...
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