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
442fcf92
Commit
442fcf92
authored
Jan 06, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change SafetyNet check to manual start
parent
fb0923f3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
22 deletions
+44
-22
MagiskHideFragment.java
...rc/main/java/com/topjohnwu/magisk/MagiskHideFragment.java
+0
-3
SplashActivity.java
app/src/main/java/com/topjohnwu/magisk/SplashActivity.java
+0
-1
StatusFragment.java
app/src/main/java/com/topjohnwu/magisk/StatusFragment.java
+27
-13
ApplicationAdapter.java
...ava/com/topjohnwu/magisk/adapters/ApplicationAdapter.java
+0
-1
ic_safetynet.xml
app/src/main/res/drawable/ic_safetynet.xml
+9
-0
status_fragment.xml
app/src/main/res/layout/status_fragment.xml
+7
-4
strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/MagiskHideFragment.java
View file @
442fcf92
...
@@ -19,12 +19,9 @@ import com.topjohnwu.magisk.adapters.ApplicationAdapter;
...
@@ -19,12 +19,9 @@ import com.topjohnwu.magisk.adapters.ApplicationAdapter;
import
com.topjohnwu.magisk.utils.Async
;
import
com.topjohnwu.magisk.utils.Async
;
import
com.topjohnwu.magisk.utils.CallbackHandler
;
import
com.topjohnwu.magisk.utils.CallbackHandler
;
import
com.topjohnwu.magisk.utils.Logger
;
import
com.topjohnwu.magisk.utils.Logger
;
import
com.topjohnwu.magisk.utils.Shell
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
import
butterknife.BindView
;
import
butterknife.BindView
;
...
...
app/src/main/java/com/topjohnwu/magisk/SplashActivity.java
View file @
442fcf92
...
@@ -34,7 +34,6 @@ public class SplashActivity extends AppCompatActivity {
...
@@ -34,7 +34,6 @@ public class SplashActivity extends AppCompatActivity {
// Start all async tasks
// Start all async tasks
new
Async
.
GetBootBlocks
().
exec
();
new
Async
.
GetBootBlocks
().
exec
();
new
Async
.
CheckUpdates
().
exec
();
new
Async
.
CheckUpdates
().
exec
();
Async
.
checkSafetyNet
(
getApplicationContext
());
new
Async
.
LoadModules
()
{
new
Async
.
LoadModules
()
{
@Override
@Override
protected
void
onPostExecute
(
Void
v
)
{
protected
void
onPostExecute
(
Void
v
)
{
...
...
app/src/main/java/com/topjohnwu/magisk/StatusFragment.java
View file @
442fcf92
...
@@ -56,6 +56,7 @@ public class StatusFragment extends Fragment implements CallbackHandler.EventLis
...
@@ -56,6 +56,7 @@ public class StatusFragment extends Fragment implements CallbackHandler.EventLis
@BindColor
(
R
.
color
.
grey500
)
int
colorNeutral
;
@BindColor
(
R
.
color
.
grey500
)
int
colorNeutral
;
@BindColor
(
R
.
color
.
blue500
)
int
colorInfo
;
@BindColor
(
R
.
color
.
blue500
)
int
colorInfo
;
@BindColor
(
android
.
R
.
color
.
transparent
)
int
trans
;
@BindColor
(
android
.
R
.
color
.
transparent
)
int
trans
;
int
defaultColor
;
static
{
static
{
checkMagiskInfo
();
checkMagiskInfo
();
...
@@ -67,29 +68,36 @@ public class StatusFragment extends Fragment implements CallbackHandler.EventLis
...
@@ -67,29 +68,36 @@ public class StatusFragment extends Fragment implements CallbackHandler.EventLis
View
v
=
inflater
.
inflate
(
R
.
layout
.
status_fragment
,
container
,
false
);
View
v
=
inflater
.
inflate
(
R
.
layout
.
status_fragment
,
container
,
false
);
ButterKnife
.
bind
(
this
,
v
);
ButterKnife
.
bind
(
this
,
v
);
defaultColor
=
magiskUpdateText
.
getCurrentTextColor
();
mSwipeRefreshLayout
.
setOnRefreshListener
(()
->
{
mSwipeRefreshLayout
.
setOnRefreshListener
(()
->
{
magiskStatusContainer
.
setBackgroundColor
(
trans
);
magiskStatusContainer
.
setBackgroundColor
(
trans
);
magiskStatusIcon
.
setImageResource
(
0
);
magiskStatusIcon
.
setImageResource
(
0
);
magiskUpdateText
.
setText
(
R
.
string
.
checking_for_updates
);
magiskUpdateText
.
setText
(
R
.
string
.
checking_for_updates
);
magiskCheckUpdatesProgress
.
setVisibility
(
View
.
VISIBLE
);
magiskCheckUpdatesProgress
.
setVisibility
(
View
.
VISIBLE
);
magiskUpdateText
.
setTextColor
(
defaultColor
);
safetyNetProgress
.
setVisibility
(
View
.
VISIBLE
);
safetyNetProgress
.
setVisibility
(
View
.
GONE
);
safetyNetContainer
.
setBackgroundColor
(
trans
);
safetyNetContainer
.
setBackgroundColor
(
colorNeutral
);
safetyNetIcon
.
setImageResource
(
0
);
safetyNetIcon
.
setImageResource
(
R
.
drawable
.
ic_safetynet
);
safetyNetStatusText
.
setText
(
R
.
string
.
checking_safetyNet_status
);
safetyNetStatusText
.
setText
(
R
.
string
.
safetyNet_check_text
);
safetyNetStatusText
.
setTextColor
(
defaultColor
);
safetyNetDone
.
isTriggered
=
false
;
updateUI
();
updateUI
();
new
Async
.
CheckUpdates
().
exec
();
new
Async
.
CheckUpdates
().
exec
();
Async
.
checkSafetyNet
(
getActivity
());
});
});
updateUI
();
updateUI
();
if
(
updateCheckDone
.
isTriggered
)
{
updateCheckUI
();
safetyNetContainer
.
setOnClickListener
(
view
->
{
}
safetyNetProgress
.
setVisibility
(
View
.
VISIBLE
);
if
(
safetyNetDone
.
isTriggered
)
{
safetyNetContainer
.
setBackgroundColor
(
trans
);
updateSafetyNetUI
();
safetyNetIcon
.
setImageResource
(
0
);
}
safetyNetStatusText
.
setText
(
R
.
string
.
checking_safetyNet_status
);
Async
.
checkSafetyNet
(
getActivity
());
});
if
(
magiskVersion
<
0
&&
Shell
.
rootAccess
())
{
if
(
magiskVersion
<
0
&&
Shell
.
rootAccess
())
{
MainActivity
.
alertBuilder
MainActivity
.
alertBuilder
...
@@ -127,12 +135,18 @@ public class StatusFragment extends Fragment implements CallbackHandler.EventLis
...
@@ -127,12 +135,18 @@ public class StatusFragment extends Fragment implements CallbackHandler.EventLis
super
.
onResume
();
super
.
onResume
();
CallbackHandler
.
register
(
updateCheckDone
,
this
);
CallbackHandler
.
register
(
updateCheckDone
,
this
);
CallbackHandler
.
register
(
safetyNetDone
,
this
);
CallbackHandler
.
register
(
safetyNetDone
,
this
);
if
(
updateCheckDone
.
isTriggered
)
{
updateCheckUI
();
}
if
(
safetyNetDone
.
isTriggered
)
{
updateSafetyNetUI
();
}
getActivity
().
setTitle
(
R
.
string
.
status
);
getActivity
().
setTitle
(
R
.
string
.
status
);
}
}
@Override
@Override
public
void
on
Destroy
()
{
public
void
on
Pause
()
{
super
.
on
Destroy
();
super
.
on
Pause
();
CallbackHandler
.
unRegister
(
updateCheckDone
,
this
);
CallbackHandler
.
unRegister
(
updateCheckDone
,
this
);
CallbackHandler
.
unRegister
(
safetyNetDone
,
this
);
CallbackHandler
.
unRegister
(
safetyNetDone
,
this
);
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java
View file @
442fcf92
...
@@ -16,7 +16,6 @@ import android.widget.TextView;
...
@@ -16,7 +16,6 @@ import android.widget.TextView;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.utils.Async
;
import
com.topjohnwu.magisk.utils.Async
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
butterknife.BindView
;
import
butterknife.BindView
;
...
...
app/src/main/res/drawable/ic_safetynet.xml
0 → 100644
View file @
442fcf92
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:fillColor=
"#fff"
android:pathData=
"M10,16h4c0.55,0 1,-0.45 1,-1v-3c0,-0.55 -0.45,-1 -1,-1v-1c0,-1.11 -0.9,-2 -2,-2 -1.11,0 -2,0.9 -2,2v1c-0.55,0 -1,0.45 -1,1v3c0,0.55 0.45,1 1,1zM10.8,10c0,-0.66 0.54,-1.2 1.2,-1.2 0.66,0 1.2,0.54 1.2,1.2v1h-2.4v-1zM17,1L7,1c-1.1,0 -2,0.9 -2,2v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2L19,3c0,-1.1 -0.9,-2 -2,-2zM17,19L7,19L7,5h10v14z"
/>
</vector>
app/src/main/res/layout/status_fragment.xml
View file @
442fcf92
...
@@ -157,19 +157,22 @@
...
@@ -157,19 +157,22 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"100dp"
android:layout_height=
"100dp"
android:foregroundGravity=
"center"
android:foregroundGravity=
"center"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
android:background=
"@color/grey500"
>
<ImageView
<ImageView
android:id=
"@+id/safetyNet_icon"
android:id=
"@+id/safetyNet_icon"
android:layout_width=
"84dp"
android:layout_width=
"84dp"
android:layout_height=
"84dp"
android:layout_height=
"84dp"
android:layout_gravity=
"center"
/>
android:layout_gravity=
"center"
android:src=
"@drawable/ic_safetynet"
/>
<ProgressBar
<ProgressBar
android:id=
"@+id/safetyNet_check_progress"
android:id=
"@+id/safetyNet_check_progress"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
/>
android:layout_gravity=
"center"
android:visibility=
"gone"
/>
</FrameLayout>
</FrameLayout>
...
@@ -181,7 +184,7 @@
...
@@ -181,7 +184,7 @@
android:gravity=
"center"
android:gravity=
"center"
android:padding=
"6dp"
android:padding=
"6dp"
android:textStyle=
"bold"
android:textStyle=
"bold"
android:text=
"@string/
checking_safetyNet_status
"
/>
android:text=
"@string/
safetyNet_check_text
"
/>
</LinearLayout>
</LinearLayout>
...
...
app/src/main/res/values/strings.xml
View file @
442fcf92
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
<string
name=
"root_error"
>
Rooted but no root permission, not allowed?
</string>
<string
name=
"root_error"
>
Rooted but no root permission, not allowed?
</string>
<string
name=
"not_rooted"
>
Not rooted
</string>
<string
name=
"not_rooted"
>
Not rooted
</string>
<string
name=
"proper_root"
>
Properly rooted
</string>
<string
name=
"proper_root"
>
Properly rooted
</string>
<string
name=
"safetyNet_check_text"
>
Tap to start SafetyNet check
</string>
<string
name=
"checking_safetyNet_status"
>
Checking SafetyNet status…
</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_failed"
>
Cannot connect to Google API
</string>
<string
name=
"safetyNet_connection_suspended"
>
Connection to Google API was suspended
</string>
<string
name=
"safetyNet_connection_suspended"
>
Connection to Google API was suspended
</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