fix: version code
This commit is contained in:
@@ -20,6 +20,8 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId = rootProject.ext["applicationId"].toString()
|
||||
versionCode = rootProject.ext["appVersionCode"].toString().toInt()
|
||||
versionName = rootProject.ext["appVersionName"].toString()
|
||||
minSdk = 28
|
||||
targetSdk = 34
|
||||
multiDexEnabled = true
|
||||
|
||||
@@ -157,6 +157,14 @@ class RemoteSideContext(
|
||||
fun checkForRequirements(overrideRequirements: Int? = null): Boolean {
|
||||
var requirements = overrideRequirements ?: 0
|
||||
|
||||
if(BuildConfig.DEBUG) {
|
||||
var unixTime = System.currentTimeMillis() / 1000 //unix time in seconds cuz cool
|
||||
if(BuildConfig.BUILD_DATE + 604800 < unixTime.toInt()) {
|
||||
Toast.makeText(androidContext, "This SnapEnhance build has expired.", Toast.LENGTH_LONG).show();
|
||||
throw RuntimeException("This build has expired. This crash is intentional.")
|
||||
}
|
||||
}
|
||||
|
||||
if (!config.wasPresent) {
|
||||
requirements = requirements or Requirements.FIRST_RUN
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ plugins {
|
||||
}
|
||||
|
||||
var versionName = "2.0.0"
|
||||
var versionCode = "0" //"0" for now until stable release
|
||||
var versionCode = 1 //"1" for now until stable release
|
||||
|
||||
rootProject.ext.set("appVersionName", versionName)
|
||||
rootProject.ext.set("appVersionCode", versionCode)
|
||||
|
||||
@@ -17,6 +17,7 @@ android {
|
||||
buildConfigField("String", "VERSION_NAME", "\"${rootProject.ext["appVersionName"]}\"")
|
||||
buildConfigField("int", "VERSION_CODE", "${rootProject.ext["appVersionCode"]}")
|
||||
buildConfigField("String", "APPLICATION_ID", "\"${rootProject.ext["applicationId"]}\"")
|
||||
buildConfigField("int", "BUILD_DATE", "${System.currentTimeMillis() / 1000}")
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
|
||||
Reference in New Issue
Block a user