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
e986332b
Commit
e986332b
authored
Oct 07, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Several small snet fixes
parent
48f9b273
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
MagiskFragment.java
app/src/main/java/com/topjohnwu/magisk/MagiskFragment.java
+0
-2
CheckSafetyNet.java
...main/java/com/topjohnwu/magisk/asyncs/CheckSafetyNet.java
+6
-2
SafetyNetHelper.java
snet/src/main/java/com/topjohnwu/snet/SafetyNetHelper.java
+2
-2
No files found.
app/src/main/java/com/topjohnwu/magisk/MagiskFragment.java
View file @
e986332b
...
@@ -96,8 +96,6 @@ public class MagiskFragment extends Fragment
...
@@ -96,8 +96,6 @@ public class MagiskFragment extends Fragment
@OnClick
(
R
.
id
.
safetyNet_title
)
@OnClick
(
R
.
id
.
safetyNet_title
)
void
safetyNet
()
{
void
safetyNet
()
{
Runnable
task
=
()
->
{
Runnable
task
=
()
->
{
mm
.
snet_version
=
CheckSafetyNet
.
SNET_VER
;
mm
.
prefs
.
edit
().
putInt
(
"snet_version"
,
CheckSafetyNet
.
SNET_VER
).
apply
();
safetyNetProgress
.
setVisibility
(
View
.
VISIBLE
);
safetyNetProgress
.
setVisibility
(
View
.
VISIBLE
);
safetyNetRefreshIcon
.
setVisibility
(
View
.
GONE
);
safetyNetRefreshIcon
.
setVisibility
(
View
.
GONE
);
safetyNetStatusText
.
setText
(
R
.
string
.
checking_safetyNet_status
);
safetyNetStatusText
.
setText
(
R
.
string
.
checking_safetyNet_status
);
...
...
app/src/main/java/com/topjohnwu/magisk/asyncs/CheckSafetyNet.java
View file @
e986332b
...
@@ -3,6 +3,7 @@ package com.topjohnwu.magisk.asyncs;
...
@@ -3,6 +3,7 @@ package com.topjohnwu.magisk.asyncs;
import
android.support.v4.app.FragmentActivity
;
import
android.support.v4.app.FragmentActivity
;
import
com.topjohnwu.jarsigner.ByteArrayStream
;
import
com.topjohnwu.jarsigner.ByteArrayStream
;
import
com.topjohnwu.magisk.MagiskManager
;
import
com.topjohnwu.magisk.utils.WebService
;
import
com.topjohnwu.magisk.utils.WebService
;
import
java.io.BufferedOutputStream
;
import
java.io.BufferedOutputStream
;
...
@@ -32,9 +33,12 @@ public class CheckSafetyNet extends ParallelTask<Void, Void, Exception> {
...
@@ -32,9 +33,12 @@ public class CheckSafetyNet extends ParallelTask<Void, Void, Exception> {
@Override
@Override
protected
void
onPreExecute
()
{
protected
void
onPreExecute
()
{
if
(
getMagiskManager
().
snet_version
<
CheckSafetyNet
.
SNET_VER
)
{
MagiskManager
mm
=
getMagiskManager
();
if
(
mm
.
snet_version
!=
CheckSafetyNet
.
SNET_VER
)
{
getShell
().
sh
(
"rm -rf "
+
dexPath
.
getParent
());
getShell
().
sh
(
"rm -rf "
+
dexPath
.
getParent
());
}
}
mm
.
snet_version
=
CheckSafetyNet
.
SNET_VER
;
mm
.
prefs
.
edit
().
putInt
(
"snet_version"
,
CheckSafetyNet
.
SNET_VER
).
apply
();
}
}
@Override
@Override
...
@@ -71,7 +75,7 @@ public class CheckSafetyNet extends ParallelTask<Void, Void, Exception> {
...
@@ -71,7 +75,7 @@ public class CheckSafetyNet extends ParallelTask<Void, Void, Exception> {
getMagiskManager
().
safetyNetDone
.
publish
(
false
,
args
[
0
]);
getMagiskManager
().
safetyNetDone
.
publish
(
false
,
args
[
0
]);
return
null
;
return
null
;
}));
}));
helperClazz
.
getMethod
(
"
requestT
est"
).
invoke
(
helper
);
helperClazz
.
getMethod
(
"
att
est"
).
invoke
(
helper
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
getMagiskManager
().
safetyNetDone
.
publish
(
false
,
-
1
);
getMagiskManager
().
safetyNetDone
.
publish
(
false
,
-
1
);
...
...
snet/src/main/java/com/topjohnwu/snet/SafetyNetHelper.java
View file @
e986332b
...
@@ -43,7 +43,7 @@ public class SafetyNetHelper
...
@@ -43,7 +43,7 @@ public class SafetyNetHelper
}
}
// Entry point to start test
// Entry point to start test
public
void
requestT
est
()
{
public
void
att
est
()
{
// Connect Google Service
// Connect Google Service
GoogleApiClient
.
Builder
builder
=
new
GoogleApiClient
.
Builder
(
mActivity
);
GoogleApiClient
.
Builder
builder
=
new
GoogleApiClient
.
Builder
(
mActivity
);
try
{
try
{
...
@@ -92,7 +92,7 @@ public class SafetyNetHelper
...
@@ -92,7 +92,7 @@ public class SafetyNetHelper
responseCode
|=
decoded
.
getBoolean
(
"ctsProfileMatch"
)
?
CTS_PASS
:
0
;
responseCode
|=
decoded
.
getBoolean
(
"ctsProfileMatch"
)
?
CTS_PASS
:
0
;
responseCode
|=
decoded
.
getBoolean
(
"basicIntegrity"
)
?
BASIC_PASS
:
0
;
responseCode
|=
decoded
.
getBoolean
(
"basicIntegrity"
)
?
BASIC_PASS
:
0
;
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
responseCode
|=
RESPONSE_ERR
;
cb
.
onResponse
(
RESPONSE_ERR
)
;
return
;
return
;
}
}
// Disconnect
// Disconnect
...
...
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