|
@@ -1,5 +1,6 @@
|
|
package eu.kanade.tachiyomi.data.updater
|
|
package eu.kanade.tachiyomi.data.updater
|
|
|
|
|
|
|
|
+import android.os.Build
|
|
import kotlinx.serialization.SerialName
|
|
import kotlinx.serialization.SerialName
|
|
import kotlinx.serialization.Serializable
|
|
import kotlinx.serialization.Serializable
|
|
|
|
|
|
@@ -22,8 +23,17 @@ class GithubRelease(
|
|
* Get download link of latest release from the assets.
|
|
* Get download link of latest release from the assets.
|
|
* @return download link of latest release.
|
|
* @return download link of latest release.
|
|
*/
|
|
*/
|
|
- val downloadLink: String
|
|
|
|
- get() = assets[0].downloadLink
|
|
|
|
|
|
+ fun getDownloadLink(): String {
|
|
|
|
+ val apkVariant = when (Build.SUPPORTED_ABIS[0]) {
|
|
|
|
+ "arm64-v8a" -> "-arm64-v8a"
|
|
|
|
+ "armeabi-v7a" -> "-armeabi-v7a"
|
|
|
|
+ "x86", "x86_64" -> "-x86"
|
|
|
|
+ else -> ""
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return assets.find { it.downloadLink.contains("tachiyomi$apkVariant-") }?.downloadLink
|
|
|
|
+ ?: assets[0].downloadLink
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* Assets class containing download url.
|
|
* Assets class containing download url.
|