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
b05b6882
Commit
b05b6882
authored
Oct 12, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issues in stub APK
parent
f3d7f850
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
28 deletions
+14
-28
AndroidManifest.xml
stub/src/main/AndroidManifest.xml
+1
-6
BootLauncher.java
stub/src/main/java/com/topjohnwu/magisk/BootLauncher.java
+0
-16
MainActivity.java
stub/src/main/java/com/topjohnwu/magisk/MainActivity.java
+13
-6
No files found.
stub/src/main/AndroidManifest.xml
View file @
b05b6882
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
package=
"com.topjohnwu.magisk"
>
package=
"com.topjohnwu.magisk"
>
<uses-permission
android:name=
"android.permission.RECEIVE_BOOT_COMPLETED"
/>
<uses-permission
android:name=
"android.permission.RECEIVE_BOOT_COMPLETED"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<application
tools:ignore=
"GoogleAppIndexingWarning"
<application
tools:ignore=
"GoogleAppIndexingWarning"
android:allowBackup=
"true"
>
android:allowBackup=
"true"
>
...
@@ -16,11 +17,5 @@
...
@@ -16,11 +17,5 @@
</intent-filter>
</intent-filter>
</activity>
</activity>
<receiver
android:name=
".BootLauncher"
>
<intent-filter>
<action
android:name=
"android.intent.action.BOOT_COMPLETED"
/>
</intent-filter>
</receiver>
</application>
</application>
</manifest>
</manifest>
stub/src/main/java/com/topjohnwu/magisk/BootLauncher.java
deleted
100644 → 0
View file @
f3d7f850
package
com
.
topjohnwu
.
magisk
;
import
android.content.BroadcastReceiver
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.text.TextUtils
;
public
class
BootLauncher
extends
BroadcastReceiver
{
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
if
(
TextUtils
.
equals
(
intent
.
getAction
(),
Intent
.
ACTION_BOOT_COMPLETED
))
{
Intent
i
=
new
Intent
(
context
,
MainActivity
.
class
).
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
context
.
startActivity
(
i
);
}
}
}
stub/src/main/java/com/topjohnwu/magisk/MainActivity.java
View file @
b05b6882
...
@@ -4,6 +4,7 @@ import android.app.Activity;
...
@@ -4,6 +4,7 @@ import android.app.Activity;
import
android.app.AlertDialog
;
import
android.app.AlertDialog
;
import
android.app.Application
;
import
android.app.Application
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.util.Log
;
import
com.topjohnwu.magisk.utils.APKInstall
;
import
com.topjohnwu.magisk.utils.APKInstall
;
import
com.topjohnwu.magisk.net.Networking
;
import
com.topjohnwu.magisk.net.Networking
;
...
@@ -16,16 +17,19 @@ import java.io.File;
...
@@ -16,16 +17,19 @@ import java.io.File;
public
class
MainActivity
extends
Activity
{
public
class
MainActivity
extends
Activity
{
private
static
final
String
TAG
=
"MMStub"
;
private
static
final
boolean
IS_CANARY
=
BuildConfig
.
VERSION_NAME
.
contains
(
"-"
);
private
static
final
String
URL
=
private
static
final
String
URL
=
"https://raw.githubusercontent.com/topjohnwu/magisk_files/
master/
"
+
"https://raw.githubusercontent.com/topjohnwu/magisk_files/"
+
(
BuildConfig
.
VERSION_NAME
.
contains
(
"-"
)
?
"canary_builds/release.json"
:
"
stable.json"
);
(
IS_CANARY
?
"canary/release.json"
:
"master/
stable.json"
);
private
String
apkLink
;
private
String
apkLink
;
private
void
dlAPK
()
{
private
void
dlAPK
()
{
Application
app
=
getApplication
();
Application
app
=
getApplication
();
Networking
.
get
(
apkLink
)
Networking
.
get
(
apkLink
)
.
getAsFile
(
new
File
(
getFilesDir
(),
"manager.apk"
),
apk
->
APKInstall
.
install
(
app
,
apk
));
.
getAsFile
(
new
File
(
getFilesDir
(),
"manager.apk"
),
apk
->
APKInstall
.
install
(
app
,
apk
));
finish
();
finish
();
}
}
...
@@ -35,10 +39,13 @@ public class MainActivity extends Activity {
...
@@ -35,10 +39,13 @@ public class MainActivity extends Activity {
Networking
.
init
(
this
);
Networking
.
init
(
this
);
if
(
Networking
.
checkNetworkStatus
(
this
))
{
if
(
Networking
.
checkNetworkStatus
(
this
))
{
Networking
.
get
(
URL
)
Networking
.
get
(
URL
)
.
setErrorHandler
(((
conn
,
e
)
->
finish
()))
.
setErrorHandler
(((
conn
,
e
)
->
{
Log
.
d
(
TAG
,
"network error"
,
e
);
finish
();
}))
.
getAsJSONObject
(
new
JSONLoader
());
.
getAsJSONObject
(
new
JSONLoader
());
}
else
{
}
else
{
new
AlertDialog
.
Builder
(
this
,
AlertDialog
.
THEME_DEVICE_DEFAULT_LIGHT
)
new
AlertDialog
.
Builder
(
this
)
.
setCancelable
(
false
)
.
setCancelable
(
false
)
.
setTitle
(
R
.
string
.
app_name
)
.
setTitle
(
R
.
string
.
app_name
)
.
setMessage
(
R
.
string
.
no_internet_msg
)
.
setMessage
(
R
.
string
.
no_internet_msg
)
...
@@ -54,7 +61,7 @@ public class MainActivity extends Activity {
...
@@ -54,7 +61,7 @@ public class MainActivity extends Activity {
try
{
try
{
JSONObject
manager
=
json
.
getJSONObject
(
"app"
);
JSONObject
manager
=
json
.
getJSONObject
(
"app"
);
apkLink
=
manager
.
getString
(
"link"
);
apkLink
=
manager
.
getString
(
"link"
);
new
AlertDialog
.
Builder
(
MainActivity
.
this
,
AlertDialog
.
THEME_DEVICE_DEFAULT_LIGHT
)
new
AlertDialog
.
Builder
(
MainActivity
.
this
)
.
setCancelable
(
false
)
.
setCancelable
(
false
)
.
setTitle
(
R
.
string
.
app_name
)
.
setTitle
(
R
.
string
.
app_name
)
.
setMessage
(
R
.
string
.
upgrade_msg
)
.
setMessage
(
R
.
string
.
upgrade_msg
)
...
...
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