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
a54eaf53
Commit
a54eaf53
authored
Dec 08, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hardcode snet extension URL and version
parent
8032bd4b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
8 deletions
+5
-8
Const.java
app/src/full/java/com/topjohnwu/magisk/Const.java
+2
-0
Data.java
app/src/full/java/com/topjohnwu/magisk/Data.java
+0
-2
CheckSafetyNet.java
...full/java/com/topjohnwu/magisk/asyncs/CheckSafetyNet.java
+3
-2
CheckUpdates.java
...c/full/java/com/topjohnwu/magisk/asyncs/CheckUpdates.java
+0
-4
No files found.
app/src/full/java/com/topjohnwu/magisk/Const.java
View file @
a54eaf53
...
...
@@ -36,6 +36,7 @@ public class Const {
// Versions
public
static
final
int
UPDATE_SERVICE_VER
=
1
;
public
static
final
int
MIN_MODULE_VER
=
1500
;
public
static
final
int
SNET_EXT_VER
=
12
;
/* A list of apps that should not be shown as hide-able */
public
static
final
List
<
String
>
HIDE_BLACKLIST
=
Arrays
.
asList
(
...
...
@@ -79,6 +80,7 @@ public class Const {
public
static
final
String
TWITTER_URL
=
"https://twitter.com/topjohnwu"
;
public
static
final
String
XDA_THREAD
=
"http://forum.xda-developers.com/showthread.php?t=3432382"
;
public
static
final
String
SOURCE_CODE_URL
=
"https://github.com/topjohnwu/Magisk"
;
public
static
final
String
SNET_URL
=
"https://raw.githubusercontent.com/topjohnwu/magisk_files/b66b1a914978e5f4c4bbfd74a59f4ad371bac107/snet.apk"
;
}
...
...
app/src/full/java/com/topjohnwu/magisk/Data.java
View file @
a54eaf53
...
...
@@ -47,8 +47,6 @@ public class Data {
public
static
String
managerLink
;
public
static
String
managerNoteLink
;
public
static
String
uninstallerLink
;
public
static
int
snetVersionCode
;
public
static
String
snetLink
;
// Install flags
public
static
boolean
keepVerity
=
false
;
...
...
app/src/full/java/com/topjohnwu/magisk/asyncs/CheckSafetyNet.java
View file @
a54eaf53
...
...
@@ -2,6 +2,7 @@ package com.topjohnwu.magisk.asyncs;
import
android.app.Activity
;
import
com.topjohnwu.magisk.Const
;
import
com.topjohnwu.magisk.Data
;
import
com.topjohnwu.magisk.utils.ISafetyNetHelper
;
import
com.topjohnwu.magisk.utils.Topic
;
...
...
@@ -32,7 +33,7 @@ public class CheckSafetyNet extends ParallelTask<Void, Void, Void> {
private
void
dlSnet
()
throws
Exception
{
Shell
.
sh
(
"rm -rf "
+
dexPath
.
getParent
()).
exec
();
dexPath
.
getParentFile
().
mkdir
();
HttpURLConnection
conn
=
WebService
.
mustRequest
(
Data
.
snetLink
);
HttpURLConnection
conn
=
WebService
.
mustRequest
(
Const
.
Url
.
SNET_URL
);
try
(
OutputStream
out
=
new
BufferedOutputStream
(
new
FileOutputStream
(
dexPath
));
InputStream
in
=
new
BufferedInputStream
(
conn
.
getInputStream
()))
{
...
...
@@ -51,7 +52,7 @@ public class CheckSafetyNet extends ParallelTask<Void, Void, Void> {
.
invoke
(
null
,
ISafetyNetHelper
.
class
,
dexPath
.
getPath
(),
getActivity
(),
(
ISafetyNetHelper
.
Callback
)
code
->
Topic
.
publish
(
false
,
Topic
.
SNET_CHECK_DONE
,
code
));
if
(
helper
.
getVersion
()
<
Data
.
snetVersionCode
)
{
if
(
helper
.
getVersion
()
<
Const
.
SNET_EXT_VER
)
{
throw
new
Exception
();
}
}
...
...
app/src/full/java/com/topjohnwu/magisk/asyncs/CheckUpdates.java
View file @
a54eaf53
...
...
@@ -90,10 +90,6 @@ public class CheckUpdates {
JSONObject
uninstaller
=
getJson
(
json
,
"uninstaller"
);
Data
.
uninstallerLink
=
getString
(
uninstaller
,
"link"
,
null
);
JSONObject
snet
=
getJson
(
json
,
"snet"
);
Data
.
snetVersionCode
=
getInt
(
snet
,
"versionCode"
,
-
1
);
Data
.
snetLink
=
getString
(
snet
,
"link"
,
null
);
if
(
cb
!=
null
)
{
if
(
BuildConfig
.
VERSION_CODE
<
Data
.
remoteManagerVersionCode
)
{
Notifications
.
managerUpdate
();
...
...
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