Hide Mock Location

Warning

🛑 Project Discontinued / Archived

This project is no longer actively maintained.

Important notice regarding soft-reboots (Issue #29): Scoping this module to System Framework (android) can cause a fatal system_server crash (IllegalStateException: Preconditions.checkState in LocationEventLog$AggregateStats.markRequestBackground), resulting in repeated soft-reboots during app foreground/background transitions.

  • Cause: Hooking android.location.Location methods inside system_server desynchronizes the internal state tracking of LocationProviderManager and LocationEventLog$AggregateStats, tripping assertion checks when request counters desync.
  • Workaround: Do NOT select "System Framework" in your module scope. The module still works normally if you only scope the specific target apps you want to hide mock locations from, along with Settings Storage.

Prevents detection of mock location
Supports Android 6–16
Test App: MockLocationDetector

Compatibility Notes

  • For Xposed API 100 or lower: Please use v1.2.2 or below.
  • For Xposed API 101 or higher: v2.0.0 or above is recommended.

Usage

  1. Download the APK from the latest releases and install it on your device.
  2. Enable the module in your Xposed manager.
  3. Select the target apps from which you want to hide the mock location.
  4. Scope Recommendations:
    • Settings Storage (com.android.providers.settings) — Recommended
    • Your target applications (e.g. games, navigation, work apps) — Recommended
    • ⚠️ Do NOT select "System Framework" (android), as it causes bootloops/soft-reboots due to Issue #29.
  5. Reboot your device (if required by your Xposed manager) and you're all set!

Hooked Methods

  • android.location.Location
    • isFromMockProvider()
    • isMock()
    • setIsFromMockProvider()
    • setMock()
    • getExtras()
    • setExtras()
    • getProvider()
    • set()
  • android.provider.Settings
    • Secure.getStringForUser()
  • android.app.AppOpsManager
    • checkOp()
    • checkOpNoThrow()
    • unsafeCheckOp()
    • unsafeCheckOpNoThrow()
  • com.android.providers.settings.SettingsProvider
    • call()
  • com.android.server.appop.AppOpsService
  • com.android.server.AppOpsService
    • checkOperationImpl()
    • checkOperation()

How to set Mock Location app via ADB (Stack Overflow)

Granting Permission

adb shell appops set <MOCK_LOCATION_APP_PKG> android:mock_location allow

Revoking Permission

adb shell appops set <MOCK_LOCATION_APP_PKG> android:mock_location deny

Note: For rooted devices using a terminal emulator on the device itself, omit the adb shell prefix.

Disclaimer

Use this module at your own risk. The developer assumes no responsibility for any damage, data loss, or issues caused by the use of this software.

Credits & References

ThePieMonster#HideMockLocation

Releases

4/17/2026, 9:48:09 AM

Changes

  • Fully migrated to libxposed API 101
  • Fixed a bug related to hooking the Settings class
  • Update Icon!
  • Add support for hooking SettingsProvider
  • Add AppOpsManager hooks
  • Normalize Location providers
  • General refactoring and code improvements

Updating to this version is highly recommended.
For optimal results, it is recommended to enable the module for System Framework and com.android.providers.settings.

Compatibility Note

  • v2.. supports Xposed API version 101 or higher.
  • If you are using API version 100 or lower, please use v1.2.2.

Full Changelog: auag0/HideMockLocation@v1.2.2...v2.2.1

Assets

1

4/17/2026, 12:08:06 PM

⚠️ Notice: This project is discontinued. Do NOT scope System Framework in your Xposed manager as it can cause soft-reboots on newer Android versions. Only scope your target apps and Settings Storage.

Changes

  • Fix SettingsProvider issues
  • Add AppOpsService hooks for system hooks

Updating to this version is recommended!

Compatibility Note

  • v2.. supports Xposed API version 101 or higher.
  • If you are using API version 100 or lower, please use v1.2.2.

Full Changelog: auag0/HideMockLocation@v2.2.1...v2.3.0

Assets

1