|
|
@@ -1,6 +1,8 @@
|
|
|
package com.adealink.weparty.update.data
|
|
|
|
|
|
import com.adealink.frame.util.PackageUtil
|
|
|
+import com.adealink.frame.util.safeToInt
|
|
|
+import com.adealink.frame.util.safeToLong
|
|
|
import com.google.gson.annotations.GsonNullable
|
|
|
import com.google.gson.annotations.SerializedName
|
|
|
|
|
|
@@ -23,7 +25,18 @@ data class ForceUpdateData(
|
|
|
return false
|
|
|
}
|
|
|
for (i in 0 until 3) {
|
|
|
- return currentVersion[i] < updateVersion[i]
|
|
|
+ val current = currentVersion[i].safeToInt(-1)
|
|
|
+ val next = updateVersion[i].safeToInt(-1)
|
|
|
+ if (current == -1 || next == -1) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return if (current > next) {
|
|
|
+ false
|
|
|
+ } else if (current == next) {
|
|
|
+ continue
|
|
|
+ } else {
|
|
|
+ true
|
|
|
+ }
|
|
|
}
|
|
|
return false
|
|
|
}
|