mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
fix version checker
This commit is contained in:
parent
1f453c0cec
commit
56b7a8e5cc
3
app/proguard-rules.pro
vendored
3
app/proguard-rules.pro
vendored
@ -22,3 +22,6 @@
|
|||||||
#uncomment for debug
|
#uncomment for debug
|
||||||
#-keepnames class **
|
#-keepnames class **
|
||||||
-keep class com.github.libretube.obj.** { *; }
|
-keep class com.github.libretube.obj.** { *; }
|
||||||
|
|
||||||
|
# prevents android from removing it
|
||||||
|
-keep class com.github.libretube.update.** { <fields>; }
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 14,
|
"versionCode": 15,
|
||||||
"versionName": "0.4.1",
|
"versionName": "0.4.1",
|
||||||
"outputFile": "app-x86_64-release.apk"
|
"outputFile": "app-x86_64-release.apk"
|
||||||
},
|
},
|
||||||
@ -29,23 +29,10 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 14,
|
"versionCode": 15,
|
||||||
"versionName": "0.4.1",
|
"versionName": "0.4.1",
|
||||||
"outputFile": "app-x86-release.apk"
|
"outputFile": "app-x86-release.apk"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "ONE_OF_MANY",
|
|
||||||
"filters": [
|
|
||||||
{
|
|
||||||
"filterType": "ABI",
|
|
||||||
"value": "armeabi-v7a"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"attributes": [],
|
|
||||||
"versionCode": 14,
|
|
||||||
"versionName": "0.4.1",
|
|
||||||
"outputFile": "app-armeabi-v7a-release.apk"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "ONE_OF_MANY",
|
"type": "ONE_OF_MANY",
|
||||||
"filters": [
|
"filters": [
|
||||||
@ -55,9 +42,22 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 14,
|
"versionCode": 15,
|
||||||
"versionName": "0.4.1",
|
"versionName": "0.4.1",
|
||||||
"outputFile": "app-arm64-v8a-release.apk"
|
"outputFile": "app-arm64-v8a-release.apk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "ONE_OF_MANY",
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
"filterType": "ABI",
|
||||||
|
"value": "armeabi-v7a"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": [],
|
||||||
|
"versionCode": 15,
|
||||||
|
"versionName": "0.4.1",
|
||||||
|
"outputFile": "app-armeabi-v7a-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"elementType": "File"
|
"elementType": "File"
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.github.libretube.preferences
|
package com.github.libretube.preferences
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.Log
|
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.preference.Preference
|
import androidx.preference.Preference
|
||||||
import androidx.preference.PreferenceFragmentCompat
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
@ -82,8 +81,17 @@ class MainSettings : PreferenceFragmentCompat() {
|
|||||||
CoroutineScope(Dispatchers.IO).launch {
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
// check for update
|
// check for update
|
||||||
val updateInfo = UpdateChecker.getLatestReleaseInfo()
|
val updateInfo = UpdateChecker.getLatestReleaseInfo()
|
||||||
Log.e(TAG, updateInfo?.name.toString())
|
if (updateInfo?.name == null) {
|
||||||
if (updateInfo?.name != null && BuildConfig.VERSION_NAME != updateInfo?.name) {
|
// 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
|
// show the UpdateAvailableDialog if there's an update available
|
||||||
val updateAvailableDialog = UpdateDialog(updateInfo)
|
val updateAvailableDialog = UpdateDialog(updateInfo)
|
||||||
updateAvailableDialog.show(childFragmentManager, "UpdateAvailableDialog")
|
updateAvailableDialog.show(childFragmentManager, "UpdateAvailableDialog")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user