Skip to content

Commit 2ae5b6c

Browse files
committed
fixed the fucking updater 💀
1 parent 0d2a19b commit 2ae5b6c

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ android {
5858
minSdk = 21
5959
targetSdk = 33
6060

61-
versionCode = 61
62-
versionName = "4.1.10"
61+
versionCode = 62
62+
versionName = "4.2.0"
6363

6464
resValue("string", "app_version", "${defaultConfig.versionName}${versionNameSuffix ?: ""}")
6565
resValue("string", "commit_hash", "git rev-parse --short HEAD".execute() ?: "")

app/src/main/java/com/lagradost/cloudstream3/utils/InAppUpdater.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,19 @@ class InAppUpdater {
109109
releases.sortedWith(compareBy {
110110
versionRegex.find(it.name)?.groupValues?.get(2)
111111
}).toList().lastOrNull()*/
112-
val found =
112+
val foundList =
113113
response.filter { rel ->
114114
!rel.prerelease
115115
}.sortedWith(compareBy { release ->
116-
release.assets.filter { it.content_type == "application/vnd.android.package-archive" }
117-
.getOrNull(0)?.name?.let { it1 ->
116+
release.assets.firstOrNull { it.content_type == "application/vnd.android.package-archive" }?.name?.let { it1 ->
118117
versionRegex.find(
119118
it1
120-
)?.groupValues?.get(2)
119+
)?.groupValues?.let {
120+
it[3].toInt() * 100_000_000 + it[4].toInt() * 10_000 + it[5].toInt()
121+
}
121122
}
122-
}).toList().lastOrNull()
123-
123+
}).toList()
124+
val found = foundList.lastOrNull()
124125
val foundAsset = found?.assets?.getOrNull(0)
125126
val currentVersion = packageName?.let {
126127
packageManager.getPackageInfo(

0 commit comments

Comments
 (0)