scripts/hook_durian.js
/*
    NSData helper function required to allocate parameters in CLDurianCommands.
    Takes input array in the form [1, 2, 3, 4, ...] as passed by JavaScript.
    */
NSData helper function required to allocate parameters in CLDurianCommands.
Takes input array in the form [1, 2, 3, 4, ...] as passed by JavaScript.
NSData helper function required to allocate parameters in CLDurianCommands . Takes input array in the form [ 1 2 3 4 ... ] as passed by JavaScript .
allocNSData(bytes) {
        var params_raw = Memory.alloc(bytes.length);
        params_raw.writeByteArray(bytes);
        var {NSData} = ObjC.classes;
        return NSData.alloc().initWithBytes_length_(params_raw, bytes.length);
    }
allocNSData ( bytes ) { var params_raw = Memory . alloc ( bytes . length ) ; params_raw . writeByteArray ( bytes ) ; var { NSData } = ObjC . classes ; return NSData . alloc ( ) . initWithBytes_length_ ( params_raw , bytes . length ) ; }
NSData helper function required to allocate parameters in CLDurianCommands.
NSData helper function required to allocate parameters in CLDurianCommands .
// alloc memory for raw bytes // NSData['- initWithBytes:length:']