Warning
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.Locationmethods insidesystem_serverdesynchronizes the internal state tracking ofLocationProviderManagerandLocationEventLog$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
- 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.
- Download the APK from the latest releases and install it on your device.
- Enable the module in your Xposed manager.
- Select the target apps from which you want to hide the mock location.
- 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.
- Settings Storage (
- Reboot your device (if required by your Xposed manager) and you're all set!
android.location.LocationisFromMockProvider()isMock()setIsFromMockProvider()setMock()getExtras()setExtras()getProvider()set()
android.provider.SettingsSecure.getStringForUser()
android.app.AppOpsManagercheckOp()checkOpNoThrow()unsafeCheckOp()unsafeCheckOpNoThrow()
com.android.providers.settings.SettingsProvidercall()
com.android.server.appop.AppOpsServicecom.android.server.AppOpsServicecheckOperationImpl()checkOperation()
How to set Mock Location app via ADB (Stack Overflow)
adb shell appops set <MOCK_LOCATION_APP_PKG> android:mock_location allow
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 shellprefix.
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.