This commit is contained in:
Mygod
2021-10-29 23:38:45 -04:00
parent 4aee4e6549
commit c4b3362ee0
2 changed files with 6 additions and 6 deletions

View File

@@ -23,8 +23,8 @@ android {
minSdk = 21
targetSdk = 29
resourceConfigurations.addAll(arrayOf("it", "ru", "zh-rCN", "zh-rTW"))
versionCode = 280
versionName = "2.13.0"
versionCode = 282
versionName = "2.13.1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions.annotationProcessorOptions.arguments.apply {
put("room.expandProjection", "true")

View File

@@ -78,13 +78,13 @@ object UpdateChecker {
app.pref.edit {
try {
conn.setRequestProperty("Accept", "application/vnd.github.v3+json")
reset = conn.getHeaderField("X-RateLimit-Reset")?.toLongOrNull()
val update = findUpdate(JSONArray(withContext(Dispatchers.IO) {
reset = conn.getHeaderField("X-RateLimit-Reset")?.toLongOrNull()
conn.inputStream.bufferedReader().readText()
}))
putLong(KEY_PUBLISHED, if (update == null) -1 else {
putString(KEY_VERSION, update.message)
update.published
putString(KEY_VERSION, update?.let {
putLong(KEY_PUBLISHED, update.published)
it.message
})
emit(update)
} catch (_: CancellationException) {