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

Enhanced Android app launch support needed #1128

Open
TsaiHao opened this issue Dec 27, 2024 · 1 comment
Open

Enhanced Android app launch support needed #1128

TsaiHao opened this issue Dec 27, 2024 · 1 comment

Comments

@TsaiHao
Copy link

TsaiHao commented Dec 27, 2024

Current Behavior

Currently, Frida seems to only support launching Android apps via their MainActivity. However, in real-world scenarios, we often need more complex launch configurations, like this:

adb shell am start \
  -n com.foo.bar/.NotMainActivity \
  -a com.foo.bar.action.VIEW \
  -d https://example.com/foo/bar \
  --ez Feature1 TRUE

Investigation

After digging into the code, I found the limitations are mainly in src/linux/linux-host-session.vala:

  1. No support for parsing data URIs and extras
  2. Activity and Action parameters are mutually exclusive (though they shouldn't be)

Questions

  1. Is this enhancement already planned/implemented somewhere I haven't found?
  2. Are there any technical blockers I should know about?
  3. If this isn't on your roadmap, would you be open to a PR implementing this functionality?

Proposed Changes

If this is something you'd welcome, I'd be happy to work on:

  1. Extending parameter parsing in linux-host-session.vala to support:
  • data URIs
  • intent extras
  • simultaneous Activity and Action parameters
  1. Updating system_agent.js accordingly

Let me know if this aligns with your vision for Frida. Happy to adjust the approach based on your feedback.

@TsaiHao
Copy link
Author

TsaiHao commented Jan 3, 2025

As an alternative, I somehow figured out how to do it using Frida python API.

  1. Call devicce.enable_spawn_gating to intercept all new spawned process;
  2. Run the adb shell am start using subprocess module;
  3. Check all new processes in the spawn_added callback, and attach to the target process.

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

1 participant