Skip to content

Commit

Permalink
fix version checker
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnyro committed Jul 21, 2022
1 parent 1f453c0 commit 56b7a8e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
3 changes: 3 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@
#uncomment for debug
#-keepnames class **
-keep class com.github.libretube.obj.** { *; }

# prevents android from removing it
-keep class com.github.libretube.update.** { <fields>; }
16 changes: 8 additions & 8 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
],
"attributes": [],
"versionCode": 14,
"versionCode": 15,
"versionName": "0.4.1",
"outputFile": "app-x86_64-release.apk"
},
Expand All @@ -29,7 +29,7 @@
}
],
"attributes": [],
"versionCode": 14,
"versionCode": 15,
"versionName": "0.4.1",
"outputFile": "app-x86-release.apk"
},
Expand All @@ -38,26 +38,26 @@
"filters": [
{
"filterType": "ABI",
"value": "armeabi-v7a"
"value": "arm64-v8a"
}
],
"attributes": [],
"versionCode": 14,
"versionCode": 15,
"versionName": "0.4.1",
"outputFile": "app-armeabi-v7a-release.apk"
"outputFile": "app-arm64-v8a-release.apk"
},
{
"type": "ONE_OF_MANY",
"filters": [
{
"filterType": "ABI",
"value": "arm64-v8a"
"value": "armeabi-v7a"
}
],
"attributes": [],
"versionCode": 14,
"versionCode": 15,
"versionName": "0.4.1",
"outputFile": "app-arm64-v8a-release.apk"
"outputFile": "app-armeabi-v7a-release.apk"
}
],
"elementType": "File"
Expand Down
14 changes: 11 additions & 3 deletions app/src/main/java/com/github/libretube/preferences/MainSettings.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.github.libretube.preferences

import android.os.Bundle
import android.util.Log
import androidx.fragment.app.Fragment
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
Expand Down Expand Up @@ -82,8 +81,17 @@ class MainSettings : PreferenceFragmentCompat() {
CoroutineScope(Dispatchers.IO).launch {
// check for update
val updateInfo = UpdateChecker.getLatestReleaseInfo()
Log.e(TAG, updateInfo?.name.toString())
if (updateInfo?.name != null && BuildConfig.VERSION_NAME != updateInfo?.name) {
if (updateInfo?.name == null) {
// request failed
val settingsActivity = activity as SettingsActivity
val snackBar = Snackbar
.make(
settingsActivity.binding.root,
R.string.unknown_error,
Snackbar.LENGTH_SHORT
)
snackBar.show()
} else if (BuildConfig.VERSION_NAME != updateInfo.name) {
// show the UpdateAvailableDialog if there's an update available
val updateAvailableDialog = UpdateDialog(updateInfo)
updateAvailableDialog.show(childFragmentManager, "UpdateAvailableDialog")
Expand Down

0 comments on commit 56b7a8e

Please sign in to comment.