warren-bank / Android-Mock-Location

Android app that mocks the GPS and Network location providers.
GNU General Public License v2.0
109 stars 21 forks source link

[Pixel 6/7] Location mocking only works after restarting the service (ex: start/stop/start) #11

Open nutpantz opened 2 years ago

nutpantz commented 2 years ago

Not working on Android 12l pixel 6 July update

App runs, but location is not mocked. It's set in developer options

I had to stop and start it a few times then it started working

warren-bank commented 2 years ago

Hi. I haven't looked into this at all, yet.. but since our two apps are very similar under the hood.. this comment from an issue in FakeTraveler is probably very relevant:

Make sure you enable location in android settings. Unlike older versions, android 11 needs to use the location service to provide spoofed data.

This issue is another possible cause:

java.lang.IllegalArgumentException: Provider "network" already exists Caused by: android.os.RemoteException

Do you have a logcat reader app on your phone to be able to help identify the cause of your issue?

warren-bank commented 2 years ago

Also.. if you find that your location is repeatedly jumping back and forth between your mock location and your real location.. you can change your Android location settings to use "device only" (or possibly "high accuracy").. so it only depends upon GPS sensor data.. which is always correctly mocked

HarriBuh commented 1 year ago

I can confirm that stopping and restarting the service within the app fixed the issue for me. It's working properly now. Amazing. (Pixel 7, Android 13, root)

warren-bank commented 1 year ago

Is it possible that this is an issue that is exclusively on the Pixel?

I've tested this app on an older Samsung Galaxy S5 running LineageOS 20 (Android 13).. and didn't experience any need to start/stop/start for it to work.

I honestly don't know.. I do appologize that it requires some fiddling, but I'm glad to hear that it does eventually work. Unfortunately, I don't own a Pixel to reproduce and trace the cause for this.

warren-bank commented 1 year ago

Hi, all. I'd like to ask a favor of anybody who is experiencing this "need to restart service" issue.

v2.2.1 is the outcome from issue #14.. which fixed a crash that occurred on a Pixel 6a (and can't be reproduced on any other device).. and I'm wondering whether the two issues are related.. specifically, whether this new version fixes this issue as well?

Could somebody please test and report back? ..that would be greatly appreciated.