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
|
import java.util.Properties
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
@@ -52,7 +51,6 @@ android {
|
|||||||
|
|
||||||
testInstrumentationRunner = "com.aurora.store.HiltInstrumentationTestRunner"
|
testInstrumentationRunner = "com.aurora.store.HiltInstrumentationTestRunner"
|
||||||
testInstrumentationRunnerArguments["disableAnalytics"] = "true"
|
testInstrumentationRunnerArguments["disableAnalytics"] = "true"
|
||||||
buildConfigField("long", "TIMESTAMP", "${Instant.now().epochSecond}")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
|
|||||||
@@ -193,8 +193,8 @@ class UpdateWorker @AssistedInject constructor(
|
|||||||
)
|
)
|
||||||
|
|
||||||
val isUpdate = when (buildType) {
|
val isUpdate = when (buildType) {
|
||||||
|
BuildType.NIGHTLY,
|
||||||
BuildType.RELEASE -> selfUpdate.versionCode > BuildConfig.VERSION_CODE
|
BuildType.RELEASE -> selfUpdate.versionCode > BuildConfig.VERSION_CODE
|
||||||
BuildType.NIGHTLY -> selfUpdate.timestamp > BuildConfig.TIMESTAMP
|
|
||||||
else -> false
|
else -> false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user