Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Android Mock GPS Location Guide
- Tested in Jan 2024 using Ubuntu 23.10 and a Samsung Galaxy S5 SM-G900I (kltedv). You can likely substitute the phone for another model, or substitue the PC OS for an adware platform that plays games.
- ### Requirements
- 1. PC with `adb` and `fastboot` installed.
- 2. A spare [LineageOS supported handset](https://wiki.lineageos.org/devices/).
- 3. A USB data cable to connect the two.
- ### Install LineageOS + Gapps
- 1. Go to [download.lineageos.org](https://download.lineageos.org) and download the latest .zip, boot.img and recovery.img for your device.
- 2. Go to [mindthegapps.com](https://mindthegapps.com/download/) and download the appropriate gapps package for your device and LineageOS version.
- 3. Connect the USB cable and boot the phone into fastboot mode. Flash the recovery image:
- ```
- $ fastboot flash recovery recovery.img
- Sending 'recovery' (12948 KB) OKAY [ 0.558s]
- Writing 'recovery' OKAY [ 0.284s]
- Finished. Total time: 0.843s
- ```
- 4. Reboot to recovery mode
- 5. Run `Factory Reset` -> `Format system partition`
- 6. Select `Apply Update` -> `Apply from ADB`. Sideload the LineageOS zip file. Ignore any errors in the terminal. The phone screen will tell you if it worked.
- ```
- $ adb sideload lineage-18.1-20231222-nightly-kltedv-signed.zip
- serving: 'lineage-18.1-20231222-nightly-kltedv-signed.zip' (~47%) adb: failed to read command: Success
- ```
- 7. Hit `Apply from ADB` again and do the GApps package. Ignore any signature verification errors.
- ```
- $ adb sideload MindTheGapps-11.0.0-arm-20230922_081034.zip
- serving: 'MindTheGapps-11.0.0-arm-20230922_081034.zip' (~47%) adb: failed to read command: Success
- ```
- 8. Run `Factory Reset` -> `Format data/factory reset`. Note: This erases absolutely all of your data on the phone. I assume your handset contains nothing important.
- 8. Reboot the phone. It will boot into LineageOS. Run through the basic setup ensuring that "Use Location" is selected on the Google Services page.
- ### Enable ADB
- 1. Go to `Settings` -> `About phone` and tap `Build number` 7 times to enable developer options.
- 2. Go to `Settings` -> `System` -> `Developer options` and enable `USB debugging`. Allow your computer to connect.
- ### Install Magisk
- 1. Download:
- * [Magisk](https://github.com/topjohnwu/Magisk/releases)
- * [LSposed](https://github.com/LSPosed/LSPosed/releases) module
- * [Shamiko](https://github.com/LSPosed/LSPosed.github.io/releases) module.
- * [SafetyNet Fix](https://github.com/kdrag0n/safetynet-fix/releases) module.
- 2. Install Magisk over adb:
- ```
- $ adb install Magisk-v26.4.apk
- Performing Streamed Install
- Success
- ```
- 3. Copy the LineageOS `boot.img` file to your handset:
- ```
- $ adb push boot.img /sdcard/
- boot.img: 1 file pushed, 0 skipped. 41.3 MB/s (8142864 bytes in 0.188s)
- ```
- 3. Open Magisk App
- * Select `Install` for Magisk.
- * Select `Select and Patch a File`
- * Select the `boot.img` file from the phone's internal storage
- * Click `Let's Go`
- This will produce a new boot image. The file location will appear on the handset. Copy the file to your PC. Note that the filename is different every time.
- ```
- $ adb pull /storage/emulated/0/Download/magisk_patched-26400_XXXXX.img
- /storage/emulated/0/Download/magisk_patched-26400_XXXXX.img: 1 file pulled, 0 skipped. 20.3 MB/s (8386560 bytes in 0.394s)
- ```
- 4. Reboot to recovery
- ```
- adb reboot recovery
- ```
- 5. Select `Advanced` -> `Enter fastboot`
- * Flash the patched boot image:
- ```
- $ fastboot flash boot magisk_patched-26400_XXXXX.img
- Sending 'boot' (8190 KB) OKAY [ 0.330s]
- Writing 'boot' OKAY [ 0.183s]
- Finished. Total time: 0.527s
- ```
- 6. Reboot the phone, open the Magisk app and run the additional setup when prompted. The phone will reboot again.
- ### Install Magisk Modules
- 1. Copy the downloaded modules to the handset
- ```
- $ adb push LSPosed-v1.9.2-7024-zygisk-release.zip /sdcard/
- LSPosed-v1.9.2-7024-zygisk-release.zip: 1 file pushed, 0 skipped. 107.2 MB/s (2462055 bytes in 0.022s)
- $ adb push Shamiko-v0.7.5-194-release.zip /sdcard/
- Shamiko-v0.7.5-194-release.zip: 1 file pushed, 0 skipped. 26.3 MB/s (258167 bytes in 0.009s)
- $ adb push safetynet-fix-v2.4.0.zip /sdcard/
- safetynet-fix-v2.4.0.zip: 1 file pushed, 0 skipped. 10.0 MB/s (96532 bytes in 0.009s)
- ```
- 2. Open the Magisk app.
- 3. Under `Settings`, enable `Zygisk`. Don't reboot yet.
- 4. Select `Modules` -> `Install from Storage`.
- 5. Install the LSposed zip file. Don't reboot yet.
- 6. Install the Shamiko zip file. Don't reboot yet.
- 7. Install the SafetyNet Fix zip file. Reboot the handset.
- 8. Open the Magisk app and go to `Settings` -> `Hide the Magisk app`. Set an appropriate name for the new package and apply it.
- ### Install GPS Joystick
- 1. Install "Fake GPS Location - GPS Joystick" (`com.theappninjas.fakegpsjoystick`) from the [Google Play Store](https://play.google.com/store/apps/details?id=com.theappninjas.fakegpsjoystick). Alternatively, you can download the apk from their [website](http://www.gpsjoystick.theappninjas.com/).
- 2. Go to `Settings` -> `System` -> `Developer options` -> `Select mock location app` and set it to `GPS Joystick`.
- ### Install Hide Mock Location
- 1. Download the latest [Hide Mock Location](https://github.com/ThePieMonster/HideMockLocation/releases/) apk.
- 2. Install the apk:
- ```
- $ adb install HideMockLocation-2.0.9.apk
- Performing Streamed Install
- Success
- ```
- 3. There will be a notification from LSPosed in the notification drawer. Tap it to open LSPosed.
- 4. Go to `Modules` and select `Hide Mock Location`. Enable the module and select `System Framework`.
- ### Install Your App
- 1. From the Google Play Store, install the app that wish to hide your location from. Popular examples include the "Japanese anime monster catching app" and "Australian convenience store fuel voucher app".
- 2. Open the Magisk app and go to `Settings` -> `Configure Denylist`. Expand the selection for your app and enable every item. Leave the "Enforce Denylist" option disabled.
- 3. Open the LSPosed app. Go to `Modules` and select `Hide Mock Location`. Enable the module and select the newly installed app.
- 4. Reboot.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement