scripts/hook_durian.js
/*
    We reuse these pointers so that we don't need to create a service.
    */
We reuse these pointers so that we don't need to create a service.
We reuse these pointers so that we don ' t need to create a service .
hookServiceClientDevice() {
        var self = this;
        var {CLDurianService} = ObjC.classes;
        Interceptor.attach(CLDurianService['- performTask:forClient:onDevice:'].implementation, {
            onEnter: function(args) {
                if (! self.durian_device) {
                    console.log("  * Setting DurianService, DurianClient, DurianDevice...");
                    self.durian_service = args[0];
                    self.durian_client = args[3];
                    self.durian_device = args[4];
                }
                else if (parseInt(self.durian_service) != parseInt(args[0]) || parseInt(self.durian_client) != parseInt(args[3]) || parseInt(self.durian_device) != parseInt(args[4])) {
                    console.log("  * Updating DurianService, DurianClient, DurianDevice, values changed!");
                    self.durian_service = args[0];
                    self.durian_client = args[3];
                    self.durian_device = args[4];
                }
                else {
                    console.log("  - Performing a task, DurianService unchanged...");
                }
            }
        });
    }
hookServiceClientDevice ( ) { var self = this ; var { CLDurianService } = ObjC . classes ; Interceptor . attach ( CLDurianService [ '- performTask:forClient:onDevice:' ] . implementation , { onEnter : function ( args ) { if ( ! self . durian_device ) { console . log ( "  * Setting DurianService, DurianClient, DurianDevice..." ) ; self . durian_service = args [ 0 ] ; self . durian_client = args [ 3 ] ; self . durian_device = args [ 4 ] ; } else if ( parseInt ( self . durian_service ) != parseInt ( args [ 0 ] ) || parseInt ( self . durian_client ) != parseInt ( args [ 3 ] ) || parseInt ( self . durian_device ) != parseInt ( args [ 4 ] ) ) { console . log ( "  * Updating DurianService, DurianClient, DurianDevice, values changed!" ) ; self . durian_service = args [ 0 ] ; self . durian_client = args [ 3 ] ; self . durian_device = args [ 4 ] ; } else { console . log ( "  - Performing a task, DurianService unchanged..." ) ; } } } ) ; }
We reuse these pointers so that we don't need to create a service.
We reuse these pointers so that we don ' t need to create a service .