UpdateWorker: Compare version codes for nightly self-updates as well
This will break nightly self-updates untill server address this but that's better than users complaining everyday. Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
import java.time.Instant
|
||||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
@@ -52,7 +51,6 @@ android {
|
||||
|
||||
testInstrumentationRunner = "com.aurora.store.HiltInstrumentationTestRunner"
|
||||
testInstrumentationRunnerArguments["disableAnalytics"] = "true"
|
||||
buildConfigField("long", "TIMESTAMP", "${Instant.now().epochSecond}")
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
|
||||
@@ -193,8 +193,8 @@ class UpdateWorker @AssistedInject constructor(
|
||||
)
|
||||
|
||||
val isUpdate = when (buildType) {
|
||||
BuildType.NIGHTLY,
|
||||
BuildType.RELEASE -> selfUpdate.versionCode > BuildConfig.VERSION_CODE
|
||||
BuildType.NIGHTLY -> selfUpdate.timestamp > BuildConfig.TIMESTAMP
|
||||
else -> false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user