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.
- If you are using LSPosed, select the target apps from which you want to hide the mock location.
- To apply this to all apps, you can select the following in your scope (Recommended):
- System Framework (system)
- Settings Storage (com.android.providers.settings)
- Reboot your device (if required by your Xposed manager) and you're all set!
android.location.LocationisFromMockProvider()isMock()setIsFromMockProvider()setMock()getExtras()setExtras()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.