How to determine fake GPS coordinates in Android?

Is there a reliable way to determine if a user is adjusting their GPS location?

The technique should work on Android devices without cellular equipment. i.e. only wifi

+6
source share
2 answers

Try this code if it 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; 

Hooray!

+13
source

I think you should make the concept of a fake GPS coordinator, because any coordinate in itself can be considered genuine, whether the user is really there or not.

Thus, you can act in two ways:

  • remove from any other source any position information that you can compare with GPS coordinates.
  • analyze the data that you have (GPS coordinates) for discrepancies.

As for solution 1, you can, for example, use the CID (cell identifier) ​​and LAC (location area code) of the nearest GSM signal tower to find out if the user is in a certain area. This will require an Internet connection and a request to a remote service to convert LAC coordinates to GPS.

As for solution 2, you can check for abnormal coordinate changes that do not correspond to the user's speed or acceleration, for example, changing a few miles in a few seconds can warn you about a forged coordinate.

+2
source

Source: https://habr.com/ru/post/945934/


All Articles