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
dac85757
Commit
dac85757
authored
Sep 25, 2016
by
d8ahazard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-add busybox
Add check for proper install, install if not. Needed for flashing zips.
parent
3b0cec9d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
SplashActivity.java
app/src/main/java/com/topjohnwu/magisk/SplashActivity.java
+18
-0
Utils.java
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
+11
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/SplashActivity.java
View file @
dac85757
...
...
@@ -10,6 +10,7 @@ import android.support.v7.app.AppCompatActivity;
import
com.topjohnwu.magisk.services.MonitorService
;
import
com.topjohnwu.magisk.utils.Async
;
import
com.topjohnwu.magisk.utils.Logger
;
import
com.topjohnwu.magisk.utils.Shell
;
import
com.topjohnwu.magisk.utils.Utils
;
import
java.util.HashSet
;
...
...
@@ -64,6 +65,23 @@ public class SplashActivity extends AppCompatActivity {
// Initialize
if
(
Shell
.
rootAccess
())
{
if
(!
Utils
.
busyboxInstalled
())
{
String
busybox
=
getApplicationContext
().
getApplicationInfo
().
nativeLibraryDir
+
"/libbusybox.so"
;
Shell
.
su
(
"rm -rf /data/busybox"
,
"mkdir -p /data/busybox"
,
"cp -af "
+
busybox
+
" /data/busybox/busybox"
,
"chmod 755 /data/busybox /data/busybox/busybox"
,
"chcon u:object_r:system_file:s0 /data/busybox /data/busybox/busybox"
,
"/data/busybox/busybox --install -s /data/busybox"
,
"rm -f /data/busybox/su"
,
"export PATH=/data/busybox:$PATH"
);
}
}
new
Async
.
CheckUpdates
(
this
).
execute
();
new
Async
.
LoadModules
(
this
).
execute
();
new
Async
.
LoadRepos
(
this
).
executeOnExecutor
(
AsyncTask
.
THREAD_POOL_EXECUTOR
);
...
...
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
View file @
dac85757
...
...
@@ -91,6 +91,17 @@ public class Utils {
return
Boolean
.
parseBoolean
(
ret
.
get
(
0
));
}
public
static
boolean
busyboxInstalled
()
{
List
<
String
>
ret
;
String
command
=
"if [ -d /data/busybox ]; then echo true; else echo false; fi"
;
if
(
Shell
.
rootAccess
())
{
ret
=
Shell
.
su
(
command
);
}
else
{
ret
=
Shell
.
sh
(
command
);
}
return
Boolean
.
parseBoolean
(
ret
.
get
(
0
));
}
public
static
boolean
rootEnabled
()
{
List
<
String
>
ret
;
String
command
=
"if [ -z $(which su) ]; then echo false; else echo true; fi"
;
...
...
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