AppUtil: Disable self-updates for App Gallery builds
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user