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
ddd153c0
Commit
ddd153c0
authored
Nov 10, 2021
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show module suspend notice
Close #4862
parent
b8c15882
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
2 deletions
+33
-2
LocalModule.kt
...ava/com/topjohnwu/magisk/core/model/module/LocalModule.kt
+4
-0
ModuleRvItem.kt
.../main/java/com/topjohnwu/magisk/ui/module/ModuleRvItem.kt
+9
-0
item_module_md2.xml
app/src/main/res/layout/item_module_md2.xml
+18
-2
strings.xml
app/src/main/res/values/strings.xml
+2
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/core/model/module/LocalModule.kt
View file @
ddd153c0
...
...
@@ -21,8 +21,12 @@ data class LocalModule(
private
val
disableFile
=
SuFile
(
path
,
"disable"
)
private
val
updateFile
=
SuFile
(
path
,
"update"
)
private
val
ruleFile
=
SuFile
(
path
,
"sepolicy.rule"
)
private
val
riruFolder
=
SuFile
(
path
,
"riru"
)
private
val
zygiskFolder
=
SuFile
(
path
,
"zygisk"
)
val
updated
:
Boolean
get
()
=
updateFile
.
exists
()
val
isRiru
:
Boolean
get
()
=
(
id
==
"riru-core"
)
||
riruFolder
.
exists
()
val
isZygisk
:
Boolean
get
()
=
zygiskFolder
.
exists
()
var
enable
:
Boolean
get
()
=
!
disableFile
.
exists
()
...
...
app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleRvItem.kt
View file @
ddd153c0
...
...
@@ -3,12 +3,14 @@ package com.topjohnwu.magisk.ui.module
import
androidx.databinding.Bindable
import
com.topjohnwu.magisk.BR
import
com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.core.Info
import
com.topjohnwu.magisk.core.model.module.LocalModule
import
com.topjohnwu.magisk.core.model.module.OnlineModule
import
com.topjohnwu.magisk.databinding.DiffRvItem
import
com.topjohnwu.magisk.databinding.ObservableDiffRvItem
import
com.topjohnwu.magisk.databinding.RvContainer
import
com.topjohnwu.magisk.databinding.set
import
com.topjohnwu.magisk.utils.asText
object
InstallModule
:
DiffRvItem
<
InstallModule
>()
{
override
val
layoutRes
=
R
.
layout
.
item_module_download
...
...
@@ -70,6 +72,13 @@ class LocalModuleRvItem(
item
.
remove
=
value
}
val
isSuspended
=
(
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
val
isModified
get
()
=
isRemoved
||
isUpdated
...
...
app/src/main/res/layout/item_module_md2.xml
View file @
ddd153c0
...
...
@@ -28,7 +28,7 @@
isEnabled=
"@{!item.removed}"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:alpha=
"@{
item.enabled
? 1f : .5f}"
android:alpha=
"@{
(item.enabled && !item.suspended)
? 1f : .5f}"
android:nextFocusRight=
"@id/module_indicator"
tools:layout_gravity=
"center"
tools:layout_margin=
"@dimen/l1"
>
...
...
@@ -94,6 +94,22 @@
app:layout_constraintStart_toEndOf=
"@+id/module_info"
app:layout_constraintTop_toTopOf=
"@+id/module_title"
/>
<TextView
android:id=
"@+id/module_suspend_text"
goneUnless=
"@{item.suspended}"
strikeThrough=
"@{item.removed}"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/l1"
android:layout_marginTop=
"@dimen/l_50"
android:layout_marginEnd=
"@dimen/l1"
android:text=
"@{item.suspendText}"
android:textAppearance=
"@style/AppearanceFoundation.Tiny.Bold"
android:textColor=
"?colorError"
app:layout_constraintTop_toBottomOf=
"@+id/module_version_author"
tools:lines=
"1"
tools:text=
"@tools:sample/lorem/random"
/>
<TextView
android:id=
"@+id/module_description"
gone=
"@{item.item.description.empty}"
...
...
@@ -105,7 +121,7 @@
android:layout_marginEnd=
"@dimen/l1"
android:text=
"@{item.item.description}"
android:textAppearance=
"@style/AppearanceFoundation.Caption.Variant"
app:layout_constraintTop_toBottomOf=
"@+id/module_
version_author
"
app:layout_constraintTop_toBottomOf=
"@+id/module_
suspend_text
"
tools:lines=
"4"
tools:text=
"@tools:sample/lorem/random"
/>
...
...
app/src/main/res/values/strings.xml
View file @
ddd153c0
...
...
@@ -123,6 +123,8 @@
<string
name=
"module_installed"
>
@string/home_installed_version
</string>
<string
name=
"module_section_online"
>
Online
</string>
<string
name=
"sorting_order"
>
Sorting Order
</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>
<!--Settings-->
<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