5

I want to use phonegap for a mobile geolocation app, and I noticed there are a few fake gps apps out there. Is there a way in phonegap to determine if gps coordinates from the api are genuine or is it always genuine?

example fake location apps:

https://itunes.apple.com/us/app/fake-location/id431065024

https://play.google.com/store/apps/details?id=com.lexa.fakegps

Derek
  • 11,980
  • 26
  • 103
  • 162

2 Answers2

2
  1. check whether ALLOW MOCK LOCATION in Developer options is open
  2. check whether there is any app that declare android.permissions.ACCESS_MOCK_LOCATION in Manifest.xml

Even so, you can't handle every situation. For example, if you put https://play.google.com/store/apps/details?id=com.lexa.fakegps into /system/priv-app, you will find it can mock location without ACCESS_MOCK_LOCATION, and how it mock location is like this, so you can hardly detect the change of ALLOW MOCK LOCATION.

So further you can try these below:

  1. design an algorithm based on GPS location, detect whether user moves too fast or anomaly.
  2. use IP or base station to help you detect whether use has mocked the location or not, because IP or base station can hardly to change.
Community
  • 1
  • 1
PageNotFound
  • 2,320
  • 2
  • 23
  • 34
1

I have made this plugin which checks if the setting "Allow Mock Locations" is enabled in developer options on Android.

Rashad Saleh
  • 2,686
  • 1
  • 23
  • 28