Is there a foolproof way of detecting whether a user is faking his/her GPS location?
The technique should work on android devices with no cellular connectivity hardware. i.e. Wi-Fi only
Detecting Mock Locations & Fake GPS Position on Android On Android 17 (JellyBean MR1) and below mock locations are detected using Settings. Secure. The app can detect that users have enabled ALLOW_MOCK_LOCATION but has no easy way to determine whether locations received are mock or real.
Fake GPS Location Spoofer For free, though, you can spoof your location on any version of Android, and as long as you're running Android 6 or above, you don't even need to root your device.
Fake Location App Fone - Virtual Location, another app you can use to fake GPS without mock location-enabled is Fake GPS Location. This app is quite common as many people use it to spoof their location. Downloading this app is easy because you can get it from Google Play Store.
There is no way to be sure of the location provided to Maps. Maps does not control the location information, rather it asks the device for its location and uses whatever the device reports back. If the device reports the wrong location Maps has no way of knowing it is wrong.
Try this code if this works for you
// returns true if mock location enabled, false if not enabled.
if (Settings.Secure.getString(getContentResolver(),
Settings.Secure.ALLOW_MOCK_LOCATION).equals("0"))
return false;
else return true;
Cheers!
I think you should make the concept of fake GPS coordinate cleaner because by itself any coordinate can be considered genuine whether the user is actually there or not.
You could therefore act in two ways:
As it concerns solution 1 you could for instance use the CID (cell id ) and LAC (location area code) of the GSM signal nearest tower to find out whether a user is in a certain area. That would require an internet connection and a request to a remote service for the LAC to GPS coordinates translation.
As for solution 2 you might check for abnormal coordinates changes which are not in line with the user speed or acceleration, for instance a change of several miles in few seconds could warn you about a spoofed coordinate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With