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
9fbe5895
Commit
9fbe5895
authored
Feb 02, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Intent rather than global variable
parent
6bbe0f07
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
4 deletions
+3
-4
App.java
app-core/src/main/java/com/topjohnwu/magisk/App.java
+0
-1
Const.java
app-core/src/main/java/com/topjohnwu/magisk/Const.java
+1
-0
MainActivity.java
app/src/full/java/com/topjohnwu/magisk/MainActivity.java
+1
-1
SplashActivity.java
app/src/full/java/com/topjohnwu/magisk/SplashActivity.java
+1
-2
No files found.
app-core/src/main/java/com/topjohnwu/magisk/App.java
View file @
9fbe5895
...
@@ -20,7 +20,6 @@ import java.util.concurrent.ThreadPoolExecutor;
...
@@ -20,7 +20,6 @@ import java.util.concurrent.ThreadPoolExecutor;
public
class
App
extends
ContainerApp
{
public
class
App
extends
ContainerApp
{
public
static
App
self
;
public
static
App
self
;
public
boolean
init
=
false
;
public
static
ThreadPoolExecutor
THREAD_POOL
;
public
static
ThreadPoolExecutor
THREAD_POOL
;
// Global resources
// Global resources
...
...
app-core/src/main/java/com/topjohnwu/magisk/Const.java
View file @
9fbe5895
...
@@ -84,6 +84,7 @@ public class Const {
...
@@ -84,6 +84,7 @@ 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/full/java/com/topjohnwu/magisk/MainActivity.java
View file @
9fbe5895
...
@@ -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
(!
app
.
init
)
{
if
(!
getIntent
().
getBooleanExtra
(
Const
.
Key
.
FROM_SPLASH
,
false
)
)
{
startActivity
(
new
Intent
(
this
,
ClassMap
.
get
(
SplashActivity
.
class
)));
startActivity
(
new
Intent
(
this
,
ClassMap
.
get
(
SplashActivity
.
class
)));
finish
();
finish
();
}
}
...
...
app/src/full/java/com/topjohnwu/magisk/SplashActivity.java
View file @
9fbe5895
...
@@ -58,10 +58,9 @@ public class SplashActivity extends BaseActivity {
...
@@ -58,10 +58,9 @@ public class SplashActivity extends BaseActivity {
new
UpdateRepos
().
exec
();
new
UpdateRepos
().
exec
();
}
}
app
.
init
=
true
;
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
);
intent
.
putExtra
(
BaseActivity
.
INTENT_PERM
,
getIntent
().
getStringExtra
(
BaseActivity
.
INTENT_PERM
));
intent
.
putExtra
(
BaseActivity
.
INTENT_PERM
,
getIntent
().
getStringExtra
(
BaseActivity
.
INTENT_PERM
));
startActivity
(
intent
);
startActivity
(
intent
);
finish
();
finish
();
...
...
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