diff --git a/app/src/full/java/com/topjohnwu/magisk/Const.java b/app/src/full/java/com/topjohnwu/magisk/Const.java index 65d736241..0e76c8a5e 100644 --- a/app/src/full/java/com/topjohnwu/magisk/Const.java +++ b/app/src/full/java/com/topjohnwu/magisk/Const.java @@ -36,6 +36,7 @@ public class Const { // Versions public static final int UPDATE_SERVICE_VER = 1; public static final int MIN_MODULE_VER = 1500; + public static final int SNET_EXT_VER = 12; /* A list of apps that should not be shown as hide-able */ public static final List HIDE_BLACKLIST = Arrays.asList( @@ -79,6 +80,7 @@ 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"; } diff --git a/app/src/full/java/com/topjohnwu/magisk/Data.java b/app/src/full/java/com/topjohnwu/magisk/Data.java index 93607aa3b..0f2d1485d 100644 --- a/app/src/full/java/com/topjohnwu/magisk/Data.java +++ b/app/src/full/java/com/topjohnwu/magisk/Data.java @@ -47,8 +47,6 @@ public class Data { public static String managerLink; public static String managerNoteLink; public static String uninstallerLink; - public static int snetVersionCode; - public static String snetLink; // Install flags public static boolean keepVerity = false; diff --git a/app/src/full/java/com/topjohnwu/magisk/asyncs/CheckSafetyNet.java b/app/src/full/java/com/topjohnwu/magisk/asyncs/CheckSafetyNet.java index 4ce06d544..afbe164d4 100644 --- a/app/src/full/java/com/topjohnwu/magisk/asyncs/CheckSafetyNet.java +++ b/app/src/full/java/com/topjohnwu/magisk/asyncs/CheckSafetyNet.java @@ -2,6 +2,7 @@ package com.topjohnwu.magisk.asyncs; import android.app.Activity; +import com.topjohnwu.magisk.Const; import com.topjohnwu.magisk.Data; import com.topjohnwu.magisk.utils.ISafetyNetHelper; import com.topjohnwu.magisk.utils.Topic; @@ -32,7 +33,7 @@ public class CheckSafetyNet extends ParallelTask { private void dlSnet() throws Exception { Shell.sh("rm -rf " + dexPath.getParent()).exec(); dexPath.getParentFile().mkdir(); - HttpURLConnection conn = WebService.mustRequest(Data.snetLink); + HttpURLConnection conn = WebService.mustRequest(Const.Url.SNET_URL); try ( OutputStream out = new BufferedOutputStream(new FileOutputStream(dexPath)); InputStream in = new BufferedInputStream(conn.getInputStream())) { @@ -51,7 +52,7 @@ public class CheckSafetyNet extends ParallelTask { .invoke(null, ISafetyNetHelper.class, dexPath.getPath(), getActivity(), (ISafetyNetHelper.Callback) code -> Topic.publish(false, Topic.SNET_CHECK_DONE, code)); - if (helper.getVersion() < Data.snetVersionCode) { + if (helper.getVersion() < Const.SNET_EXT_VER) { throw new Exception(); } } diff --git a/app/src/full/java/com/topjohnwu/magisk/asyncs/CheckUpdates.java b/app/src/full/java/com/topjohnwu/magisk/asyncs/CheckUpdates.java index 0c01e07ae..7f5ecf26f 100644 --- a/app/src/full/java/com/topjohnwu/magisk/asyncs/CheckUpdates.java +++ b/app/src/full/java/com/topjohnwu/magisk/asyncs/CheckUpdates.java @@ -90,10 +90,6 @@ public class CheckUpdates { JSONObject uninstaller = getJson(json, "uninstaller"); Data.uninstallerLink = getString(uninstaller, "link", null); - JSONObject snet = getJson(json, "snet"); - Data.snetVersionCode = getInt(snet, "versionCode", -1); - Data.snetLink = getString(snet, "link", null); - if (cb != null) { if (BuildConfig.VERSION_CODE < Data.remoteManagerVersionCode) { Notifications.managerUpdate();