Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect fake GPS coordinates in Android?

Tags:

android

gps

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

like image 354
Dojo Avatar asked May 27 '13 11:05

Dojo


People also ask

Can Fake GPS Location be detected?

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.

Does fake GPS work on Android?

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.

How do you make a fake GPS undetectable?

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.

How can you tell if someone is faking their location on Google Maps?

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.


2 Answers

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!

like image 58
Neo Avatar answered Sep 24 '22 01:09

Neo


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:

  1. pull from some other source any information regarding position which you can compare with the GPS coordinates
  2. analyze the data you have (the GPS coordinates) for discrepancies.

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.

like image 42
dendini Avatar answered Sep 24 '22 01:09

dendini