mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-28 02:42:07 +00:00
app: use github api to check updates
This commit is contained in:
@@ -13,24 +13,28 @@ android {
|
||||
namespace = "com.topjohnwu.magisk"
|
||||
|
||||
val canary = !Config.version.contains(".")
|
||||
|
||||
val url = if (canary) null
|
||||
else "https://github.com/topjohnwu/Magisk/releases/download/v${Config.version}/Magisk-v${Config.version}.apk"
|
||||
val base = "https://github.com/topjohnwu/Magisk/releases/download/"
|
||||
val url = base + "v${Config.version}/Magisk-v${Config.version}.apk"
|
||||
val canaryUrl = base + "canary-${Config.versionCode}/"
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.topjohnwu.magisk"
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
buildConfigField("String", "APK_URL", url?.let { "\"$it\"" } ?: "null" )
|
||||
buildConfigField("String", "APK_URL", "\"$url\"")
|
||||
buildConfigField("int", "STUB_VERSION", Config.stubVersion)
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
if (canary) buildConfigField("String", "APK_URL", "\"${canaryUrl}app-release.apk\"")
|
||||
proguardFiles("proguard-rules.pro")
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = false
|
||||
}
|
||||
debug {
|
||||
if (canary) buildConfigField("String", "APK_URL", "\"${canaryUrl}app-debug.apk\"")
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
|
||||
Reference in New Issue
Block a user