[Magisk] fOmey:
Mock Locations Patcher - Magisk Edition

THIS TOOL HAS BEEN MERGED INTO SMALI PATCHER.

​

DESCRIPTION ::

Hide mock locations status, allowing apps like Pokemon GO to treat them as genuine location updates.

BACKGROUND ::

Last night I thought I would hop on Pokemon GO for the first time in a good few months to check out the new changes, was instantly reminded how keen you have to be to play this game being forced to run around in the streets and what not. So naturally I wanted to mock my location so I could be a lazy ass and play while sitting on the couch.

After some quick poking around, I have indeed been able to get mock mock locations working.. however I have modified a file in the framework directory to do so, so device compatibility could be limited. I own a Galaxy S6 running nougat and it works fine for me.. I cant say the same for you tho !

So I had the idea of creating this patcher, Here is what it does:

Decompiles JAR file.

Patch the nessisary files.

Recompile JAR file.

Download's the latest magisk module template from github.

Generate a magisk module .zip for you to flash in recovery !

PRECAUTIONS / TERMS OF USE ::

You must backup your device prior to flashing the module, I am not responsible or providing support to recover any devices stuck in bootloops.

PROGRESS LOG ::

As I suspected services.jar does differ quite a lot between manufactures.. this was expected and planned for, or at least I thought..

APK-Patcher is not compatible with the latest apktool/smali/baksmali meaning decompiling nougat .jar's is not possible - this would of been the perfect method of modifying "services.jar" on the fly and more importantly during installation process.. allowing cross-device compatibility by retaining all device specific classes.

At this stage separate patched "services.jar" seem like the only viable option unfortunately, which would be impossible to maintain due to massive amount of manufactures.. However may consider experimenting with a windows desktop UI to patch "services.jar" and generate module installation zip file, this seems like the best option at this stage.

Mock Locations Patcher is ready for alpha testing, time to let this thing loose in the wild !

REQUIREMENTS ::

.NET Framework 4.6 or later installed.

Java JRE 1.8 or later installed.

Deodexed "services.jar", the patcher will do absolutely nothing if used on a odexed "services.jar".. Let me clarify, you can be running a odexed rom that is absolutely fine, however in order for the patcher to work you must target a deodexed "services.jar". If your running a odexed/stock rom and need to deodex I highly recommend using: Fulmics Deodexer.

Open Fulmic deodexer settings and set baksmali/smali.jar path.

Extract "/system" folder from rom zip installation file to your desktop.

Set /system path in fulmics deodexer and start deodex process.

You can also deodex using baksmali/smali:

java -jar baksmali.jar x services.odex -d framework\arm64 -o tmp
*** "framework\arm64" assuming your device is arm64 ***
*** otherwise try "framework\arm", if that also fails try just "framework" ***
java -jar smali.jar a tmp -o classes.dex
java -jar apktool.jar d services.jar
*** Cut and paste "classes.dex" into decompiled directory ***
java -jar apktool.jar b services.jar.out

If you don't want to use apktool, alternatively you can open the odexed "services.jar" with a zip archiver program (7zip, WinZip etc.) and add "classes.dex" to the JAR.

INSTRUCTIONS ::

Backup device.

Run "MockLocationsPatcher.exe", First startup will download the latest nessisary binary's.

Select your deodexed "services.jar". Easiest way to extract this file is by pulling it from your deodexed rom .ZIP file, you can find it in "/system/framework/".

Hit "Patch JAR".

Once the process has completed, magisk module will be generated in the same directory as "MockLocationsPatcher.exe".

Flash module in recovery - Samsung/MIUI users Do NOT install via magisk manager.. I have found for some reason when adding the module in magisk manager it get's stuck in a "module update avalible" loop.

CHANGELOG ::

0.6 ::

Error handling for failed downloads of magisk module template.

Updated to magisk v14.0.

0.4 / 0.5 ::

Potential spaces in file path error fix - unsure as I have been unable to reproduce this issue, so it's been very difficult to fix.

0.3 ::

Increased default Java memory heap size - fixes "out of memory" error on lowend PC's.

0.2 ::

Simplified patching process.

Fixed reboot issue with certain GPS spoofers.

Verify's target JAR is deodexed before proceeding with patch.

0.1 ::

Initial release

Cheers,