mozilla / MozStumbler

Android Stumbler for Mozilla
http://location.services.mozilla.com
Mozilla Public License 2.0
621 stars 214 forks source link

Location can be spoofed when Mock Locations is enabled #1696

Open h4xr opened 8 years ago

h4xr commented 8 years ago

When a user has Mock Locations enabled in the developer settings of android they can use any route simulation app to create a fake location change which gets accounted in the stumbler app for android.

Workaround:- 1). Test to check if mock locations is enabled or not. 2). Check the GPS state change. 3). Check for NMEA data onLocationChanged

CuriousLearner commented 8 years ago

Bug Confirmed.

Easy fix: Remove all the reports which have GPS satellites in the report: 0/0. While mock locations are switched and some app is trying to fake locations, even with or without the GPS enabled the Mozilla Stumbler app shows 0/0 satellites.

In reality while at least 3 satellites are not getting connected to the device, they won't be able to track the device and capture data for reports. Hence, an easy solution is to exclude all the reports which have 0/0 GPS satellites in Stumbler app.

I hope this helps.

cascheberg commented 8 years ago

This is basically a duplicate of #1671. There have been checks of this kind, but they have caused problems on some devices, see #811.

h4xr commented 8 years ago

If we could just remove the test provider using the location managers api before requesting location updates, that workaround should fix the scenario too.