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
a73acfb9
Commit
a73acfb9
authored
Jan 21, 2022
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show unloaded Zygisk modules in UI
parent
fbe17dde
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
12 deletions
+28
-12
LocalModule.kt
...ava/com/topjohnwu/magisk/core/model/module/LocalModule.kt
+2
-0
ModuleRvItem.kt
.../main/java/com/topjohnwu/magisk/ui/module/ModuleRvItem.kt
+21
-8
item_module_md2.xml
app/src/main/res/layout/item_module_md2.xml
+4
-4
strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/core/model/module/LocalModule.kt
View file @
a73acfb9
...
@@ -29,10 +29,12 @@ data class LocalModule(
...
@@ -29,10 +29,12 @@ data class LocalModule(
private
val
ruleFile
=
SuFile
(
path
,
"sepolicy.rule"
)
private
val
ruleFile
=
SuFile
(
path
,
"sepolicy.rule"
)
private
val
riruFolder
=
SuFile
(
path
,
"riru"
)
private
val
riruFolder
=
SuFile
(
path
,
"riru"
)
private
val
zygiskFolder
=
SuFile
(
path
,
"zygisk"
)
private
val
zygiskFolder
=
SuFile
(
path
,
"zygisk"
)
private
val
unloaded
=
SuFile
(
zygiskFolder
,
"unloaded"
)
val
updated
:
Boolean
get
()
=
updateFile
.
exists
()
val
updated
:
Boolean
get
()
=
updateFile
.
exists
()
val
isRiru
:
Boolean
get
()
=
(
id
==
"riru-core"
)
||
riruFolder
.
exists
()
val
isRiru
:
Boolean
get
()
=
(
id
==
"riru-core"
)
||
riruFolder
.
exists
()
val
isZygisk
:
Boolean
get
()
=
zygiskFolder
.
exists
()
val
isZygisk
:
Boolean
get
()
=
zygiskFolder
.
exists
()
val
zygiskUnloaded
:
Boolean
get
()
=
unloaded
.
exists
()
var
enable
:
Boolean
var
enable
:
Boolean
get
()
=
!
disableFile
.
exists
()
get
()
=
!
disableFile
.
exists
()
...
...
app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleRvItem.kt
View file @
a73acfb9
...
@@ -9,6 +9,7 @@ import com.topjohnwu.magisk.databinding.DiffRvItem
...
@@ -9,6 +9,7 @@ import com.topjohnwu.magisk.databinding.DiffRvItem
import
com.topjohnwu.magisk.databinding.ObservableDiffRvItem
import
com.topjohnwu.magisk.databinding.ObservableDiffRvItem
import
com.topjohnwu.magisk.databinding.RvContainer
import
com.topjohnwu.magisk.databinding.RvContainer
import
com.topjohnwu.magisk.databinding.set
import
com.topjohnwu.magisk.databinding.set
import
com.topjohnwu.magisk.utils.TextHolder
import
com.topjohnwu.magisk.utils.asText
import
com.topjohnwu.magisk.utils.asText
object
InstallModule
:
DiffRvItem
<
InstallModule
>()
{
object
InstallModule
:
DiffRvItem
<
InstallModule
>()
{
...
@@ -21,6 +22,25 @@ class LocalModuleRvItem(
...
@@ -21,6 +22,25 @@ class LocalModuleRvItem(
override
val
layoutRes
=
R
.
layout
.
item_module_md2
override
val
layoutRes
=
R
.
layout
.
item_module_md2
val
showNotice
:
Boolean
val
noticeText
:
TextHolder
init
{
val
isZygisk
=
item
.
isZygisk
val
isRiru
=
item
.
isRiru
val
zygiskUnloaded
=
isZygisk
&&
item
.
zygiskUnloaded
showNotice
=
zygiskUnloaded
||
(
Info
.
isZygiskEnabled
&&
isRiru
)
||
(!
Info
.
isZygiskEnabled
&&
isZygisk
)
noticeText
=
when
{
zygiskUnloaded
->
R
.
string
.
zygisk_module_unloaded
.
asText
()
isRiru
->
R
.
string
.
suspend_text_riru
.
asText
(
R
.
string
.
zygisk
.
asText
())
else
->
R
.
string
.
suspend_text_zygisk
.
asText
(
R
.
string
.
zygisk
.
asText
())
}
}
@get
:
Bindable
@get
:
Bindable
var
isEnabled
=
item
.
enable
var
isEnabled
=
item
.
enable
set
(
value
)
=
set
(
value
,
field
,
{
field
=
it
},
BR
.
enabled
,
BR
.
updateReady
)
{
set
(
value
)
=
set
(
value
,
field
,
{
field
=
it
},
BR
.
enabled
,
BR
.
updateReady
)
{
...
@@ -38,14 +58,7 @@ class LocalModuleRvItem(
...
@@ -38,14 +58,7 @@ class LocalModuleRvItem(
get
()
=
item
.
updateInfo
!=
null
&&
!
isRemoved
&&
isEnabled
get
()
=
item
.
updateInfo
!=
null
&&
!
isRemoved
&&
isEnabled
set
(
_
)
=
notifyPropertyChanged
(
BR
.
updateReady
)
set
(
_
)
=
notifyPropertyChanged
(
BR
.
updateReady
)
val
isSuspended
=
val
isUpdated
=
item
.
updated
(
Info
.
isZygiskEnabled
&&
item
.
isRiru
)
||
(!
Info
.
isZygiskEnabled
&&
item
.
isZygisk
)
val
suspendText
=
if
(
item
.
isRiru
)
R
.
string
.
suspend_text_riru
.
asText
(
R
.
string
.
zygisk
.
asText
())
else
R
.
string
.
suspend_text_zygisk
.
asText
(
R
.
string
.
zygisk
.
asText
())
val
isUpdated
get
()
=
item
.
updated
fun
delete
()
{
fun
delete
()
{
isRemoved
=
!
isRemoved
isRemoved
=
!
isRemoved
...
...
app/src/main/res/layout/item_module_md2.xml
View file @
a73acfb9
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
<com.google.android.material.card.MaterialCardView
<com.google.android.material.card.MaterialCardView
style=
"@style/WidgetFoundation.Card"
style=
"@style/WidgetFoundation.Card"
isEnabled=
"@{!item.removed && item.enabled && !item.s
uspended
}"
isEnabled=
"@{!item.removed && item.enabled && !item.s
howNotice
}"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:nextFocusRight=
"@id/module_indicator"
android:nextFocusRight=
"@id/module_indicator"
...
@@ -173,14 +173,14 @@
...
@@ -173,14 +173,14 @@
tools:constraint_referenced_ids=
"module_update,module_remove"
/>
tools:constraint_referenced_ids=
"module_update,module_remove"
/>
<TextView
<TextView
android:id=
"@+id/module_
suspend
_text"
android:id=
"@+id/module_
notice
_text"
goneUnless=
"@{item.s
uspended
}"
goneUnless=
"@{item.s
howNotice
}"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/l1"
android:layout_marginStart=
"@dimen/l1"
android:layout_marginEnd=
"@dimen/l_50"
android:layout_marginEnd=
"@dimen/l_50"
android:fontFamily=
"sans-serif-medium"
android:fontFamily=
"sans-serif-medium"
android:text=
"@{item.
suspend
Text}"
android:text=
"@{item.
notice
Text}"
android:textAppearance=
"@style/AppearanceFoundation.Caption.Primary"
android:textAppearance=
"@style/AppearanceFoundation.Caption.Primary"
android:textColor=
"?colorError"
android:textColor=
"?colorError"
app:layout_constraintBottom_toBottomOf=
"@+id/module_remove"
app:layout_constraintBottom_toBottomOf=
"@+id/module_remove"
...
...
app/src/main/res/values/strings.xml
View file @
a73acfb9
...
@@ -110,6 +110,7 @@
...
@@ -110,6 +110,7 @@
<string
name=
"update_available"
>
Update Available
</string>
<string
name=
"update_available"
>
Update Available
</string>
<string
name=
"suspend_text_riru"
>
Module suspended because %1$s is enabled
</string>
<string
name=
"suspend_text_riru"
>
Module suspended because %1$s is enabled
</string>
<string
name=
"suspend_text_zygisk"
>
Module suspended because %1$s is not enabled
</string>
<string
name=
"suspend_text_zygisk"
>
Module suspended because %1$s is not enabled
</string>
<string
name=
"zygisk_module_unloaded"
>
Zygisk module not loaded due to incompatibility
</string>
<!--Settings-->
<!--Settings-->
<string
name=
"settings_dark_mode_title"
>
Theme Mode
</string>
<string
name=
"settings_dark_mode_title"
>
Theme Mode
</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