Rename rules to preinit

It is possible that we will allow more preinit files for modules.
Rename the partition and folders from rules to preinit.
This commit is contained in:
topjohnwu
2023-03-16 04:07:00 -07:00
committed by John Wu
parent 7048aa1014
commit 4e2b88b3d0
18 changed files with 110 additions and 118 deletions

View File

@@ -43,10 +43,10 @@ data class LocalModule(
set(enable) {
if (enable) {
disableFile.delete()
Shell.cmd("copy_rules").submit()
Shell.cmd("copy_preinit_files").submit()
} else {
!disableFile.createNewFile()
Shell.cmd("copy_rules").submit()
Shell.cmd("copy_preinit_files").submit()
}
}
@@ -56,10 +56,10 @@ data class LocalModule(
if (remove) {
if (updateFile.exists()) return
removeFile.createNewFile()
Shell.cmd("copy_rules").submit()
Shell.cmd("copy_preinit_files").submit()
} else {
removeFile.delete()
Shell.cmd("copy_rules").submit()
Shell.cmd("copy_preinit_files").submit()
}
}

View File

@@ -41,7 +41,7 @@ class ShellInit : Shell.Initializer() {
}
if (shell.isRoot) {
add("export MAGISKTMP=\$(magisk --path)/.magisk")
add("export MAGISKTMP=\$(magisk --path)")
// Test if we can properly execute stuff in /data
Info.noDataExec = !shell.newJob().add("$localBB sh -c \"$localBB true\"").exec().isSuccess
}
@@ -49,9 +49,9 @@ class ShellInit : Shell.Initializer() {
if (Info.noDataExec) {
// Copy it out of /data to workaround Samsung bullshit
add(
"if [ -x \$MAGISKTMP/busybox/busybox ]; then",
" cp -af $localBB \$MAGISKTMP/busybox/busybox",
" exec \$MAGISKTMP/busybox/busybox sh",
"if [ -x \$MAGISKTMP/.magisk/busybox/busybox ]; then",
" cp -af $localBB \$MAGISKTMP/.magisk/busybox/busybox",
" exec \$MAGISKTMP/.magisk/busybox/busybox sh",
"else",
" cp -af $localBB /dev/busybox",
" exec /dev/busybox sh",