scripts/update/hook_durian_update_locationd.js
/*
    Further hook needed to fake the version in the search party beacon.

    Every time a SPBeacon is created, all its setters are called:

        -[SPBeacon setIdentifier:0x149d8fb00]
        -[SPBeacon setModel:0x1fe7b4080]
        -[SPBeacon setShares:0x1fea03120]
        -[SPBeacon setSystemVersion:0xb19247ee008b482b]
        -[SPBeacon setVendorId:0x4c]
        -[SPBeacon setProductId:0x5500]
        - ... (and more)

    Since this is no plain copy but calls all these functions, we can hook the functions
    to set our own version.
    */
Further hook needed to fake the version in the search party beacon.
Every time a SPBeacon is created, all its setters are called.



Since this is no plain copy but calls all these functions, we can hook the functions
to set our own version.
Further hook needed to fake the version in the search party beacon . Every time a SPBeacon is created all its setters are called . Since this is no plain copy but calls all these functions we can hook the functions to set our own version .
overwriteSPBeacons() {
        var {SPBeacon} = ObjC.classes;
        var {NSString} = ObjC.classes;
        var self = this;
        Interceptor.attach(SPBeacon['- setSystemVersion:'].implementation, {
            onEnter: function(args) {
                var version = new ObjC.Object(args[2]);
                args[2] = NSString['stringWithString:'](self.durian_version_string);
                version = new ObjC.Object(args[2]);
                if (self.log_verbose) {
                    console.log("   > observed version: " + version);
                    console.log("   > new version:      " + version);
                }
            }
        });
        Interceptor.attach(SPBeacon['- setSerialNumber:'].implementation, {
            onEnter: function(args) {
                var serial = new ObjC.Object(args[2]);
                args[2] = NSString['stringWithString:'](self.durian_serial);
                serial = new ObjC.Object(args[2]);
                if (self.log_verbose) {
                    console.log("   > observed serial: " + serial);
                    console.log("   > new serial:      " + serial);
                }
            }
        });
    }
overwriteSPBeacons ( ) { var { SPBeacon } = ObjC . classes ; var { NSString } = ObjC . classes ; var self = this ; Interceptor . attach ( SPBeacon [ '- setSystemVersion:' ] . implementation , { onEnter : function ( args ) { var version = new ObjC . Object ( args [ 2 ] ) ; args [ 2 ] = NSString [ 'stringWithString:' ] ( self . durian_version_string ) ; version = new ObjC . Object ( args [ 2 ] ) ; if ( self . log_verbose ) { console . log ( "   > observed version: " + version ) ; console . log ( "   > new version:      " + version ) ; } } } ) ; Interceptor . attach ( SPBeacon [ '- setSerialNumber:' ] . implementation , { onEnter : function ( args ) { var serial = new ObjC . Object ( args [ 2 ] ) ; args [ 2 ] = NSString [ 'stringWithString:' ] ( self . durian_serial ) ; serial = new ObjC . Object ( args [ 2 ] ) ; if ( self . log_verbose ) { console . log ( "   > observed serial: " + serial ) ; console . log ( "   > new serial:      " + serial ) ; } } } ) ; }
Further hook needed to fake the version in the search party beacon.
Further hook needed to fake the version in the search party beacon .
// SearchParty Beacon from searchpartyd, defined in SPOwner // all setters are called upon SPBeacon creation, overwrite these