From dab6eab07024032e52f51b5772333764590b4cec Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Fri, 9 Feb 2024 15:50:10 +0100 Subject: [PATCH] Fix Play Store search returning only 1 result Force previous code version of FakeStore because Google search endpoint seems to read this value also. --- .../utils/NativeDeviceInfoProviderModule.kt | 2 +- .../playstore/utils/NativeGsfVersionProvider.kt | 15 ++------------- 2 files changed, 3 insertions(+), 14 deletions(-) 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 409090290..7de6c0cf6 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 5026a179c..f94e261c8 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" -- GitLab