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'));
}
}
}