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
1a32aaea
Commit
1a32aaea
authored
Nov 17, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drawer rearrangement
parent
4635883d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
23 deletions
+20
-23
MagiskManager.java
app/src/main/java/com/topjohnwu/magisk/MagiskManager.java
+2
-7
MainActivity.java
app/src/main/java/com/topjohnwu/magisk/MainActivity.java
+6
-4
drawer.xml
app/src/main/res/menu/drawer.xml
+12
-12
No files found.
app/src/main/java/com/topjohnwu/magisk/MagiskManager.java
View file @
1a32aaea
...
...
@@ -49,7 +49,6 @@ public class MagiskManager extends Application {
public
int
remoteManagerVersionCode
=
-
1
;
public
String
managerLink
;
public
String
bootBlock
=
null
;
public
boolean
disabled
;
public
int
snet_version
;
public
int
updateServiceVersion
;
...
...
@@ -65,6 +64,7 @@ public class MagiskManager extends Application {
public
boolean
isDarkTheme
;
public
boolean
updateNotification
;
public
boolean
suReauth
;
public
boolean
coreOnly
;
public
int
suRequestTimeout
;
public
int
suLogTimeout
=
14
;
public
int
suAccessState
;
...
...
@@ -146,6 +146,7 @@ public class MagiskManager extends Application {
multiuserMode
=
suDB
.
getSettings
(
Const
.
Key
.
SU_MULTIUSER_MODE
,
Const
.
Value
.
MULTIUSER_MODE_OWNER_ONLY
);
suNamespaceMode
=
suDB
.
getSettings
(
Const
.
Key
.
SU_MNT_NS
,
Const
.
Value
.
NAMESPACE_MODE_REQUESTER
);
coreOnly
=
prefs
.
getBoolean
(
Const
.
Key
.
DISABLE
,
false
);
updateNotification
=
prefs
.
getBoolean
(
Const
.
Key
.
UPDATE_NOTIFICATION
,
true
);
updateChannel
=
Utils
.
getPrefsInt
(
prefs
,
Const
.
Key
.
UPDATE_CHANNEL
,
Const
.
Value
.
STABLE_CHANNEL
);
bootFormat
=
prefs
.
getString
(
Const
.
Key
.
BOOT_FORMAT
,
".img"
);
...
...
@@ -179,12 +180,6 @@ public class MagiskManager extends Application {
magiskVersionCode
=
Integer
.
parseInt
(
ret
.
get
(
0
));
}
catch
(
NumberFormatException
ignored
)
{}
}
ret
=
Shell
.
sh
(
"getprop "
+
Const
.
DISABLE_INDICATION_PROP
);
try
{
disabled
=
Utils
.
isValidShellResponse
(
ret
)
&&
Integer
.
parseInt
(
ret
.
get
(
0
))
!=
0
;
}
catch
(
NumberFormatException
e
)
{
disabled
=
false
;
}
if
(
magiskVersionCode
>
1435
)
{
ret
=
Shell
.
su
(
"resetprop -p "
+
Const
.
MAGISKHIDE_PROP
);
}
else
{
...
...
app/src/main/java/com/topjohnwu/magisk/MainActivity.java
View file @
1a32aaea
...
...
@@ -129,14 +129,16 @@ public class MainActivity extends Activity
}
public
void
checkHideSection
()
{
MagiskManager
mm
=
getMagiskManager
();
Menu
menu
=
navigationView
.
getMenu
();
menu
.
findItem
(
R
.
id
.
magiskhide
).
setVisible
(
Shell
.
rootAccess
()
&&
getMagiskManager
()
.
magiskVersionCode
>=
1300
Shell
.
rootAccess
()
&&
mm
.
magiskVersionCode
>=
1300
&&
prefs
.
getBoolean
(
Const
.
Key
.
MAGISKHIDE
,
false
));
menu
.
findItem
(
R
.
id
.
modules
).
setVisible
(
Shell
.
rootAccess
()
&&
getMagiskManager
()
.
magiskVersionCode
>=
0
);
Shell
.
rootAccess
()
&&
mm
.
magiskVersionCode
>=
0
);
menu
.
findItem
(
R
.
id
.
downloads
).
setVisible
(
Utils
.
checkNetworkStatus
()
&&
Shell
.
rootAccess
()
&&
getMagiskManager
().
magiskVersionCode
>=
0
);
Shell
.
rootAccess
()
&&
mm
.
magiskVersionCode
>=
0
);
menu
.
setGroupVisible
(
R
.
id
.
second_group
,
!
mm
.
coreOnly
);
menu
.
findItem
(
R
.
id
.
log
).
setVisible
(
Shell
.
rootAccess
());
menu
.
findItem
(
R
.
id
.
superuser
).
setVisible
(
Shell
.
rootAccess
());
}
...
...
@@ -157,7 +159,7 @@ public class MainActivity extends Activity
case
"downloads"
:
itemId
=
R
.
id
.
downloads
;
break
;
case
Const
.
Key
.
MAGISKHIDE
:
case
"magiskhide"
:
itemId
=
R
.
id
.
magiskhide
;
break
;
case
"log"
:
...
...
app/src/main/res/menu/drawer.xml
View file @
1a32aaea
...
...
@@ -15,6 +15,10 @@
android:icon=
"@drawable/ic_superuser"
android:title=
"@string/superuser"
android:visible=
"false"
/>
<item
android:id=
"@+id/magiskhide"
android:icon=
"@drawable/ic_autoroot"
android:title=
"@string/magiskhide"
/>
</group>
...
...
@@ -32,32 +36,28 @@
android:icon=
"@drawable/ic_cloud_download"
android:title=
"@string/downloads"
/>
<item
android:id=
"@+id/magiskhide"
android:icon=
"@drawable/ic_autoroot"
android:title=
"@string/magiskhide"
/>
<item
android:id=
"@+id/log"
android:icon=
"@drawable/ic_bug_report"
android:title=
"@string/log"
/>
</group>
<group
android:checkableBehavior=
"
non
e"
android:checkableBehavior=
"
singl
e"
android:id=
"@+id/third_group"
>
<item
android:id=
"@+id/log"
android:icon=
"@drawable/ic_bug_report"
android:title=
"@string/log"
/>
<item
android:checkable=
"false"
android:id=
"@+id/settings"
android:icon=
"@drawable/ic_settings"
android:title=
"@string/settings"
/>
<item
android:checkable=
"false"
android:id=
"@+id/app_about"
android:icon=
"@drawable/ic_info_outline"
android:title=
"@string/about"
/>
</group>
</menu>
\ No newline at end of file
</menu>
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