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
ec1af9dc
Commit
ec1af9dc
authored
Nov 30, 2020
by
vvb2060
Committed by
topjohnwu
Dec 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete useless arrays
parent
ff4cea22
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
20 deletions
+7
-20
BaseSettingsItem.kt
...java/com/topjohnwu/magisk/ui/settings/BaseSettingsItem.kt
+1
-1
SettingsItems.kt
...in/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt
+6
-11
arrays.xml
app/src/main/res/values/arrays.xml
+0
-8
No files found.
app/src/main/java/com/topjohnwu/magisk/ui/settings/BaseSettingsItem.kt
View file @
ec1af9dc
...
@@ -158,7 +158,7 @@ sealed class BaseSettingsItem : ObservableItem<BaseSettingsItem>() {
...
@@ -158,7 +158,7 @@ sealed class BaseSettingsItem : ObservableItem<BaseSettingsItem>() {
runCatching
{
getStringArray
(
id
)
}.
getOrDefault
(
emptyArray
())
runCatching
{
getStringArray
(
id
)
}.
getOrDefault
(
emptyArray
())
override
fun
onPressed
(
view
:
View
,
callback
:
Callback
)
{
override
fun
onPressed
(
view
:
View
,
callback
:
Callback
)
{
if
(
entries
.
isEmpty
()
||
entryValues
.
isEmpty
()
)
return
if
(
entries
.
isEmpty
())
return
super
.
onPressed
(
view
,
callback
)
super
.
onPressed
(
view
,
callback
)
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt
View file @
ec1af9dc
...
@@ -256,22 +256,20 @@ object Superuser : BaseSettingsItem.Section() {
...
@@ -256,22 +256,20 @@ object Superuser : BaseSettingsItem.Section() {
object
AccessMode
:
BaseSettingsItem
.
Selector
()
{
object
AccessMode
:
BaseSettingsItem
.
Selector
()
{
override
val
title
=
R
.
string
.
superuser_access
.
asTransitive
()
override
val
title
=
R
.
string
.
superuser_access
.
asTransitive
()
override
val
entryRes
=
R
.
array
.
su_access
override
val
entryRes
=
R
.
array
.
su_access
override
val
entryValRes
=
R
.
array
.
value_array
override
var
value
=
Config
.
rootMode
override
var
value
=
Config
.
rootMode
set
(
value
)
=
setV
(
value
,
field
,
{
field
=
it
})
{
set
(
value
)
=
setV
(
value
,
field
,
{
field
=
it
})
{
Config
.
rootMode
=
entryValues
[
it
].
toInt
()
Config
.
rootMode
=
it
}
}
}
}
object
MultiuserMode
:
BaseSettingsItem
.
Selector
()
{
object
MultiuserMode
:
BaseSettingsItem
.
Selector
()
{
override
val
title
=
R
.
string
.
multiuser_mode
.
asTransitive
()
override
val
title
=
R
.
string
.
multiuser_mode
.
asTransitive
()
override
val
entryRes
=
R
.
array
.
multiuser_mode
override
val
entryRes
=
R
.
array
.
multiuser_mode
override
val
entryValRes
=
R
.
array
.
value_array
override
var
value
=
Config
.
suMultiuserMode
override
var
value
=
Config
.
suMultiuserMode
set
(
value
)
=
setV
(
value
,
field
,
{
field
=
it
})
{
set
(
value
)
=
setV
(
value
,
field
,
{
field
=
it
})
{
Config
.
suMultiuserMode
=
entryValues
[
it
].
toInt
()
Config
.
suMultiuserMode
=
it
}
}
override
val
description
override
val
description
...
@@ -285,11 +283,10 @@ object MultiuserMode : BaseSettingsItem.Selector() {
...
@@ -285,11 +283,10 @@ object MultiuserMode : BaseSettingsItem.Selector() {
object
MountNamespaceMode
:
BaseSettingsItem
.
Selector
()
{
object
MountNamespaceMode
:
BaseSettingsItem
.
Selector
()
{
override
val
title
=
R
.
string
.
mount_namespace_mode
.
asTransitive
()
override
val
title
=
R
.
string
.
mount_namespace_mode
.
asTransitive
()
override
val
entryRes
=
R
.
array
.
namespace
override
val
entryRes
=
R
.
array
.
namespace
override
val
entryValRes
=
R
.
array
.
value_array
override
var
value
=
Config
.
suMntNamespaceMode
override
var
value
=
Config
.
suMntNamespaceMode
set
(
value
)
=
setV
(
value
,
field
,
{
field
=
it
})
{
set
(
value
)
=
setV
(
value
,
field
,
{
field
=
it
})
{
Config
.
suMntNamespaceMode
=
entryValues
[
it
].
toInt
()
Config
.
suMntNamespaceMode
=
it
}
}
override
val
description
override
val
description
...
@@ -299,11 +296,10 @@ object MountNamespaceMode : BaseSettingsItem.Selector() {
...
@@ -299,11 +296,10 @@ object MountNamespaceMode : BaseSettingsItem.Selector() {
object
AutomaticResponse
:
BaseSettingsItem
.
Selector
()
{
object
AutomaticResponse
:
BaseSettingsItem
.
Selector
()
{
override
val
title
=
R
.
string
.
auto_response
.
asTransitive
()
override
val
title
=
R
.
string
.
auto_response
.
asTransitive
()
override
val
entryRes
=
R
.
array
.
auto_response
override
val
entryRes
=
R
.
array
.
auto_response
override
val
entryValRes
=
R
.
array
.
value_array
override
var
value
=
Config
.
suAutoResponse
override
var
value
=
Config
.
suAutoResponse
set
(
value
)
=
setV
(
value
,
field
,
{
field
=
it
})
{
set
(
value
)
=
setV
(
value
,
field
,
{
field
=
it
})
{
Config
.
suAutoResponse
=
entryValues
[
it
].
toInt
()
Config
.
suAutoResponse
=
it
}
}
}
}
...
@@ -314,7 +310,7 @@ object RequestTimeout : BaseSettingsItem.Selector() {
...
@@ -314,7 +310,7 @@ object RequestTimeout : BaseSettingsItem.Selector() {
override
var
value
=
selected
override
var
value
=
selected
set
(
value
)
=
setV
(
value
,
field
,
{
field
=
it
})
{
set
(
value
)
=
setV
(
value
,
field
,
{
field
=
it
})
{
Config
.
suDefaultTimeout
=
entryValues
[
it
].
toInt
()
Config
.
suDefaultTimeout
=
it
}
}
private
val
selected
:
Int
private
val
selected
:
Int
...
@@ -324,10 +320,9 @@ object RequestTimeout : BaseSettingsItem.Selector() {
...
@@ -324,10 +320,9 @@ object RequestTimeout : BaseSettingsItem.Selector() {
object
SUNotification
:
BaseSettingsItem
.
Selector
()
{
object
SUNotification
:
BaseSettingsItem
.
Selector
()
{
override
val
title
=
R
.
string
.
superuser_notification
.
asTransitive
()
override
val
title
=
R
.
string
.
superuser_notification
.
asTransitive
()
override
val
entryRes
=
R
.
array
.
su_notification
override
val
entryRes
=
R
.
array
.
su_notification
override
val
entryValRes
=
R
.
array
.
value_array
override
var
value
=
Config
.
suNotification
override
var
value
=
Config
.
suNotification
set
(
value
)
=
setV
(
value
,
field
,
{
field
=
it
})
{
set
(
value
)
=
setV
(
value
,
field
,
{
field
=
it
})
{
Config
.
suNotification
=
entryValues
[
it
].
toInt
()
Config
.
suNotification
=
it
}
}
}
}
app/src/main/res/values/arrays.xml
View file @
ec1af9dc
...
@@ -16,14 +16,6 @@
...
@@ -16,14 +16,6 @@
<item>
@string/settings_su_app_adb
</item>
<item>
@string/settings_su_app_adb
</item>
</string-array>
</string-array>
<string-array
name=
"value_array"
>
<item>
0
</item>
<item>
1
</item>
<item>
2
</item>
<item>
3
</item>
<item>
4
</item>
</string-array>
<string-array
name=
"request_timeout"
>
<string-array
name=
"request_timeout"
>
<item>
@string/settings_su_request_10
</item>
<item>
@string/settings_su_request_10
</item>
<item>
@string/settings_su_request_15
</item>
<item>
@string/settings_su_request_15
</item>
...
...
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