Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pokemon Go #3

Open
mtx-z opened this issue Jul 9, 2016 · 26 comments
Open

Pokemon Go #3

mtx-z opened this issue Jul 9, 2016 · 26 comments

Comments

@mtx-z
Copy link

mtx-z commented Jul 9, 2016

Pokemon Go application on Android seems to detect it anyway (block GPS localization if developer settings is enabled). Would be really cool to have it work with it !

@NovaCygni
Copy link

Confirmed :(

@twilightgod
Copy link

+1

2 similar comments
@Rooie89
Copy link

Rooie89 commented Jul 12, 2016

+1

@veneliniliev
Copy link

+1

@bnalls33
Copy link
Owner

Ok, it should work now. I released a new update.

@DarthFeanor
Copy link

New update seems to help but the game keeps flipping between detecting and not detecting mock locations. Curious if anyone else is having the same problem?

@kayraucklnc
Copy link

Doesnt work game behaving by itself. It works for making fake gps apps detect on but game detect on too :( i cant see pokeballs or gyms

@bnalls33
Copy link
Owner

What GPS app are you using? What type of phone?
I have a Nexus 5X & this GPS app: https://play.google.com/store/apps/details?id=com.incorporateapps.fakegps.fre&hl=en

@bnalls33 bnalls33 reopened this Jul 14, 2016
@mtx-z
Copy link
Author

mtx-z commented Jul 14, 2016

It's not the Niantic first localized app. I think there is another check happening. I was able to simulate a path on the game, seeing my player walk on the map following the path/speed i setted. But even if this work, the game see something and say 'cannot locate you'.

@bnalls33
Copy link
Owner

Are you moving too quickly along the path?

@mtx-z
Copy link
Author

mtx-z commented Jul 14, 2016

Nop, setted a 5km/h speed, the player seems to respect that. So even if i see me moving on the map, the app see something and dont trust/want the locations data.

@DarthFeanor
Copy link

I have a Galaxy S5 using the same Fake GPS app you're using (PRO version).

Go seems to flip back and forth from accepting my location and failing to locate me. Happy to help debug in any way I can.

@mtx-z
Copy link
Author

mtx-z commented Jul 14, 2016

2 files in the app are refering to the 'mock' word :

  • FusedLocationProviderApi.java (com\google\android\gsm\location)
    PendingResult<Status> setMockLocation(GoogleApiClient googleApiClient, Location location);
    public static final String KEY_LOCATION_CHANGED = "com.google.android.location.LOCATION";
    public static final String KEY_MOCK_LOCATION = "mockLocation";
  • zzd.java (com\google\android\gsm\location\internal)
    public PendingResult<Status> setMockLocation(GoogleApiClient client, Location mockLocation) {
        return client.zzb(new C06394(this, client, mockLocation));
    }

    public PendingResult<Status> setMockMode(GoogleApiClient client, boolean isMockMode) {
        return client.zzb(new C06383(this, client, isMockMode));
    }

Idk enough of Android/Java to understand something usefull.

I also see near some 'looper' variable, isMockMode boolean, PendingResult result methods... So the localization coming and going, seems to loop. A CRON job like to check Mock Mode somehow.

EDIT: used this to decompile apk

@skylve
Copy link

skylve commented Jul 14, 2016

I could successfully mock the location by blocking all apps in MockMock (couldn't whitelist pokemon only). Though my location is jumping between my real and mocked position (maybe since the mocking app don't see the mocking is on).

Did somebody check if they are using a background process to verify if the location is mocked.
If they do so, this line sharedPreferences.getStringSet(Common.PREF_KEY_WHITELIST_APP_LIST, new HashSet<String>(0)).contains(lpparam.packageName)) wouldn't work since the package name would be something like com.nianticlabs.pokemongo:background.

@bnalls33
Copy link
Owner

I haven't checked but you're right, there could be other processes. I didn't build the whitelist for Pokemon Go purposes.

mtx-z Has some good findings too. This is the first I've heard about FusedLocationProvider. KEY_MOCK_LOCATION is new to me. We may need to mock Location.getExtraLocation(KEY_MOCK_LOCATION), and/or modify getExtras() to modify the value "KEY_MOCK_LOCATION" in the bundle.

@mtx-z
Copy link
Author

mtx-z commented Jul 14, 2016

Android documentation

KEY_MOCK_LOCATION Key used for the Bundle extra in Location object holding a boolean indicating whether the location was set using setMockLocation(GoogleApiClient, Location).

Also see this stack and this about Fused locator

@skylve
Copy link

skylve commented Jul 14, 2016

@bnalls33 The whitelist is a really good feature, downloaded MockMock few days ago and was looking forward this ! Thanks for adding it =)
If you want, I can submit a PR to also manage background process.

@ireflex198
Copy link

Could you help me out? Im new to this stuff, so please bear with me if i say anything stupid. You said you released a new version that works with pokemon go and other apps, could you provide a link for an apk? Thanks!

@mtx-z
Copy link
Author

mtx-z commented Jul 15, 2016

You can find a build here. Note that the app is not 100% working with PokeGo yet.

@mtx-z
Copy link
Author

mtx-z commented Jul 15, 2016

I tried to view some file using an Hex Editor.
From file

\assets\bin\Data\Managed\Metadata

... MockILocationProvider.get_HasValidLocation.get_IsMeasuredLocation.HasValidLocation.IsMeasuredLocation.MockIMapController.add_OnWorldScaleOrOriginChanged.remove_OnWorldScaleOrOriginChanged.get_CompassLock.set_CompassLock.get_Config.set_Config.get_GPSLock.set_GPSLock. ...

@ireflex198
Copy link

Is root required for this BTW? So can i just install the apk and use a gps spoofer? Thanks for the help in advance.

@skylve
Copy link

skylve commented Jul 15, 2016

@ireflex198 take a look at Xposed, this repository is only a module for this framework. Also, this is not really a place to ask for this stuff, more about how to develop it (I saw you created your Github account to ask this question).
@bnalls33 we should maybe close this Issue (or rename it?) and create different ones to manage what @mtx-z is saying.

@bnalls33
Copy link
Owner

@skylve What were you suggesting that your code would do "[I can submit a PR to also] manage background process"

@DarthFeanor
Copy link

Was reading up on possible other hooks and saw this:
https://stackoverflow.com/questions/6880232/disable-check-for-mock-location-prevent-gps-spoofing

Is it possible that Pokemon Go is looking to see if any app is requesting ACCESS_MOCK_LOCATION permissions and assuming nefarious purposes?

Is there any value to preventing the LocationManager.removeTestProvider function?

@DJWassink
Copy link

DJWassink commented Jul 20, 2016

How sure are we that it's even pokemon which is doing this? Without pokemon started on my phone (stopped in androids apps settings menu). It also shows the same behaviour in google maps.

Okay so it is indeed because of the FusedLocationService. Check this reddit post how to disable it

https://www.reddit.com/r/PokemonGoSpoofing/comments/4sdqkg/android_if_gps_jumps_from_spoof_location_to_real/

@NovaCygni
Copy link

Throwing it out there but most people are just being dumb and havnt set "GPS Mode/Location Services" to "Device Only" and are being dumb using LowPower (* Wifi networks GPS location *) or HighAccuracy... the correct setting should be device GPS only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests