diff --git a/app/src/main/java/foundation/e/apps/data/playstore/utils/NativeDeviceInfoProviderModule.kt b/app/src/main/java/foundation/e/apps/data/playstore/utils/NativeDeviceInfoProviderModule.kt index 4090902900c78d26857f83f18b288042df040e06..7de6c0cf616d7f1a0decc93910f441d4619b4b87 100644 --- a/app/src/main/java/foundation/e/apps/data/playstore/utils/NativeDeviceInfoProviderModule.kt +++ b/app/src/main/java/foundation/e/apps/data/playstore/utils/NativeDeviceInfoProviderModule.kt @@ -64,7 +64,7 @@ object NativeDeviceInfoProviderModule { val gsfVersionProvider = NativeGsfVersionProvider(context) setProperty("Client", "android-google") setProperty("GSF.version", "${gsfVersionProvider.getGsfVersionCode(true)}") - setProperty("Vending.version", "${gsfVersionProvider.getVendingVersionCode(true)}") + setProperty("Vending.version", "${gsfVersionProvider.getVendingVersionCode()}") setProperty("Vending.versionString", gsfVersionProvider.getVendingVersionString()) } diff --git a/app/src/main/java/foundation/e/apps/data/playstore/utils/NativeGsfVersionProvider.kt b/app/src/main/java/foundation/e/apps/data/playstore/utils/NativeGsfVersionProvider.kt index 5026a179c48c9ee7e90587436d747549b3c39b6b..f94e261c87dd174ccab8dc59a6ba81ef0b48d38d 100644 --- a/app/src/main/java/foundation/e/apps/data/playstore/utils/NativeGsfVersionProvider.kt +++ b/app/src/main/java/foundation/e/apps/data/playstore/utils/NativeGsfVersionProvider.kt @@ -25,7 +25,6 @@ import androidx.core.content.pm.PackageInfoCompat class NativeGsfVersionProvider(context: Context) { private var gsfVersionCode = 0 - private var vendingVersionCode = 0 private val packageManager = context.packageManager init { @@ -35,12 +34,6 @@ class NativeGsfVersionProvider(context: Context) { } catch (e: PackageManager.NameNotFoundException) { // com.google.android.gms not found } - try { - val vendingPkgInfo = packageManager.getPackageInfo(GOOGLE_VENDING_PACKAGE_ID, 0) - vendingVersionCode = PackageInfoCompat.getLongVersionCode(vendingPkgInfo).toInt() - } catch (e: PackageManager.NameNotFoundException) { - // com.android.vending not found - } } fun getGsfVersionCode(defaultIfNotFound: Boolean): Int { @@ -50,11 +43,8 @@ class NativeGsfVersionProvider(context: Context) { gsfVersionCode } - fun getVendingVersionCode(defaultIfNotFound: Boolean): Int { - return if (defaultIfNotFound && vendingVersionCode < GOOGLE_VENDING_VERSION_CODE) - GOOGLE_VENDING_VERSION_CODE - else - vendingVersionCode + fun getVendingVersionCode(): Int { + return GOOGLE_VENDING_VERSION_CODE } fun getVendingVersionString(): String { @@ -63,7 +53,6 @@ class NativeGsfVersionProvider(context: Context) { companion object { private const val GOOGLE_SERVICES_PACKAGE_ID = "com.google.android.gms" - private const val GOOGLE_VENDING_PACKAGE_ID = "com.android.vending" private const val GOOGLE_SERVICES_VERSION_CODE = 203019037 private const val GOOGLE_VENDING_VERSION_CODE = 82151710 private const val GOOGLE_VENDING_VERSION_STRING = "21.5.17-21 [0] [PR] 326734551"