From 2360adb59231b8ef8ec263ac5f0d5dd3a076a1b2 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sun, 3 Feb 2019 16:11:47 -0500 Subject: [PATCH] Move bootctl binary out of Magisk Manager source Close #1023 --- .../main/java/com/topjohnwu/magisk/Const.java | 10 +++++++--- .../topjohnwu/magisk/tasks/MagiskInstaller.java | 2 +- app-core/src/main/res/raw/bootctl | Bin 19832 -> 0 bytes 3 files changed, 8 insertions(+), 4 deletions(-) delete mode 100644 app-core/src/main/res/raw/bootctl 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 74f359ada0d11565009e2993883f9c7fdfceb5cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19832 zcmeHPdt6j?+W*ZA>WG>ska&whEb#&Yc>%8@m%OF~n3uJNff<-lU}$Dg3^ysQ&@Stg zn^tC|)dEXKo0hs>!8WvPwbIP22F=21ixQPdao+E9&iTRN#Ju%>cHj4p_v7(1KIi%V zp4;#FUCwi6&S7QptUJ^y72}77z0HX8>n$RBsbS|G(g}#3#j&pVzd!58I)nEUFtJ@P z610j(vt*i6t%PepNiR+<0!kVz$#KdfB-%-8>xkrz6j4rDfXI^`#acH`KlDhq;@5Z6U`u#;z6=>q?~t}=)5FKV1Grw7h%RJ z*SiaP6zBi+NR{+_e_~!Tz41AX9nA9$7z{7E19ZXfv1K5&l@yc;HT0QM}QC93p*XjGl$de zv=!#ES<@2|S*|rRE6QPG1_PZLtoc?a&h6$LD;AyIV032N>`R!rNPx47j6eh?yTESE z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