mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix: remove unused ExpireChecker.kt and update default versionCode (#2397)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
516739f5b0
commit
9a16b54375
2 changed files with 1 additions and 58 deletions
|
|
@ -53,7 +53,7 @@ android {
|
|||
minSdk = Configs.MIN_SDK_VERSION
|
||||
targetSdk = Configs.TARGET_SDK
|
||||
versionCode = System.getenv("VERSION_CODE")?.toIntOrNull()
|
||||
?: 1
|
||||
?: 30630
|
||||
versionName = Configs.VERSION_NAME
|
||||
testInstrumentationRunner = "com.geeksville.mesh.TestRunner"
|
||||
buildConfigField("String", "MIN_FW_VERSION", "\"${Configs.MIN_FW_VERSION}\"")
|
||||
|
|
|
|||
|
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2025 Meshtastic LLC
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.geeksville.mesh.android
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.widget.Toast
|
||||
import com.geeksville.mesh.R
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Created by kevinh on 1/13/16.
|
||||
*/
|
||||
class ExpireChecker(val context: Activity) : Logging {
|
||||
|
||||
fun check(year: Int, month: Int, day: Int) {
|
||||
val expireDate = DateUtils.dateUTC(year, month, day)
|
||||
val now = Date()
|
||||
|
||||
debug("Expire check $now vs $expireDate")
|
||||
if (now.after(expireDate))
|
||||
doExpire()
|
||||
}
|
||||
|
||||
private fun doExpire() {
|
||||
val packageName = context.packageName
|
||||
errormsg("$packageName is too old and must be updated at the Play store")
|
||||
|
||||
Toast.makeText(
|
||||
context,
|
||||
R.string.app_too_old,
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
val i = Intent(Intent.ACTION_VIEW)
|
||||
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
|
||||
i.setData(Uri.parse("market://details?id=$packageName&referrer=utm_source%3Dexpired"))
|
||||
context.startActivity(i)
|
||||
context.finish()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue