AppUtil: Disable self-updates for App Gallery builds

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2024-06-10 11:00:00 +05:30
parent be42199d76
commit 6210cd51ee

View File

@@ -44,7 +44,7 @@ object AppUtil {
appUpdatesList
}
if (!CertUtil.isFDroidApp(context, BuildConfig.APPLICATION_ID)) {
if (canSelfUpdate(context)) {
getSelfUpdate(context, gson)?.let { verifiedUpdatesList.add(it) }
}
@@ -71,6 +71,11 @@ object AppUtil {
}
}
private fun canSelfUpdate(context: Context): Boolean {
return !CertUtil.isFDroidApp(context, BuildConfig.APPLICATION_ID) &&
!CertUtil.isAppGalleryApp(context, BuildConfig.APPLICATION_ID)
}
private suspend fun getSelfUpdate(context: Context, gson: Gson): App? {
return withContext(Dispatchers.IO) {
@Suppress("KotlinConstantConditions") // False-positive for build type always not being release