Use GitHub pages URLs for public channel JSONs

This commit is contained in:
topjohnwu
2020-10-03 01:57:53 -07:00
parent 241f2656fa
commit 716f06846b
7 changed files with 34 additions and 17 deletions

View File

@@ -25,12 +25,6 @@ import static android.R.string.yes;
public class MainActivity extends Activity {
private static final boolean CANARY = !BuildConfig.VERSION_NAME.contains(".");
private static final String URL =
BuildConfig.DEV_CHANNEL != null ? BuildConfig.DEV_CHANNEL :
"https://raw.githubusercontent.com/topjohnwu/magisk_files/" +
(BuildConfig.DEBUG ? "canary/debug.json" :
(CANARY ? "canary/release.json" : "master/stable.json"));
private static final String APP_NAME = "Magisk Manager";
private String apkLink;
@@ -40,6 +34,15 @@ public class MainActivity extends Activity {
};
private Context themed;
private String URL() {
if (BuildConfig.DEV_CHANNEL != null)
return BuildConfig.DEV_CHANNEL;
else if (BuildConfig.CANARY)
return "https://raw.githubusercontent.com/topjohnwu/magisk_files/canary/release.json";
else
return "https://topjohnwu.github.io/magisk_files/stable.json";
}
private void showDialog() {
ProgressDialog.show(themed,
getString(R.string.dling),
@@ -66,7 +69,7 @@ public class MainActivity extends Activity {
themed = new ContextThemeWrapper(this, android.R.style.Theme_DeviceDefault);
if (Networking.checkNetworkStatus(this)) {
Networking.get(URL)
Networking.get(URL())
.setErrorHandler(err)
.getAsJSONObject(new JSONLoader());
} else {