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
48879df2
Commit
48879df2
authored
Apr 10, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some cleanups
parent
b067a5bb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
13 deletions
+6
-13
App.java
app/src/main/java/com/topjohnwu/magisk/App.java
+2
-0
Const.java
app/src/main/java/com/topjohnwu/magisk/Const.java
+0
-1
MainActivity.java
app/src/main/java/com/topjohnwu/magisk/MainActivity.java
+1
-1
SplashActivity.java
app/src/main/java/com/topjohnwu/magisk/SplashActivity.java
+3
-2
BaseActivity.java
...in/java/com/topjohnwu/magisk/components/BaseActivity.java
+0
-9
No files found.
app/src/main/java/com/topjohnwu/magisk/App.java
View file @
48879df2
...
@@ -12,6 +12,7 @@ import android.preference.PreferenceManager;
...
@@ -12,6 +12,7 @@ import android.preference.PreferenceManager;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.appcompat.app.AppCompatDelegate
;
import
com.topjohnwu.magisk.components.BaseActivity
;
import
com.topjohnwu.magisk.components.BaseActivity
;
import
com.topjohnwu.magisk.database.MagiskDB
;
import
com.topjohnwu.magisk.database.MagiskDB
;
...
@@ -36,6 +37,7 @@ public class App extends Application implements Application.ActivityLifecycleCal
...
@@ -36,6 +37,7 @@ public class App extends Application implements Application.ActivityLifecycleCal
private
volatile
BaseActivity
foreground
;
private
volatile
BaseActivity
foreground
;
static
{
static
{
AppCompatDelegate
.
setCompatVectorFromResourcesEnabled
(
true
);
Shell
.
Config
.
setFlags
(
Shell
.
FLAG_MOUNT_MASTER
|
Shell
.
FLAG_USE_MAGISK_BUSYBOX
);
Shell
.
Config
.
setFlags
(
Shell
.
FLAG_MOUNT_MASTER
|
Shell
.
FLAG_USE_MAGISK_BUSYBOX
);
Shell
.
Config
.
verboseLogging
(
BuildConfig
.
DEBUG
);
Shell
.
Config
.
verboseLogging
(
BuildConfig
.
DEBUG
);
Shell
.
Config
.
addInitializers
(
RootUtils
.
class
);
Shell
.
Config
.
addInitializers
(
RootUtils
.
class
);
...
...
app/src/main/java/com/topjohnwu/magisk/Const.java
View file @
48879df2
...
@@ -79,7 +79,6 @@ public class Const {
...
@@ -79,7 +79,6 @@ public class Const {
public
static
final
String
LINK_KEY
=
"Link"
;
public
static
final
String
LINK_KEY
=
"Link"
;
public
static
final
String
IF_NONE_MATCH
=
"If-None-Match"
;
public
static
final
String
IF_NONE_MATCH
=
"If-None-Match"
;
// intents
// intents
public
static
final
String
FROM_SPLASH
=
"splash"
;
public
static
final
String
OPEN_SECTION
=
"section"
;
public
static
final
String
OPEN_SECTION
=
"section"
;
public
static
final
String
INTENT_SET_NAME
=
"filename"
;
public
static
final
String
INTENT_SET_NAME
=
"filename"
;
public
static
final
String
INTENT_SET_LINK
=
"link"
;
public
static
final
String
INTENT_SET_LINK
=
"link"
;
...
...
app/src/main/java/com/topjohnwu/magisk/MainActivity.java
View file @
48879df2
...
@@ -50,7 +50,7 @@ public class MainActivity extends BaseActivity
...
@@ -50,7 +50,7 @@ public class MainActivity extends BaseActivity
@Override
@Override
protected
void
onCreate
(
final
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
final
Bundle
savedInstanceState
)
{
if
(!
getIntent
().
getBooleanExtra
(
Const
.
Key
.
FROM_SPLASH
,
false
)
)
{
if
(!
SplashActivity
.
DONE
)
{
startActivity
(
new
Intent
(
this
,
ClassMap
.
get
(
SplashActivity
.
class
)));
startActivity
(
new
Intent
(
this
,
ClassMap
.
get
(
SplashActivity
.
class
)));
finish
();
finish
();
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/SplashActivity.java
View file @
48879df2
...
@@ -20,6 +20,8 @@ import com.topjohnwu.superuser.Shell;
...
@@ -20,6 +20,8 @@ import com.topjohnwu.superuser.Shell;
public
class
SplashActivity
extends
BaseActivity
{
public
class
SplashActivity
extends
BaseActivity
{
public
static
boolean
DONE
=
false
;
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
...
@@ -83,8 +85,7 @@ public class SplashActivity extends BaseActivity {
...
@@ -83,8 +85,7 @@ public class SplashActivity extends BaseActivity {
Intent
intent
=
new
Intent
(
this
,
ClassMap
.
get
(
MainActivity
.
class
));
Intent
intent
=
new
Intent
(
this
,
ClassMap
.
get
(
MainActivity
.
class
));
intent
.
putExtra
(
Const
.
Key
.
OPEN_SECTION
,
getIntent
().
getStringExtra
(
Const
.
Key
.
OPEN_SECTION
));
intent
.
putExtra
(
Const
.
Key
.
OPEN_SECTION
,
getIntent
().
getStringExtra
(
Const
.
Key
.
OPEN_SECTION
));
intent
.
putExtra
(
Const
.
Key
.
FROM_SPLASH
,
true
);
DONE
=
true
;
intent
.
putExtra
(
BaseActivity
.
INTENT_PERM
,
getIntent
().
getStringExtra
(
BaseActivity
.
INTENT_PERM
));
startActivity
(
intent
);
startActivity
(
intent
);
finish
();
finish
();
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/components/BaseActivity.java
View file @
48879df2
...
@@ -14,7 +14,6 @@ import androidx.annotation.NonNull;
...
@@ -14,7 +14,6 @@ import androidx.annotation.NonNull;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.StyleRes
;
import
androidx.annotation.StyleRes
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatDelegate
;
import
androidx.collection.SparseArrayCompat
;
import
androidx.collection.SparseArrayCompat
;
import
androidx.core.app.ActivityCompat
;
import
androidx.core.app.ActivityCompat
;
import
androidx.core.content.ContextCompat
;
import
androidx.core.content.ContextCompat
;
...
@@ -28,7 +27,6 @@ import com.topjohnwu.magisk.utils.LocaleManager;
...
@@ -28,7 +27,6 @@ import com.topjohnwu.magisk.utils.LocaleManager;
public
abstract
class
BaseActivity
extends
AppCompatActivity
implements
Event
.
AutoListener
{
public
abstract
class
BaseActivity
extends
AppCompatActivity
implements
Event
.
AutoListener
{
public
static
final
String
INTENT_PERM
=
"perm_dialog"
;
private
static
Runnable
grantCallback
;
private
static
Runnable
grantCallback
;
static
int
[]
EMPTY_INT_ARRAY
=
new
int
[
0
];
static
int
[]
EMPTY_INT_ARRAY
=
new
int
[
0
];
...
@@ -36,10 +34,6 @@ public abstract class BaseActivity extends AppCompatActivity implements Event.Au
...
@@ -36,10 +34,6 @@ public abstract class BaseActivity extends AppCompatActivity implements Event.Au
private
SparseArrayCompat
<
ActivityResultListener
>
resultListeners
=
new
SparseArrayCompat
<>();
private
SparseArrayCompat
<
ActivityResultListener
>
resultListeners
=
new
SparseArrayCompat
<>();
public
App
app
=
App
.
self
;
public
App
app
=
App
.
self
;
static
{
AppCompatDelegate
.
setCompatVectorFromResourcesEnabled
(
true
);
}
@Override
@Override
public
int
[]
getListeningEvents
()
{
public
int
[]
getListeningEvents
()
{
return
EMPTY_INT_ARRAY
;
return
EMPTY_INT_ARRAY
;
...
@@ -65,9 +59,6 @@ public abstract class BaseActivity extends AppCompatActivity implements Event.Au
...
@@ -65,9 +59,6 @@ public abstract class BaseActivity extends AppCompatActivity implements Event.Au
setTheme
(
getDarkTheme
());
setTheme
(
getDarkTheme
());
}
}
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
String
[]
perms
=
getIntent
().
getStringArrayExtra
(
INTENT_PERM
);
if
(
perms
!=
null
)
ActivityCompat
.
requestPermissions
(
this
,
perms
,
0
);
}
}
@Override
@Override
...
...
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