iOS 16 Location Spoofing

by
20 views df874008...

Description

Spoof your location in iOS 16.6.0 for apps that depends on CLLocation coordinate

How to Use

Download the script and run it with Frida CLI:

Download Script

Then run with Frida:

frida -U -f YOUR_PACKAGE_NAME -l ios-16-location-spoofing.js

Replace YOUR_PACKAGE_NAME with the target app's package name.

Source Code

JavaScript
// written in typescript
function spoofLocation(newLat: number, newLong: number) {
    function offsetLocation(lat: number, long: number) {
        var randLat = lat + (Math.random() - 0.5) * 0.01;
        var randLong = long + (Math.random() - 0.5) * 0.01;
        return {
            randLat,
            randLong
        };
    }

    var clLocation = ObjC.classes["CLLocation"]["- coordinate"];
    Interceptor.attach(clLocation.implementation, {
        onLeave: (curLocation) => {
            const {
                randLat,
                randLong
            } = offsetLocation(
                newLat,
                newLong
            );
            var newLocation = new ObjC.Object(curLocation)[
                "- initWithLatitude:longitude:"
            ](randLat, randLong);
            curLocation.replace(newLocation);
        },
    });
}
Share this script:
Twitter LinkedIn

Comments

Login or Sign up to leave a comment.
Loading comments...