Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if geo-location has been spoofed

I want to make sure the location received by the LocationListener is a "real" one 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.

like image 664
whlk Avatar asked Jul 08 '11 11:07

whlk


People also ask

Can you tell if someone is spoofing their location?

On Android 18 (JellyBean MR2) and above mock locations are detected using Location. isFromMockProvider() for each location. The app can detect that the location came from a mock provider when the API returns true.

Can GPS location be spoofed?

Unfortunately, doing so isn't very straightforward. There isn't a “fake GPS location” setting built in to either iOS or Android, and neither do most apps let you spoof your location through a simple option. Setting up your phone to use fake GPS only affects your location.

Can someone fake their location on Google Maps?

Can You Fake Location on Google Maps? Yes, you can fake your location on Google Maps. Nowadays, it's quite easy for you to get Google maps fake locations. If you're an Android user, you need to download and install applications from the Google Play Store.

How do I stop GPS spoofing?

Select Android > Restrictions > Click on Configure button. Under Allow Developer Options, uncheck Mock location option to restrict users from turning on Mock Locations on their devices.


2 Answers

  • 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.
like image 166
Reno Avatar answered Oct 05 '22 22:10

Reno


Have a look on "Maintaining a current best estimate" topic on the following page:

Maintaining a current best estimate

like image 34
Khawar Raza Avatar answered Oct 05 '22 23:10

Khawar Raza