diff --git a/app-core/src/main/java/com/topjohnwu/magisk/Const.java b/app-core/src/main/java/com/topjohnwu/magisk/Const.java index ea646b51d..4a72fb106 100644 --- a/app-core/src/main/java/com/topjohnwu/magisk/Const.java +++ b/app-core/src/main/java/com/topjohnwu/magisk/Const.java @@ -66,8 +66,11 @@ public class Const { } public static class Url { - public static final String STABLE_URL = "https://raw.githubusercontent.com/topjohnwu/magisk_files/master/stable.json"; - public static final String BETA_URL = "https://raw.githubusercontent.com/topjohnwu/magisk_files/master/beta.json"; + private static String getRaw(String where, String name) { + return String.format("https://raw.githubusercontent.com/topjohnwu/magisk_files/%s/%s", where, name); + } + public static final String STABLE_URL = getRaw("master", "stable.json"); + public static final String BETA_URL = getRaw("master", "beta.json"); public static final String REPO_URL = "https://api.github.com/users/Magisk-Modules-Repo/repos?per_page=100&sort=pushed&page=%d"; public static final String FILE_URL = "https://raw.githubusercontent.com/Magisk-Modules-Repo/%s/master/%s"; public static final String ZIP_URL = "https://github.com/Magisk-Modules-Repo/%s/archive/master.zip"; @@ -76,7 +79,8 @@ public class Const { public static final String TWITTER_URL = "https://twitter.com/topjohnwu"; public static final String XDA_THREAD = "http://forum.xda-developers.com/showthread.php?t=3432382"; public static final String SOURCE_CODE_URL = "https://github.com/topjohnwu/Magisk"; - public static final String SNET_URL = "https://raw.githubusercontent.com/topjohnwu/magisk_files/b66b1a914978e5f4c4bbfd74a59f4ad371bac107/snet.apk"; + public static final String SNET_URL = getRaw("b66b1a914978e5f4c4bbfd74a59f4ad371bac107", "snet.apk"); + public static final String BOOTCTL_URL = getRaw("9c5dfc1b8245c0b5b524901ef0ff0f8335757b77", "bootctl"); } public static class Key { diff --git a/app-core/src/main/java/com/topjohnwu/magisk/tasks/MagiskInstaller.java b/app-core/src/main/java/com/topjohnwu/magisk/tasks/MagiskInstaller.java index c5c47e4f9..75c3ab9d2 100644 --- a/app-core/src/main/java/com/topjohnwu/magisk/tasks/MagiskInstaller.java +++ b/app-core/src/main/java/com/topjohnwu/magisk/tasks/MagiskInstaller.java @@ -286,7 +286,7 @@ public abstract class MagiskInstaller { protected boolean postOTA() { SuFile bootctl = new SuFile("/data/adb/bootctl"); - try (InputStream in = App.self.getResources().openRawResource(R.raw.bootctl); + try (InputStream in = Networking.get(Const.Url.BOOTCTL_URL).execForInputStream().getResult(); OutputStream out = new SuFileOutputStream(bootctl)) { ShellUtils.pump(in, out); } catch (IOException e) { diff --git a/app-core/src/main/res/raw/bootctl b/app-core/src/main/res/raw/bootctl deleted file mode 100644 index 74f359ada..000000000 Binary files a/app-core/src/main/res/raw/bootctl and /dev/null differ