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
bb2467d2
Commit
bb2467d2
authored
Jan 03, 2017
by
Wang Han
Committed by
topjohnwu
Jan 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle Google API Connection Problems
parent
05c063b6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
StatusFragment.java
app/src/main/java/com/topjohnwu/magisk/StatusFragment.java
+10
-0
SafetyNetHelper.java
...main/java/com/topjohnwu/magisk/utils/SafetyNetHelper.java
+2
-0
strings.xml
app/src/main/res/values/strings.xml
+2
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/StatusFragment.java
View file @
bb2467d2
...
...
@@ -221,6 +221,16 @@ public class StatusFragment extends Fragment implements CallbackHandler.EventLis
int
image
,
color
;
safetyNetProgress
.
setVisibility
(
View
.
GONE
);
switch
(
SNCheckResult
)
{
case
-
3
:
color
=
colorNeutral
;
image
=
R
.
drawable
.
ic_help
;
safetyNetStatusText
.
setText
(
R
.
string
.
safetyNet_connection_suspended
);
break
;
case
-
2
:
color
=
colorNeutral
;
image
=
R
.
drawable
.
ic_help
;
safetyNetStatusText
.
setText
(
R
.
string
.
safetyNet_connection_failed
);
break
;
case
-
1
:
color
=
colorNeutral
;
image
=
R
.
drawable
.
ic_help
;
...
...
app/src/main/java/com/topjohnwu/magisk/utils/SafetyNetHelper.java
View file @
bb2467d2
...
...
@@ -32,6 +32,7 @@ public abstract class SafetyNetHelper
@Override
public
void
onConnectionFailed
(
@NonNull
ConnectionResult
result
)
{
Logger
.
dev
(
"SN: Google API fail"
);
handleResults
(-
2
);
}
@Override
...
...
@@ -43,6 +44,7 @@ public abstract class SafetyNetHelper
@Override
public
void
onConnectionSuspended
(
int
i
)
{
Logger
.
dev
(
"SN: Google API Suspended"
);
handleResults
(-
3
);
}
public
void
requestTest
()
{
...
...
app/src/main/res/values/strings.xml
View file @
bb2467d2
...
...
@@ -26,6 +26,8 @@
<string
name=
"not_rooted"
>
Not rooted
</string>
<string
name=
"proper_root"
>
Properly rooted
</string>
<string
name=
"checking_safetyNet_status"
>
Checking SafetyNet status…
</string>
<string
name=
"safetyNet_connection_failed"
>
Cannot connect to Google API
</string>
<string
name=
"safetyNet_connection_suspended"
>
Connection to Google API was suspended
</string>
<string
name=
"safetyNet_error"
>
Cannot check SafetyNet, no Internet?
</string>
<string
name=
"safetyNet_fail"
>
SafetyNet Failed: CTS profile mismatch
</string>
<string
name=
"safetyNet_pass"
>
SafetyNet Passed
</string>
...
...
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