mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-07 19:00:20 +00:00
Move manager.sh to app_functions.sh
This commit is contained in:
@@ -27,8 +27,6 @@ import com.topjohnwu.superuser.internal.UiThreadHandler
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
import kotlin.String
|
import kotlin.String
|
||||||
|
|
||||||
fun Context.rawResource(id: Int) = resources.openRawResource(id)
|
|
||||||
|
|
||||||
fun Context.getBitmap(id: Int): Bitmap {
|
fun Context.getBitmap(id: Int): Bitmap {
|
||||||
var drawable = AppCompatResources.getDrawable(this, id)!!
|
var drawable = AppCompatResources.getDrawable(this, id)!!
|
||||||
if (drawable is BitmapDrawable)
|
if (drawable is BitmapDrawable)
|
||||||
|
|||||||
@@ -1,18 +1,14 @@
|
|||||||
package com.topjohnwu.magisk.core.utils
|
package com.topjohnwu.magisk.core.utils
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import com.topjohnwu.magisk.R
|
|
||||||
import com.topjohnwu.magisk.StubApk
|
import com.topjohnwu.magisk.StubApk
|
||||||
import com.topjohnwu.magisk.core.Config
|
|
||||||
import com.topjohnwu.magisk.core.Const
|
import com.topjohnwu.magisk.core.Const
|
||||||
import com.topjohnwu.magisk.core.Info
|
import com.topjohnwu.magisk.core.Info
|
||||||
import com.topjohnwu.magisk.core.isRunningAsStub
|
import com.topjohnwu.magisk.core.isRunningAsStub
|
||||||
import com.topjohnwu.magisk.core.ktx.cachedFile
|
import com.topjohnwu.magisk.core.ktx.cachedFile
|
||||||
import com.topjohnwu.magisk.core.ktx.deviceProtectedContext
|
import com.topjohnwu.magisk.core.ktx.deviceProtectedContext
|
||||||
import com.topjohnwu.magisk.core.ktx.rawResource
|
|
||||||
import com.topjohnwu.magisk.core.ktx.writeTo
|
import com.topjohnwu.magisk.core.ktx.writeTo
|
||||||
import com.topjohnwu.superuser.Shell
|
import com.topjohnwu.superuser.Shell
|
||||||
import com.topjohnwu.superuser.ShellUtils
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@@ -67,7 +63,7 @@ class ShellInit : Shell.Initializer() {
|
|||||||
add("exec $localBB sh")
|
add("exec $localBB sh")
|
||||||
}
|
}
|
||||||
|
|
||||||
add(context.rawResource(R.raw.manager))
|
add(context.assets.open("app_functions.sh"))
|
||||||
if (shell.isRoot) {
|
if (shell.isRoot) {
|
||||||
add(context.assets.open("util_functions.sh"))
|
add(context.assets.open("util_functions.sh"))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -287,8 +287,8 @@ fun Project.setupApp() {
|
|||||||
inputs.property("versionCode", Config.versionCode)
|
inputs.property("versionCode", Config.versionCode)
|
||||||
into("src/${this@all.name}/assets")
|
into("src/${this@all.name}/assets")
|
||||||
from(rootProject.file("scripts")) {
|
from(rootProject.file("scripts")) {
|
||||||
include("util_functions.sh", "boot_patch.sh", "addon.d.sh")
|
include("util_functions.sh", "boot_patch.sh", "addon.d.sh",
|
||||||
include("uninstaller.sh", "module_installer.sh")
|
"app_functions.sh", "uninstaller.sh", "module_installer.sh")
|
||||||
}
|
}
|
||||||
from(rootProject.file("tools/bootctl"))
|
from(rootProject.file("tools/bootctl"))
|
||||||
into("chromeos") {
|
into("chromeos") {
|
||||||
|
|||||||
Reference in New Issue
Block a user