Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
agent.events.once("uninjected", (reason: frida.SessionDetachReason) => {
this.agents.delete(pid);
const mainPid = (this.process as frida.Process).pid;
if (pid === mainPid) {
switch (reason) {
case frida.SessionDetachReason.ApplicationRequested:
break;
case frida.SessionDetachReason.ProcessReplaced:
return;
case frida.SessionDetachReason.ProcessTerminated:
case frida.SessionDetachReason.ServerTerminated:
case frida.SessionDetachReason.DeviceLost:
const message = reason[0].toUpperCase() + reason.substr(1).replace(/-/g, " ");
this.onFailure(new Error(message));
break;
default:
}
}
if (this.agents.size === 0) {
this.onSuccess();
}
});
agent.events.once("uninjected", (reason: frida.SessionDetachReason) => {
this.agents.delete(pid);
const mainPid = (this.process as frida.Process).pid;
if (pid === mainPid) {
switch (reason) {
case frida.SessionDetachReason.ApplicationRequested:
break;
case frida.SessionDetachReason.ProcessReplaced:
return;
case frida.SessionDetachReason.ProcessTerminated:
case frida.SessionDetachReason.ServerTerminated:
case frida.SessionDetachReason.DeviceLost:
const message = reason[0].toUpperCase() + reason.substr(1).replace(/-/g, " ");
this.onFailure(new Error(message));
break;
default:
}
}
if (this.agents.size === 0) {
this.onSuccess();
}
});