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
350144df
Commit
350144df
authored
May 26, 2021
by
vvb2060
Committed by
John Wu
Aug 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not allow remove the module to be updated
parent
9ac0f11d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
LocalModule.kt
...ava/com/topjohnwu/magisk/core/model/module/LocalModule.kt
+4
-2
item_module_md2.xml
app/src/main/res/layout/item_module_md2.xml
+1
-0
util_functions.sh
scripts/util_functions.sh
+2
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/core/model/module/LocalModule.kt
View file @
350144df
...
@@ -5,6 +5,7 @@ import com.topjohnwu.superuser.Shell
...
@@ -5,6 +5,7 @@ import com.topjohnwu.superuser.Shell
import
com.topjohnwu.superuser.io.SuFile
import
com.topjohnwu.superuser.io.SuFile
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.withContext
import
kotlinx.coroutines.withContext
import
java.util.*
class
LocalModule
(
path
:
String
)
:
Module
()
{
class
LocalModule
(
path
:
String
)
:
Module
()
{
override
var
id
:
String
=
""
override
var
id
:
String
=
""
...
@@ -44,13 +45,14 @@ class LocalModule(path: String) : Module() {
...
@@ -44,13 +45,14 @@ class LocalModule(path: String) : Module() {
get
()
=
removeFile
.
exists
()
get
()
=
removeFile
.
exists
()
set
(
remove
)
{
set
(
remove
)
{
if
(
remove
)
{
if
(
remove
)
{
if
(
updateFile
.
exists
())
return
removeFile
.
createNewFile
()
removeFile
.
createNewFile
()
if
(
Const
.
Version
.
atLeast_21_2
())
if
(
Const
.
Version
.
atLeast_21_2
())
Shell
.
su
(
"copy_sepolicy_rules"
).
submit
()
Shell
.
su
(
"copy_sepolicy_rules"
).
submit
()
else
else
Shell
.
su
(
"rm -rf $PERSIST/$id"
).
submit
()
Shell
.
su
(
"rm -rf $PERSIST/$id"
).
submit
()
}
else
{
}
else
{
!
removeFile
.
delete
()
removeFile
.
delete
()
if
(
Const
.
Version
.
atLeast_21_2
())
if
(
Const
.
Version
.
atLeast_21_2
())
Shell
.
su
(
"copy_sepolicy_rules"
).
submit
()
Shell
.
su
(
"copy_sepolicy_rules"
).
submit
()
else
else
...
@@ -83,7 +85,7 @@ class LocalModule(path: String) : Module() {
...
@@ -83,7 +85,7 @@ class LocalModule(path: String) : Module() {
.
orEmpty
()
.
orEmpty
()
.
filter
{
!
it
.
isFile
}
.
filter
{
!
it
.
isFile
}
.
map
{
LocalModule
(
"${Const.MAGISK_PATH}/${it.name}"
)
}
.
map
{
LocalModule
(
"${Const.MAGISK_PATH}/${it.name}"
)
}
.
sortedBy
{
it
.
name
.
toLowerCase
(
)
}
.
sortedBy
{
it
.
name
.
lowercase
(
Locale
.
ROOT
)
}
}
}
}
}
}
}
app/src/main/res/layout/item_module_md2.xml
View file @
350144df
...
@@ -138,6 +138,7 @@
...
@@ -138,6 +138,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:clickable=
"true"
android:clickable=
"true"
android:enabled=
"@{!item.updated}"
android:focusable=
"true"
android:focusable=
"true"
android:onClick=
"@{() -> item.delete(viewModel)}"
android:onClick=
"@{() -> item.delete(viewModel)}"
android:text=
"@{item.removed ? @string/module_state_restore : @string/module_state_remove}"
android:text=
"@{item.removed ? @string/module_state_restore : @string/module_state_remove}"
...
...
scripts/util_functions.sh
View file @
350144df
...
@@ -765,6 +765,8 @@ install_module() {
...
@@ -765,6 +765,8 @@ install_module() {
if
$BOOTMODE
;
then
if
$BOOTMODE
;
then
# Update info for Magisk app
# Update info for Magisk app
mktouch
$NVBASE
/modules/
$MODID
/update
mktouch
$NVBASE
/modules/
$MODID
/update
rm
-rf
$NVBASE
/modules/
$MODID
/remove 2>/dev/null
rm
-rf
$NVBASE
/modules/
$MODID
/disable 2>/dev/null
cp
-af
$MODPATH
/module.prop
$NVBASE
/modules/
$MODID
/module.prop
cp
-af
$MODPATH
/module.prop
$NVBASE
/modules/
$MODID
/module.prop
fi
fi
...
...
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