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
984f32f9
Commit
984f32f9
authored
Dec 19, 2020
by
vvb2060
Committed by
topjohnwu
Dec 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move copy_sepolicy_rules to manager
We don’t need it when patch boot
parent
eee7f097
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
MagiskInstaller.kt
...n/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt
+12
-3
boot_patch.sh
scripts/boot_patch.sh
+0
-3
No files found.
app/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt
View file @
984f32f9
...
@@ -10,6 +10,7 @@ import androidx.core.os.postDelayed
...
@@ -10,6 +10,7 @@ import androidx.core.os.postDelayed
import
androidx.localbroadcastmanager.content.LocalBroadcastManager
import
androidx.localbroadcastmanager.content.LocalBroadcastManager
import
com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.core.Config
import
com.topjohnwu.magisk.core.Config
import
com.topjohnwu.magisk.core.Info
import
com.topjohnwu.magisk.core.utils.MediaStoreUtils
import
com.topjohnwu.magisk.core.utils.MediaStoreUtils
import
com.topjohnwu.magisk.core.utils.MediaStoreUtils.inputStream
import
com.topjohnwu.magisk.core.utils.MediaStoreUtils.inputStream
import
com.topjohnwu.magisk.core.utils.MediaStoreUtils.outputStream
import
com.topjohnwu.magisk.core.utils.MediaStoreUtils.outputStream
...
@@ -339,6 +340,13 @@ abstract class MagiskInstallImpl : KoinComponent {
...
@@ -339,6 +340,13 @@ abstract class MagiskInstallImpl : KoinComponent {
return
true
return
true
}
}
private
fun
copySepolicyRules
():
Boolean
{
if
(
Info
.
remote
.
magisk
.
versionCode
>=
21100
)
return
true
// Copy existing rules for migration
"copy_sepolicy_rules"
.
sh
()
return
true
}
private
fun
flashBoot
():
Boolean
{
private
fun
flashBoot
():
Boolean
{
if
(!
"direct_install $installDir $srcBoot"
.
sh
().
isSuccess
)
if
(!
"direct_install $installDir $srcBoot"
.
sh
().
isSuccess
)
return
false
return
false
...
@@ -373,10 +381,11 @@ abstract class MagiskInstallImpl : KoinComponent {
...
@@ -373,10 +381,11 @@ abstract class MagiskInstallImpl : KoinComponent {
protected
fun
doPatchFile
(
patchFile
:
Uri
)
=
extractZip
()
&&
handleFile
(
patchFile
)
protected
fun
doPatchFile
(
patchFile
:
Uri
)
=
extractZip
()
&&
handleFile
(
patchFile
)
protected
fun
direct
()
=
findImage
()
&&
extractZip
()
&&
patchBoot
()
&&
flashBoot
()
protected
fun
direct
()
=
findImage
()
&&
extractZip
()
&&
patchBoot
()
&&
copySepolicyRules
()
&&
flashBoot
()
protected
suspend
fun
secondSlot
()
=
protected
suspend
fun
secondSlot
()
=
findSecondaryImage
()
&&
extractZip
()
&&
findSecondaryImage
()
&&
extractZip
()
&&
patchBoot
()
&&
flashBoot
()
&&
postOTA
()
patchBoot
()
&&
copySepolicyRules
()
&&
flashBoot
()
&&
postOTA
()
protected
fun
fixEnv
(
zip
:
Uri
):
Boolean
{
protected
fun
fixEnv
(
zip
:
Uri
):
Boolean
{
installDir
=
SuFile
(
"/data/adb/magisk"
)
installDir
=
SuFile
(
"/data/adb/magisk"
)
...
...
scripts/boot_patch.sh
View file @
984f32f9
...
@@ -185,8 +185,5 @@ ui_print "- Repacking boot image"
...
@@ -185,8 +185,5 @@ ui_print "- Repacking boot image"
# Sign chromeos boot
# Sign chromeos boot
$CHROMEOS
&&
sign_chromeos
$CHROMEOS
&&
sign_chromeos
# Copy existing rules for migration
$BOOTMODE
&&
copy_sepolicy_rules
# Reset any error code
# Reset any error code
true
true
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