diff --git a/app/src/main/java/com/topjohnwu/magisk/core/Const.kt b/app/src/main/java/com/topjohnwu/magisk/core/Const.kt index e45b6a918..7a9327282 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/Const.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/Const.kt @@ -20,9 +20,6 @@ object Const { const val TMPDIR = "/dev/tmp" const val MAGISK_LOG = "/cache/magisk.log" - // Versions - const val BOOTCTL_REVISION = "22.0" - // Misc val USER_ID = Process.myUid() / 100000 val APP_IS_CANARY get() = Version.isCanary(BuildConfig.VERSION_CODE) diff --git a/app/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt b/app/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt index 5478d0f17..2f9b84ac1 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt @@ -388,10 +388,10 @@ abstract class MagiskInstallImpl protected constructor( private fun flashBoot() = "direct_install $installDir $srcBoot".sh().isSuccess - private suspend fun postOTA(): Boolean { + private fun postOTA(): Boolean { try { val bootctl = File.createTempFile("bootctl", null, context.cacheDir) - service.fetchBootctl().byteStream().writeTo(bootctl) + context.assets.open("bootctl").writeTo(bootctl) "post_ota $bootctl".sh() } catch (e: IOException) { console.add("! Unable to download bootctl") diff --git a/app/src/main/java/com/topjohnwu/magisk/data/network/NetworkServices.kt b/app/src/main/java/com/topjohnwu/magisk/data/network/NetworkServices.kt index eba3f0ac1..39f0683d1 100644 --- a/app/src/main/java/com/topjohnwu/magisk/data/network/NetworkServices.kt +++ b/app/src/main/java/com/topjohnwu/magisk/data/network/NetworkServices.kt @@ -1,6 +1,5 @@ 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.UpdateInfo import okhttp3.ResponseBody @@ -11,7 +10,6 @@ private const val BRANCH = "branch" private const val REPO = "repo" private const val FILE = "file" -const val MAGISK_FILES = "topjohnwu/magisk-files" const val MAGISK_MAIN = "topjohnwu/Magisk" interface GithubPageServices { @@ -22,10 +20,6 @@ interface GithubPageServices { 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") @Streaming suspend fun fetchInstaller(@Path(REVISION) revision: String): ResponseBody diff --git a/app/src/main/java/com/topjohnwu/magisk/data/repository/NetworkService.kt b/app/src/main/java/com/topjohnwu/magisk/data/repository/NetworkService.kt index 88f2dc222..b1662843f 100644 --- a/app/src/main/java/com/topjohnwu/magisk/data/repository/NetworkService.kt +++ b/app/src/main/java/com/topjohnwu/magisk/data/repository/NetworkService.kt @@ -59,7 +59,6 @@ class NetworkService( } // Fetch files - suspend fun fetchBootctl() = wrap { jsd.fetchBootctl() } suspend fun fetchInstaller() = wrap { val sha = fetchMainVersion() jsd.fetchInstaller(sha) diff --git a/buildSrc/src/main/java/Setup.kt b/buildSrc/src/main/java/Setup.kt index e076ad776..5da9cef1f 100644 --- a/buildSrc/src/main/java/Setup.kt +++ b/buildSrc/src/main/java/Setup.kt @@ -125,6 +125,7 @@ fun Project.setupApp() { from(rootProject.file("scripts")) { include("util_functions.sh", "boot_patch.sh", "uninstaller.sh", "addon.d.sh") } + from(rootProject.file("tools/bootctl")) into("chromeos") { from(rootProject.file("tools/futility")) from(rootProject.file("tools/keys")) { diff --git a/tools/bootctl b/tools/bootctl new file mode 100644 index 000000000..cf5c61368 Binary files /dev/null and b/tools/bootctl differ diff --git a/tools/bootctl.patch b/tools/bootctl.patch new file mode 100755 index 000000000..17353a2a3 Binary files /dev/null and b/tools/bootctl.patch differ