Skip to content

Commit

Permalink
version 3.3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MilosKozak committed Dec 29, 2024
1 parent 5e70688 commit dc7b777
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget

object Versions {

const val appVersion = "3.3.0-dev-g"
const val appVersion = "3.3.0.0"
const val versionCode = 1500

const val ndkVersion = "21.1.6352462"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,19 @@ class VersionCheckerUtilsImpl @Inject constructor(
try {
val definition: String = URL("https://raw.githubusercontent.com/nightscout/AndroidAPS/versions/definition.json").readText()
val version: String? = AllowedVersions().findByApi(definition, Build.VERSION.SDK_INT)?.optString("supported")
compareWithCurrentVersion(version, config.get().VERSION_NAME)
val newVersionAvailable = compareWithCurrentVersion(version, config.get().VERSION_NAME)

// App expiration
var endDate = sp.getLong(rh.gs(app.aaps.core.utils.R.string.key_app_expiration) + "_" + config.get().VERSION_NAME, 0)
AllowedVersions().findByVersion(definition, config.get().VERSION_NAME)?.let { expirationJson ->
AllowedVersions().endDateToMilliseconds(expirationJson.getString("endDate"))?.let { ed ->
endDate = ed + T.days(1).msecs()
sp.putLong(rh.gs(app.aaps.core.utils.R.string.key_app_expiration) + "_" + config.get().VERSION_NAME, endDate)
if (newVersionAvailable) {
var endDate = sp.getLong(rh.gs(app.aaps.core.utils.R.string.key_app_expiration) + "_" + config.get().VERSION_NAME, 0)
AllowedVersions().findByVersion(definition, config.get().VERSION_NAME)?.let { expirationJson ->
AllowedVersions().endDateToMilliseconds(expirationJson.getString("endDate"))?.let { ed ->
endDate = ed + T.days(1).msecs()
sp.putLong(rh.gs(app.aaps.core.utils.R.string.key_app_expiration) + "_" + config.get().VERSION_NAME, endDate)
}
}
if (endDate != 0L) onExpireDateDetected(config.get().VERSION_NAME, dateUtil.dateString(endDate))
}
if (endDate != 0L) onExpireDateDetected(config.get().VERSION_NAME, dateUtil.dateString(endDate))

} catch (e: IOException) {
aapsLogger.error(LTag.CORE, "Github master version check error: $e")
Expand Down

0 comments on commit dc7b777

Please sign in to comment.