Update bootctl

Close #5134
This commit is contained in:
topjohnwu 2022-01-13 02:24:02 -08:00
parent 21505a7470
commit 9c93fe6003
7 changed files with 3 additions and 12 deletions

View File

@ -20,9 +20,6 @@ object Const {
const val TMPDIR = "/dev/tmp" const val TMPDIR = "/dev/tmp"
const val MAGISK_LOG = "/cache/magisk.log" const val MAGISK_LOG = "/cache/magisk.log"
// Versions
const val BOOTCTL_REVISION = "22.0"
// Misc // Misc
val USER_ID = Process.myUid() / 100000 val USER_ID = Process.myUid() / 100000
val APP_IS_CANARY get() = Version.isCanary(BuildConfig.VERSION_CODE) val APP_IS_CANARY get() = Version.isCanary(BuildConfig.VERSION_CODE)

View File

@ -388,10 +388,10 @@ abstract class MagiskInstallImpl protected constructor(
private fun flashBoot() = "direct_install $installDir $srcBoot".sh().isSuccess private fun flashBoot() = "direct_install $installDir $srcBoot".sh().isSuccess
private suspend fun postOTA(): Boolean { private fun postOTA(): Boolean {
try { try {
val bootctl = File.createTempFile("bootctl", null, context.cacheDir) val bootctl = File.createTempFile("bootctl", null, context.cacheDir)
service.fetchBootctl().byteStream().writeTo(bootctl) context.assets.open("bootctl").writeTo(bootctl)
"post_ota $bootctl".sh() "post_ota $bootctl".sh()
} catch (e: IOException) { } catch (e: IOException) {
console.add("! Unable to download bootctl") console.add("! Unable to download bootctl")

View File

@ -1,6 +1,5 @@
package com.topjohnwu.magisk.data.network package com.topjohnwu.magisk.data.network
import com.topjohnwu.magisk.core.Const
import com.topjohnwu.magisk.core.model.BranchInfo import com.topjohnwu.magisk.core.model.BranchInfo
import com.topjohnwu.magisk.core.model.UpdateInfo import com.topjohnwu.magisk.core.model.UpdateInfo
import okhttp3.ResponseBody import okhttp3.ResponseBody
@ -11,7 +10,6 @@ private const val BRANCH = "branch"
private const val REPO = "repo" private const val REPO = "repo"
private const val FILE = "file" private const val FILE = "file"
const val MAGISK_FILES = "topjohnwu/magisk-files"
const val MAGISK_MAIN = "topjohnwu/Magisk" const val MAGISK_MAIN = "topjohnwu/Magisk"
interface GithubPageServices { interface GithubPageServices {
@ -22,10 +20,6 @@ interface GithubPageServices {
interface JSDelivrServices { interface JSDelivrServices {
@GET("$MAGISK_FILES@{$REVISION}/bootctl")
@Streaming
suspend fun fetchBootctl(@Path(REVISION) revision: String = Const.BOOTCTL_REVISION): ResponseBody
@GET("$MAGISK_MAIN@{$REVISION}/scripts/module_installer.sh") @GET("$MAGISK_MAIN@{$REVISION}/scripts/module_installer.sh")
@Streaming @Streaming
suspend fun fetchInstaller(@Path(REVISION) revision: String): ResponseBody suspend fun fetchInstaller(@Path(REVISION) revision: String): ResponseBody

View File

@ -59,7 +59,6 @@ class NetworkService(
} }
// Fetch files // Fetch files
suspend fun fetchBootctl() = wrap { jsd.fetchBootctl() }
suspend fun fetchInstaller() = wrap { suspend fun fetchInstaller() = wrap {
val sha = fetchMainVersion() val sha = fetchMainVersion()
jsd.fetchInstaller(sha) jsd.fetchInstaller(sha)

View File

@ -125,6 +125,7 @@ fun Project.setupApp() {
from(rootProject.file("scripts")) { from(rootProject.file("scripts")) {
include("util_functions.sh", "boot_patch.sh", "uninstaller.sh", "addon.d.sh") include("util_functions.sh", "boot_patch.sh", "uninstaller.sh", "addon.d.sh")
} }
from(rootProject.file("tools/bootctl"))
into("chromeos") { into("chromeos") {
from(rootProject.file("tools/futility")) from(rootProject.file("tools/futility"))
from(rootProject.file("tools/keys")) { from(rootProject.file("tools/keys")) {

BIN
tools/bootctl Normal file

Binary file not shown.

BIN
tools/bootctl.patch Executable file

Binary file not shown.