Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attaching script when spawning Android application #75

Open
daMatz opened this issue Aug 5, 2022 · 1 comment
Open

Attaching script when spawning Android application #75

daMatz opened this issue Aug 5, 2022 · 1 comment

Comments

@daMatz
Copy link

daMatz commented Aug 5, 2022

I am able to start an Android application and attach a script to it like this:

const device = await frida.getUsbDevice();
const pid = await device.spawn(packageName);
const session = await device.attach(pid);
const source = await fs.promises.readFile(scriptPath, { encoding: "utf8" });
const script = await session.createScript(source);
await script.load();
await device.resume(pid);

From my understanding this spawns the process and attaches the script while it's already running.

What I want to do, is the equivalent to the CLI command: frida -U --no-pause -l script.js -f com.package.
Is this possible?

I already looked into SpawnOptions for spawn(), but didn't manage to utilize them (e.g. getting errors like [Error: The 'argv' option is not supported when spawning Android apps] for most).

@mamidon
Copy link

mamidon commented Aug 18, 2023

Hopefully related, I'd like to attach a script before Android has done a bunch of startup stuff. It seems that processes spawned by Frida used to be paused by default -- frida/frida#2277. Is there an option to spawn a process in a paused state?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants