Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function resolveDevice(device) {
console.error('[+] Using', device, 'target');
switch (device) {
case 'usb':
return frida.getUsbDevice();
case 'local':
return frida.getLocalDevice();
case 'tcp':
return frida.getRemoteDevice();
break;
}
return function() {
this.then = function() {
throw(new Error('invalid device'));
}
}
}
module.exports = co.wrap(function* (opts) {
opts = opts || require('../config');
const device = opts && opts.remote ?
yield frida.getRemoteDevice() :
yield frida.getUsbDevice();
debug(device);
return device;
});