Check if geo-location has been spoofed
I want to make sure the location received by the LocationListener is a "real" o开发者_开发技巧ne and doesn't come from a spoofed source (I.e the Application Location Spoofer). I don't care about "but the user sometimes want to spoof the location" - it's about an app which doesnt get distributed over the android market. The application does not need the location to be that accurate - it just has to be "real".
Do you think there is a way to check if the location has been spoofed?
What do you think is a good way to prevent location spoofing?Is there maybe a android-method which gives me the real location nevertheless?Is there maybe a android-method to determine if the location has been spoofed?Thoughts I had:
- Check on a blacklist if a location-spoofing app is installed
- Enable/disable different location providers and check against their returned locations
- Run a background service watching the location (in a passive way) and check for sudden location changes
Please give me your thoughts and input to this issue.
- From the Provider name: 'gps' or 'network' are proper
Most spoofers forget to send GPS status updates. That is something that you can use to your advantage
// 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;
The best method is this :
- Mock location providers do not send NMEA data. So create a NMEA listener. If you don't get NMEA update but you get valid GPS updates in onLocationChanged() a spoof is being used.
Have a look on "Maintaining a current best estimate" topic on the following page:
Maintaining a current best estimate
精彩评论