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
b72004e9
Commit
b72004e9
authored
Apr 08, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move methods
parent
f1872135
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
13 deletions
+10
-13
FlashActivity.java
app/src/main/java/com/topjohnwu/magisk/FlashActivity.java
+2
-1
EnvFixDialog.java
.../main/java/com/topjohnwu/magisk/dialogs/EnvFixDialog.java
+2
-6
ModulesFragment.java
.../java/com/topjohnwu/magisk/fragments/ModulesFragment.java
+2
-1
RootUtils.java
app/src/main/java/com/topjohnwu/magisk/utils/RootUtils.java
+4
-0
Utils.java
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
+0
-5
No files found.
app/src/main/java/com/topjohnwu/magisk/FlashActivity.java
View file @
b72004e9
...
@@ -17,6 +17,7 @@ import com.topjohnwu.magisk.adapters.StringListAdapter;
...
@@ -17,6 +17,7 @@ import com.topjohnwu.magisk.adapters.StringListAdapter;
import
com.topjohnwu.magisk.components.BaseActivity
;
import
com.topjohnwu.magisk.components.BaseActivity
;
import
com.topjohnwu.magisk.tasks.FlashZip
;
import
com.topjohnwu.magisk.tasks.FlashZip
;
import
com.topjohnwu.magisk.tasks.MagiskInstaller
;
import
com.topjohnwu.magisk.tasks.MagiskInstaller
;
import
com.topjohnwu.magisk.utils.RootUtils
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.superuser.CallbackList
;
import
com.topjohnwu.superuser.CallbackList
;
import
com.topjohnwu.superuser.Shell
;
import
com.topjohnwu.superuser.Shell
;
...
@@ -47,7 +48,7 @@ public class FlashActivity extends BaseActivity {
...
@@ -47,7 +48,7 @@ public class FlashActivity extends BaseActivity {
@OnClick
(
R
.
id
.
reboot
)
@OnClick
(
R
.
id
.
reboot
)
void
reboot
()
{
void
reboot
()
{
Utils
.
reboot
();
Root
Utils
.
reboot
();
}
}
@OnClick
(
R
.
id
.
save_logs
)
@OnClick
(
R
.
id
.
save_logs
)
...
...
app/src/main/java/com/topjohnwu/magisk/dialogs/EnvFixDialog.java
View file @
b72004e9
...
@@ -2,22 +2,18 @@ package com.topjohnwu.magisk.dialogs;
...
@@ -2,22 +2,18 @@ package com.topjohnwu.magisk.dialogs;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.app.ProgressDialog
;
import
android.app.ProgressDialog
;
import
android.content.Intent
;
import
android.widget.Toast
;
import
android.widget.Toast
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
com.topjohnwu.magisk.ClassMap
;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.SplashActivity
;
import
com.topjohnwu.magisk.tasks.MagiskInstaller
;
import
com.topjohnwu.magisk.tasks.MagiskInstaller
;
import
com.topjohnwu.magisk.utils.RootUtils
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.superuser.Shell
;
import
com.topjohnwu.superuser.Shell
;
import
com.topjohnwu.superuser.internal.UiThreadHandler
;
import
com.topjohnwu.superuser.internal.UiThreadHandler
;
import
com.topjohnwu.superuser.io.SuFile
;
import
com.topjohnwu.superuser.io.SuFile
;
import
java.io.IOException
;
public
class
EnvFixDialog
extends
CustomAlertDialog
{
public
class
EnvFixDialog
extends
CustomAlertDialog
{
public
EnvFixDialog
(
@NonNull
Activity
activity
)
{
public
EnvFixDialog
(
@NonNull
Activity
activity
)
{
...
@@ -42,7 +38,7 @@ public class EnvFixDialog extends CustomAlertDialog {
...
@@ -42,7 +38,7 @@ public class EnvFixDialog extends CustomAlertDialog {
pd
.
dismiss
();
pd
.
dismiss
();
Utils
.
toast
(
success
?
R
.
string
.
reboot_delay_toast
:
R
.
string
.
setup_fail
,
Toast
.
LENGTH_LONG
);
Utils
.
toast
(
success
?
R
.
string
.
reboot_delay_toast
:
R
.
string
.
setup_fail
,
Toast
.
LENGTH_LONG
);
if
(
success
)
if
(
success
)
UiThreadHandler
.
handler
.
postDelayed
(
Utils:
:
reboot
,
5000
);
UiThreadHandler
.
handler
.
postDelayed
(
Root
Utils:
:
reboot
,
5000
);
}
}
}.
exec
();
}.
exec
();
});
});
...
...
app/src/main/java/com/topjohnwu/magisk/fragments/ModulesFragment.java
View file @
b72004e9
...
@@ -25,6 +25,7 @@ import com.topjohnwu.magisk.adapters.ModulesAdapter;
...
@@ -25,6 +25,7 @@ import com.topjohnwu.magisk.adapters.ModulesAdapter;
import
com.topjohnwu.magisk.components.BaseFragment
;
import
com.topjohnwu.magisk.components.BaseFragment
;
import
com.topjohnwu.magisk.container.Module
;
import
com.topjohnwu.magisk.container.Module
;
import
com.topjohnwu.magisk.utils.Event
;
import
com.topjohnwu.magisk.utils.Event
;
import
com.topjohnwu.magisk.utils.RootUtils
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.superuser.Shell
;
import
com.topjohnwu.superuser.Shell
;
...
@@ -110,7 +111,7 @@ public class ModulesFragment extends BaseFragment {
...
@@ -110,7 +111,7 @@ public class ModulesFragment extends BaseFragment {
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
switch
(
item
.
getItemId
())
{
switch
(
item
.
getItemId
())
{
case
R
.
id
.
reboot
:
case
R
.
id
.
reboot
:
Utils
.
reboot
();
Root
Utils
.
reboot
();
return
true
;
return
true
;
case
R
.
id
.
reboot_recovery
:
case
R
.
id
.
reboot_recovery
:
Shell
.
su
(
"/system/bin/reboot recovery"
).
submit
();
Shell
.
su
(
"/system/bin/reboot recovery"
).
submit
();
...
...
app/src/main/java/com/topjohnwu/magisk/utils/RootUtils.java
View file @
b72004e9
...
@@ -20,6 +20,10 @@ public class RootUtils extends Shell.Initializer {
...
@@ -20,6 +20,10 @@ public class RootUtils extends Shell.Initializer {
Shell
.
su
(
Utils
.
fmt
(
"(rm_launch %s %s)&"
,
rm
,
component
.
flattenToString
())).
exec
();
Shell
.
su
(
Utils
.
fmt
(
"(rm_launch %s %s)&"
,
rm
,
component
.
flattenToString
())).
exec
();
}
}
public
static
void
reboot
()
{
Shell
.
su
(
"/system/bin/reboot"
+
(
Config
.
recovery
?
" recovery"
:
""
)).
submit
();
}
@Override
@Override
public
boolean
onInit
(
Context
context
,
@NonNull
Shell
shell
)
{
public
boolean
onInit
(
Context
context
,
@NonNull
Shell
shell
)
{
Shell
.
Job
job
=
shell
.
newJob
();
Shell
.
Job
job
=
shell
.
newJob
();
...
...
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
View file @
b72004e9
...
@@ -27,7 +27,6 @@ import com.topjohnwu.magisk.R;
...
@@ -27,7 +27,6 @@ import com.topjohnwu.magisk.R;
import
com.topjohnwu.magisk.components.UpdateCheckService
;
import
com.topjohnwu.magisk.components.UpdateCheckService
;
import
com.topjohnwu.magisk.container.Module
;
import
com.topjohnwu.magisk.container.Module
;
import
com.topjohnwu.magisk.container.ValueSortedMap
;
import
com.topjohnwu.magisk.container.ValueSortedMap
;
import
com.topjohnwu.magisk.tasks.CheckUpdates
;
import
com.topjohnwu.net.Networking
;
import
com.topjohnwu.net.Networking
;
import
com.topjohnwu.superuser.Shell
;
import
com.topjohnwu.superuser.Shell
;
import
com.topjohnwu.superuser.internal.UiThreadHandler
;
import
com.topjohnwu.superuser.internal.UiThreadHandler
;
...
@@ -136,10 +135,6 @@ public class Utils {
...
@@ -136,10 +135,6 @@ public class Utils {
Config
.
Value
.
MULTIUSER_MODE_OWNER_MANAGED
);
Config
.
Value
.
MULTIUSER_MODE_OWNER_MANAGED
);
}
}
public
static
void
reboot
()
{
Shell
.
su
(
"/system/bin/reboot"
+
(
Config
.
recovery
?
" recovery"
:
""
)).
submit
();
}
public
static
boolean
isCanary
()
{
public
static
boolean
isCanary
()
{
return
BuildConfig
.
VERSION_NAME
.
contains
(
"-"
);
return
BuildConfig
.
VERSION_NAME
.
contains
(
"-"
);
}
}
...
...
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