Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting fake/mocked locations in phonegap?

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

like image 696
Derek Avatar asked Oct 20 '22 17:10

Derek


1 Answers

  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.
like image 56
PageNotFound Avatar answered Nov 12 '22 11:11

PageNotFound