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
3ae3d492
Commit
3ae3d492
authored
Nov 08, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small adjustments to UI
parent
36025d6d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
114 deletions
+28
-114
LogFragment.java
app/src/main/java/com/topjohnwu/magisk/LogFragment.java
+3
-6
MagiskFragment.java
app/src/main/java/com/topjohnwu/magisk/MagiskFragment.java
+3
-28
MagiskManager.java
app/src/main/java/com/topjohnwu/magisk/MagiskManager.java
+0
-7
MainActivity.java
app/src/main/java/com/topjohnwu/magisk/MainActivity.java
+1
-2
SettingsActivity.java
app/src/main/java/com/topjohnwu/magisk/SettingsActivity.java
+2
-7
fragment_magisk.xml
app/src/main/res/layout/fragment_magisk.xml
+19
-64
No files found.
app/src/main/java/com/topjohnwu/magisk/LogFragment.java
View file @
3ae3d492
...
...
@@ -33,13 +33,10 @@ public class LogFragment extends Fragment {
TabFragmentAdapter
adapter
=
new
TabFragmentAdapter
(
getChildFragmentManager
());
if
(
getApplication
().
isSuClient
)
{
adapter
.
addTab
(
new
SuLogFragment
(),
getString
(
R
.
string
.
superuser
));
tab
.
setupWithViewPager
(
viewPager
);
tab
.
setVisibility
(
View
.
VISIBLE
);
}
adapter
.
addTab
(
new
SuLogFragment
(),
getString
(
R
.
string
.
superuser
));
adapter
.
addTab
(
new
MagiskLogFragment
(),
getString
(
R
.
string
.
magisk
));
tab
.
setupWithViewPager
(
viewPager
);
tab
.
setVisibility
(
View
.
VISIBLE
);
viewPager
.
setAdapter
(
adapter
);
...
...
app/src/main/java/com/topjohnwu/magisk/MagiskFragment.java
View file @
3ae3d492
...
...
@@ -17,6 +17,7 @@ import android.widget.CheckBox;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.ProgressBar
;
import
android.widget.RelativeLayout
;
import
android.widget.Spinner
;
import
android.widget.TextView
;
...
...
@@ -59,15 +60,12 @@ public class MagiskFragment extends Fragment
@BindView
(
R
.
id
.
swipeRefreshLayout
)
SwipeRefreshLayout
mSwipeRefreshLayout
;
@BindView
(
R
.
id
.
magisk_update
_card
)
CardView
magiskUpdateCard
;
@BindView
(
R
.
id
.
magisk_update
)
RelativeLayout
magiskUpdate
;
@BindView
(
R
.
id
.
magisk_update_icon
)
ImageView
magiskUpdateIcon
;
@BindView
(
R
.
id
.
magisk_update_status
)
TextView
magiskUpdateText
;
@BindView
(
R
.
id
.
magisk_update_progress
)
ProgressBar
magiskUpdateProgress
;
@BindView
(
R
.
id
.
magisk_status_icon
)
ImageView
magiskStatusIcon
;
@BindView
(
R
.
id
.
magisk_version
)
TextView
magiskVersionText
;
@BindView
(
R
.
id
.
root_status_icon
)
ImageView
rootStatusIcon
;
@BindView
(
R
.
id
.
root_status
)
TextView
rootStatusText
;
@BindView
(
R
.
id
.
safetyNet_card
)
CardView
safetyNetCard
;
@BindView
(
R
.
id
.
safetyNet_refresh
)
ImageView
safetyNetRefreshIcon
;
...
...
@@ -235,7 +233,7 @@ public class MagiskFragment extends Fragment
boolean
hasRoot
=
Shell
.
rootAccess
();
boolean
isUpToDate
=
mm
.
magiskVersionCode
>
1300
;
magiskUpdate
Card
.
setVisibility
(
hasNetwork
?
View
.
VISIBLE
:
View
.
GONE
);
magiskUpdate
.
setVisibility
(
hasNetwork
?
View
.
VISIBLE
:
View
.
GONE
);
safetyNetCard
.
setVisibility
(
hasNetwork
?
View
.
VISIBLE
:
View
.
GONE
);
bootImageCard
.
setVisibility
(
hasNetwork
&&
hasRoot
?
View
.
VISIBLE
:
View
.
GONE
);
installOptionCard
.
setVisibility
(
hasNetwork
?
View
.
VISIBLE
:
View
.
GONE
);
...
...
@@ -256,29 +254,6 @@ public class MagiskFragment extends Fragment
magiskStatusIcon
.
setImageResource
(
image
);
magiskStatusIcon
.
setColorFilter
(
color
);
switch
(
Shell
.
status
)
{
case
0
:
color
=
colorBad
;
image
=
R
.
drawable
.
ic_cancel
;
rootStatusText
.
setText
(
R
.
string
.
not_rooted
);
break
;
case
1
:
if
(
mm
.
suVersion
!=
null
)
{
color
=
colorOK
;
image
=
R
.
drawable
.
ic_check_circle
;
rootStatusText
.
setText
(
mm
.
suVersion
);
break
;
}
case
-
1
:
default
:
color
=
colorNeutral
;
image
=
R
.
drawable
.
ic_help
;
rootStatusText
.
setText
(
R
.
string
.
root_error
);
}
rootStatusIcon
.
setImageResource
(
image
);
rootStatusIcon
.
setColorFilter
(
color
);
List
<
String
>
items
=
new
ArrayList
<>();
if
(
mm
.
bootBlock
!=
null
)
{
items
.
add
(
getString
(
R
.
string
.
auto_detect
,
mm
.
bootBlock
));
...
...
app/src/main/java/com/topjohnwu/magisk/MagiskManager.java
View file @
3ae3d492
...
...
@@ -49,8 +49,6 @@ public class MagiskManager extends Application {
public
int
remoteManagerVersionCode
=
-
1
;
public
String
managerLink
;
public
String
bootBlock
=
null
;
public
boolean
isSuClient
=
false
;
public
String
suVersion
=
null
;
public
boolean
disabled
;
public
int
snet_version
;
public
int
updateServiceVersion
;
...
...
@@ -166,11 +164,6 @@ public class MagiskManager extends Application {
public
void
loadMagiskInfo
()
{
List
<
String
>
ret
;
ret
=
Shell
.
sh
(
"su -v"
);
if
(
Utils
.
isValidShellResponse
(
ret
))
{
suVersion
=
ret
.
get
(
0
);
isSuClient
=
suVersion
.
toUpperCase
().
contains
(
"MAGISK"
);
}
ret
=
Shell
.
sh
(
"magisk -v"
);
if
(!
Utils
.
isValidShellResponse
(
ret
))
{
ret
=
Shell
.
sh
(
"getprop magisk.version"
);
...
...
app/src/main/java/com/topjohnwu/magisk/MainActivity.java
View file @
3ae3d492
...
...
@@ -138,8 +138,7 @@ public class MainActivity extends Activity
menu
.
findItem
(
R
.
id
.
downloads
).
setVisible
(
Utils
.
checkNetworkStatus
()
&&
Shell
.
rootAccess
()
&&
getMagiskManager
().
magiskVersionCode
>=
0
);
menu
.
findItem
(
R
.
id
.
log
).
setVisible
(
Shell
.
rootAccess
());
menu
.
findItem
(
R
.
id
.
superuser
).
setVisible
(
Shell
.
rootAccess
()
&&
getMagiskManager
().
isSuClient
);
menu
.
findItem
(
R
.
id
.
superuser
).
setVisible
(
Shell
.
rootAccess
());
}
public
void
navigate
(
String
item
)
{
...
...
app/src/main/java/com/topjohnwu/magisk/SettingsActivity.java
View file @
3ae3d492
...
...
@@ -138,13 +138,8 @@ public class SettingsActivity extends Activity implements Topic.Subscriber {
prefScreen
.
removePreference
(
magiskCategory
);
prefScreen
.
removePreference
(
suCategory
);
generalCatagory
.
removePreference
(
hideManager
);
}
else
{
if
(!
mm
.
isSuClient
)
{
prefScreen
.
removePreference
(
suCategory
);
}
if
(
mm
.
magiskVersionCode
<
1300
)
{
prefScreen
.
removePreference
(
magiskCategory
);
}
}
else
if
(
mm
.
magiskVersionCode
<
1300
)
{
prefScreen
.
removePreference
(
magiskCategory
);
}
}
...
...
app/src/main/res/layout/fragment_magisk.xml
View file @
3ae3d492
...
...
@@ -21,7 +21,6 @@
android:orientation=
"vertical"
>
<android.support.v7.widget.CardView
android:id=
"@+id/magisk_update_card"
style=
"?attr/cardStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
@@ -32,78 +31,35 @@
app:cardCornerRadius=
"@dimen/card_corner_radius"
app:cardElevation=
"@dimen/card_elevation"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<ImageView
android:id=
"@+id/magisk_update_icon"
android:layout_width=
"25dp"
android:layout_height=
"25dp"
android:layout_centerVertical=
"true"
android:layout_margin=
"15dp"
android:layout_toStartOf=
"@+id/magisk_update_status"
android:src=
"@drawable/ic_refresh"
android:visibility=
"gone"
/>
<ProgressBar
android:id=
"@+id/magisk_update_progress"
android:layout_width=
"25dp"
android:layout_height=
"25dp"
android:layout_centerVertical=
"true"
android:layout_margin=
"15dp"
android:layout_toStartOf=
"@+id/magisk_update_status"
/>
<TextView
android:id=
"@+id/magisk_update_status"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_centerVertical=
"true"
android:gravity=
"center"
android:minWidth=
"225dp"
android:padding=
"6dp"
android:text=
"@string/checking_for_updates"
android:textStyle=
"bold"
/>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
style=
"?attr/cardStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"4dp"
android:layout_marginEnd=
"5dp"
android:layout_marginStart=
"5dp"
android:layout_marginTop=
"4dp"
app:cardCornerRadius=
"@dimen/card_corner_radius"
app:cardElevation=
"@dimen/card_elevation"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:id=
"@+id/magisk_update"
android:layout_marginBottom=
"5dp"
android:layout_marginTop=
"15dp"
android:orientation=
"horizontal"
>
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<ImageView
android:id=
"@+id/magisk_
status
_icon"
android:id=
"@+id/magisk_
update
_icon"
android:layout_width=
"25dp"
android:layout_height=
"25dp"
android:layout_centerVertical=
"true"
android:layout_marginEnd=
"15dp"
android:layout_marginStart=
"15dp"
android:layout_toStartOf=
"@+id/magisk_version"
/>
android:layout_toStartOf=
"@+id/magisk_update_status"
android:visibility=
"gone"
/>
<ProgressBar
android:id=
"@+id/magisk_update_progress"
android:layout_width=
"25dp"
android:layout_height=
"25dp"
android:layout_centerVertical=
"true"
android:layout_toStartOf=
"@+id/magisk_update_status"
/>
<TextView
android:id=
"@+id/magisk_
version
"
android:id=
"@+id/magisk_
update_status
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
...
...
@@ -111,9 +67,9 @@
android:gravity=
"center"
android:minWidth=
"225dp"
android:padding=
"6dp"
android:text=
"@string/checking_for_updates"
android:textStyle=
"bold"
/>
</RelativeLayout>
<RelativeLayout
...
...
@@ -124,16 +80,14 @@
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/
root
_status_icon"
android:id=
"@+id/
magisk
_status_icon"
android:layout_width=
"25dp"
android:layout_height=
"25dp"
android:layout_centerVertical=
"true"
android:layout_marginEnd=
"15dp"
android:layout_marginStart=
"15dp"
android:layout_toStartOf=
"@+id/root_status"
/>
android:layout_toStartOf=
"@+id/magisk_version"
/>
<TextView
android:id=
"@+id/
root_status
"
android:id=
"@+id/
magisk_version
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
...
...
@@ -143,6 +97,7 @@
android:padding=
"6dp"
android:textStyle=
"bold"
/>
</RelativeLayout>
</LinearLayout>
...
...
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