repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
spoofing-your-location-in-play-store.mdMarkdown91 lines5.5 KiBsource raw download

title: "Spoofing Your Location in Google Play Store" section: "Mobile" sectionSlug: "mobile-pentesting" sourcePath: "src/mobile-pentesting/android-app-pentesting/spoofing-your-location-in-play-store.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/mobile-pentesting/android-app-pentesting/spoofing-your-location-in-play-store.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: false modified: true license: "CC-BY-NC-4.0"#

Spoofing Your Location in Google Play Store#

Google Play storefront georestrictions are usually enforced by a mix of Play country / billing profile, network geolocation, and cached Play state — not only by the phone GPS. Therefore a VPN alone sometimes works, but in newer Play flows you usually also need to reset cached state and, for real country/profile switches, use an account/payment profile that matches the target country.

If your goal is only to obtain the APK for reversing, it is often easier to use the alternative acquisition workflow documented in Android Applications Pentesting instead of fighting the storefront.

What Google Play Actually Checks#

If an app is hidden because the device is not Play-certified or fails attestation, check Play Integrity attestation spoofing.

Fast Path on a Non-Rooted Device#

  1. Connect to a VPN endpoint in the target country.
  2. Prefer a fresh test Google account already configured for that country. Reusing an account from another country often triggers the selected Play country matches your country of residence error.
  3. Clear Play state from the GUI or directly with adb:
adb shell am force-stop com.android.vending
adb shell pm clear com.android.vending
adb shell am force-stop com.google.android.gms
adb shell pm clear com.google.android.gms
adb shell am force-stop com.android.providers.downloads
adb shell pm clear com.android.providers.downloads
  1. Re-open Play Store and inspect Settings --> General --> Account and device preferences --> Country and profiles.[1]
  2. If the target country/profile appears, switch to it and retry the install. Google Play profile changes can take up to 48 hours to fully update.
  3. If the country/profile does not appear, remember that Google expects you to be in the target country and to have a payment method from that country when creating a new Play country/profile.

Rooted / Emulator Workflow#

When the target app checks GPS after installation, align the device geolocation with the storefront country:

adb -e emu geo fix -3.7038 40.4168   # longitude latitude (Madrid)
adb shell appops set <MOCK_LOCATION_APP_PKG> android:mock_location allow

Bypassing App-Side Mock-Location Checks#

Modern Android apps can detect lab GPS spoofing by calling Location.isMock() (API 31+) or the legacy isFromMockProvider(). On an authorized rooted lab, LSPosed modules such as HideMockLocation or a Frida hook can neutralize these checks:[2][4]

Java.perform(function () {
  const L = Java.use('android.location.Location');
  try { L.isMock.implementation = function () { return false; }; } catch (e) {}
  try { L.isFromMockProvider.implementation = function () { return false; }; } catch (e) {}
});

Keep the hook scoped to the target app when possible: the Play Store itself is mostly country/profile/IP driven, while the installed app is the component that commonly performs the GPS/mock-location check.

Common Failure Modes#

References#