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
9bc0b7f1
Commit
9bc0b7f1
authored
Jan 28, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update settings
parent
cd4dfc98
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
15 deletions
+46
-15
build.gradle
app/build.gradle
+2
-2
Global.java
app/src/main/java/com/topjohnwu/magisk/Global.java
+1
-0
SettingsActivity.java
app/src/main/java/com/topjohnwu/magisk/SettingsActivity.java
+25
-6
strings.xml
app/src/main/res/values/strings.xml
+7
-2
app_settings.xml
app/src/main/res/xml/app_settings.xml
+6
-4
gradle.properties
gradle.properties
+5
-1
No files found.
app/build.gradle
View file @
9bc0b7f1
...
@@ -20,7 +20,7 @@ android {
...
@@ -20,7 +20,7 @@ android {
}
}
compileOptions
{
compileOptions
{
incremental
fals
e
incremental
tru
e
}
}
buildTypes
{
buildTypes
{
...
@@ -34,7 +34,7 @@ android {
...
@@ -34,7 +34,7 @@ android {
targetCompatibility
JavaVersion
.
VERSION_1_8
targetCompatibility
JavaVersion
.
VERSION_1_8
}
}
dexOptions
{
dexOptions
{
preDexLibraries
=
fals
e
preDexLibraries
=
tru
e
}
}
externalNativeBuild
{
externalNativeBuild
{
cmake
{
cmake
{
...
...
app/src/main/java/com/topjohnwu/magisk/Global.java
View file @
9bc0b7f1
...
@@ -69,6 +69,7 @@ public class Global {
...
@@ -69,6 +69,7 @@ public class Global {
initSuConfigs
(
context
);
initSuConfigs
(
context
);
// Initialize prefs
// Initialize prefs
prefs
.
edit
()
prefs
.
edit
()
.
putBoolean
(
"dark_theme"
,
Configs
.
isDarkTheme
)
.
putBoolean
(
"magiskhide"
,
Utils
.
itemExist
(
false
,
"/magisk/.core/magiskhide/enable"
))
.
putBoolean
(
"magiskhide"
,
Utils
.
itemExist
(
false
,
"/magisk/.core/magiskhide/enable"
))
.
putBoolean
(
"busybox"
,
Utils
.
commandExists
(
"busybox"
))
.
putBoolean
(
"busybox"
,
Utils
.
commandExists
(
"busybox"
))
.
putBoolean
(
"hosts"
,
Utils
.
itemExist
(
false
,
"/magisk/.core/hosts"
))
.
putBoolean
(
"hosts"
,
Utils
.
itemExist
(
false
,
"/magisk/.core/hosts"
))
...
...
app/src/main/java/com/topjohnwu/magisk/SettingsActivity.java
View file @
9bc0b7f1
...
@@ -3,7 +3,9 @@ package com.topjohnwu.magisk;
...
@@ -3,7 +3,9 @@ package com.topjohnwu.magisk;
import
android.content.SharedPreferences
;
import
android.content.SharedPreferences
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.preference.CheckBoxPreference
;
import
android.preference.CheckBoxPreference
;
import
android.preference.ListPreference
;
import
android.preference.Preference
;
import
android.preference.Preference
;
import
android.preference.PreferenceCategory
;
import
android.preference.PreferenceFragment
;
import
android.preference.PreferenceFragment
;
import
android.preference.PreferenceManager
;
import
android.preference.PreferenceManager
;
import
android.preference.PreferenceScreen
;
import
android.preference.PreferenceScreen
;
...
@@ -79,25 +81,42 @@ public class SettingsActivity extends AppCompatActivity {
...
@@ -79,25 +81,42 @@ public class SettingsActivity extends AppCompatActivity {
public
void
onCreate
(
Bundle
savedInstanceState
)
{
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
addPreferencesFromResource
(
R
.
xml
.
app_settings
);
addPreferencesFromResource
(
R
.
xml
.
app_settings
);
PreferenceManager
.
setDefaultValues
(
getActivity
(),
R
.
xml
.
app_settings
,
false
);
prefs
=
PreferenceManager
.
getDefaultSharedPreferences
(
getActivity
());
prefs
=
PreferenceManager
.
getDefaultSharedPreferences
(
getActivity
());
prefScreen
=
getPreferenceScreen
();
prefScreen
=
getPreferenceScreen
();
PreferenceCategory
magiskCategory
=
(
PreferenceCategory
)
findPreference
(
"magisk"
);
PreferenceCategory
suCategory
=
(
PreferenceCategory
)
findPreference
(
"superuser"
);
ListPreference
suAccess
=
(
ListPreference
)
findPreference
(
"su_access"
);
ListPreference
autoRes
=
(
ListPreference
)
findPreference
(
"su_auto_response"
);
ListPreference
requestTimeout
=
(
ListPreference
)
findPreference
(
"su_request_timeout"
);
ListPreference
suNotification
=
(
ListPreference
)
findPreference
(
"su_notification"
);
suAccess
.
setSummary
(
getResources
()
.
getStringArray
(
R
.
array
.
su_access
)[
Utils
.
getPrefsInt
(
prefs
,
"su_access"
,
3
)]);
autoRes
.
setSummary
(
getResources
()
.
getStringArray
(
R
.
array
.
auto_response
)[
Utils
.
getPrefsInt
(
prefs
,
"su_auto_response"
,
0
)]);
suNotification
.
setSummary
(
getResources
()
.
getStringArray
(
R
.
array
.
su_notification
)[
Utils
.
getPrefsInt
(
prefs
,
"su_notification"
,
1
)]);
requestTimeout
.
setSummary
(
getString
(
R
.
string
.
request_timeout_summary
,
prefs
.
getString
(
"su_request_timeout"
,
"10"
)));
CheckBoxPreference
busyboxPreference
=
(
CheckBoxPreference
)
findPreference
(
"busybox"
);
CheckBoxPreference
busyboxPreference
=
(
CheckBoxPreference
)
findPreference
(
"busybox"
);
CheckBoxPreference
magiskhidePreference
=
(
CheckBoxPreference
)
findPreference
(
"magiskhide"
);
CheckBoxPreference
magiskhidePreference
=
(
CheckBoxPreference
)
findPreference
(
"magiskhide"
);
SwitchPreference
hostsPreference
=
(
SwitchPreference
)
findPreference
(
"hosts"
);
SwitchPreference
hostsPreference
=
(
SwitchPreference
)
findPreference
(
"hosts"
);
Preference
clear
=
findPreference
(
"clear"
);
clear
.
setOnPreferenceClickListener
((
pref
)
->
{
findPreference
(
"clear"
)
.
setOnPreferenceClickListener
((
pref
)
->
{
ModuleHelper
.
clearRepoCache
(
getActivity
());
ModuleHelper
.
clearRepoCache
(
getActivity
());
return
true
;
return
true
;
});
});
if
(!
Shell
.
rootAccess
())
{
if
(!
Shell
.
rootAccess
())
{
busyboxPreference
.
setEnabled
(
false
);
prefScreen
.
removePreference
(
magiskCategory
);
magiskhidePreference
.
setEnabled
(
false
);
prefScreen
.
removePreference
(
suCategory
);
hostsPreference
.
setEnabled
(
false
);
}
else
{
}
else
{
if
(!
Global
.
Info
.
isSuClient
)
{
prefScreen
.
removePreference
(
suCategory
);
}
if
(
Global
.
Info
.
magiskVersion
<
9
)
{
if
(
Global
.
Info
.
magiskVersion
<
9
)
{
hostsPreference
.
setEnabled
(
false
);
hostsPreference
.
setEnabled
(
false
);
busyboxPreference
.
setEnabled
(
false
);
busyboxPreference
.
setEnabled
(
false
);
...
...
app/src/main/res/values/strings.xml
View file @
9bc0b7f1
...
@@ -130,8 +130,8 @@
...
@@ -130,8 +130,8 @@
<string
name=
"settings_magiskhide_summary"
>
Hide Magisk from various detections\nRequires reboot
</string>
<string
name=
"settings_magiskhide_summary"
>
Hide Magisk from various detections\nRequires reboot
</string>
<string
name=
"settings_busybox_title"
>
Enable BusyBox
</string>
<string
name=
"settings_busybox_title"
>
Enable BusyBox
</string>
<string
name=
"settings_busybox_summary"
>
Bind mount Magisk\'s built-in busybox to xbin\nRequires reboot
</string>
<string
name=
"settings_busybox_summary"
>
Bind mount Magisk\'s built-in busybox to xbin\nRequires reboot
</string>
<string
name=
"settings_hosts_title"
>
Enable s
ystemless hosts
</string>
<string
name=
"settings_hosts_title"
>
S
ystemless hosts
</string>
<string
name=
"settings_hosts_summary"
>
Systemless support for Adblock apps
</string>
<string
name=
"settings_hosts_summary"
>
Systemless
hosts
support for Adblock apps
</string>
<string
name=
"settings_su_app_adb"
>
Apps and ADB
</string>
<string
name=
"settings_su_app_adb"
>
Apps and ADB
</string>
<string
name=
"settings_su_app"
>
Apps only
</string>
<string
name=
"settings_su_app"
>
Apps only
</string>
...
@@ -141,6 +141,11 @@
...
@@ -141,6 +141,11 @@
<string
name=
"settings_su_request_20"
>
20 seconds
</string>
<string
name=
"settings_su_request_20"
>
20 seconds
</string>
<string
name=
"settings_su_request_30"
>
30 seconds
</string>
<string
name=
"settings_su_request_30"
>
30 seconds
</string>
<string
name=
"settings_su_request_60"
>
60 seconds
</string>
<string
name=
"settings_su_request_60"
>
60 seconds
</string>
<string
name=
"superuser_access"
>
Superuser Access
</string>
<string
name=
"auto_response"
>
Automatic Response
</string>
<string
name=
"request_timeout"
>
Request Timeout
</string>
<string
name=
"superuser_notification"
>
Superuser Notification
</string>
<string
name=
"request_timeout_summary"
>
%1$s seconds
</string>
<string
name=
"settings_development_category"
>
App Development
</string>
<string
name=
"settings_development_category"
>
App Development
</string>
<string
name=
"settings_developer_logging_title"
>
Enable advanced debug logging
</string>
<string
name=
"settings_developer_logging_title"
>
Enable advanced debug logging
</string>
...
...
app/src/main/res/xml/app_settings.xml
View file @
9bc0b7f1
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
</PreferenceCategory>
</PreferenceCategory>
<PreferenceCategory
<PreferenceCategory
android:key=
"magisk"
android:title=
"@string/magisk"
>
android:title=
"@string/magisk"
>
<CheckBoxPreference
<CheckBoxPreference
...
@@ -41,29 +42,30 @@
...
@@ -41,29 +42,30 @@
</PreferenceCategory>
</PreferenceCategory>
<PreferenceCategory
<PreferenceCategory
android:key=
"superuser"
android:title=
"@string/superuser"
>
android:title=
"@string/superuser"
>
<ListPreference
<ListPreference
android:key=
"su_access"
android:key=
"su_access"
android:title=
"
Superuser A
ccess"
android:title=
"
@string/superuser_a
ccess"
android:entries=
"@array/su_access"
android:entries=
"@array/su_access"
android:entryValues=
"@array/value_array"
/>
android:entryValues=
"@array/value_array"
/>
<ListPreference
<ListPreference
android:key=
"su_auto_response"
android:key=
"su_auto_response"
android:title=
"
Automatic R
esponse"
android:title=
"
@string/auto_r
esponse"
android:entries=
"@array/auto_response"
android:entries=
"@array/auto_response"
android:entryValues=
"@array/value_array"
/>
android:entryValues=
"@array/value_array"
/>
<ListPreference
<ListPreference
android:key=
"su_request_timeout"
android:key=
"su_request_timeout"
android:title=
"
Request T
imeout"
android:title=
"
@string/request_t
imeout"
android:entries=
"@array/request_timeout"
android:entries=
"@array/request_timeout"
android:entryValues=
"@array/request_timeout_value"
/>
android:entryValues=
"@array/request_timeout_value"
/>
<ListPreference
<ListPreference
android:key=
"su_notification"
android:key=
"su_notification"
android:title=
"
Superuser N
otification"
android:title=
"
@string/superuser_n
otification"
android:entries=
"@array/su_notification"
android:entries=
"@array/su_notification"
android:entryValues=
"@array/value_array"
/>
android:entryValues=
"@array/value_array"
/>
...
...
gradle.properties
View file @
9bc0b7f1
...
@@ -15,4 +15,8 @@ org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryErr
...
@@ -15,4 +15,8 @@ org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryErr
# When configured, Gradle will run in incubating parallel mode.
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel
=
true
org.gradle.parallel
=
true
\ No newline at end of file
# When set to true the Gradle daemon is used to run the build. For local developer builds this is our favorite property.
# The developer environment is optimized for speed and feedback so we nearly always run Gradle jobs with the daemon.
org.gradle.daemon
=
true
\ No newline at end of file
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