From 6a0b2ddee9fc9f35bfbad63cbe85668fb4205330 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 5 Apr 2019 07:15:54 -0400 Subject: [PATCH] Let stub APK respect canary builds --- app/build.gradle | 4 ++-- stub/build.gradle | 2 +- stub/src/main/java/com/topjohnwu/magisk/MainActivity.java | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 8f66f54d5..64373ffe9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,8 +4,8 @@ android { defaultConfig { applicationId 'com.topjohnwu.magisk' vectorDrawables.useSupportLibrary = true - versionName rootProject.ext.configProps['appVersion'] - versionCode rootProject.ext.configProps['appVersionCode'] as Integer + versionName configProps['appVersion'] + versionCode configProps['appVersionCode'] as Integer javaCompileOptions { annotationProcessorOptions { argument('butterknife.debuggable', 'false') diff --git a/stub/build.gradle b/stub/build.gradle index 60fce7e2c..9da7df4d9 100644 --- a/stub/build.gradle +++ b/stub/build.gradle @@ -4,7 +4,7 @@ android { defaultConfig { applicationId 'com.topjohnwu.magisk' versionCode 1 - versionName "stub" + versionName configProps['appVersion'] } buildTypes { diff --git a/stub/src/main/java/com/topjohnwu/magisk/MainActivity.java b/stub/src/main/java/com/topjohnwu/magisk/MainActivity.java index 79b57894b..226611f75 100644 --- a/stub/src/main/java/com/topjohnwu/magisk/MainActivity.java +++ b/stub/src/main/java/com/topjohnwu/magisk/MainActivity.java @@ -17,7 +17,8 @@ import java.io.File; public class MainActivity extends Activity { private static final String URL = - "https://raw.githubusercontent.com/topjohnwu/magisk_files/master/stable.json"; + "https://raw.githubusercontent.com/topjohnwu/magisk_files/master/" + + (BuildConfig.VERSION_NAME.contains("-") ? "canary_builds/canary.json" : "stable.json"); private String apkLink;