Debugging / Decompiling async code (Android)

27 views
Skip to first unread message

Yechiel Levi

unread,
Feb 15, 2021, 2:49:20 AM2/15/21
to JEB Decompiler
In some apks i'm debugging, we have async methods (Handlers and MessageHandlers and loopers) , i'm wondering if there is a way to "continue debugging" once i reach such a point where a message is being dispatched.. as i would like to continue from the Handler / receiver to have a smooth debugging /analysis process.

not sure if this is feasible at all, just wondering if it is and i'm missing out on that feature

Nicolas Falliere

unread,
Feb 17, 2021, 6:45:38 PM2/17/21
to Yechiel Levi, JEB Decompiler
Nothing specifically out-of-the-box. When you're about to step over some Handler.send/post-like code, the debugger will not automatically set a breakpoint on the handler target routine. I.e., you'd be stepping over the call and end up on the next instruction. Meanwhile, the handler code may have executed, depending on whether or not the other threads are suspended or running (they should be suspended).

If you wanted to auto-break inside the handler code in the other thread, you could write a script to do just that, that is:
- find the target handler class, and locate its handleMessage() function
- set a bp on in
- also set a bp on the code that follows the Handler.send/post, because it may be hit first
- proceed - your handler bp should be hit at some point

(Unrelated, but you should join the Slack channel, see my signature below)

--
Nicolas Falliere (ni...@pnfsoftware.com)
JEB Decompiler, Founder and Architect


On Sun, Feb 14, 2021 at 11:49 PM Yechiel Levi <gmis...@gmail.com> wrote:
In some apks i'm debugging, we have async methods (Handlers and MessageHandlers and loopers) , i'm wondering if there is a way to "continue debugging" once i reach such a point where a message is being dispatched.. as i would like to continue from the Handler / receiver to have a smooth debugging /analysis process.

not sure if this is feasible at all, just wondering if it is and i'm missing out on that feature

--
You received this message because you are subscribed to the Google Groups "JEB Decompiler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jeb-decompile...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jeb-decompiler/ddaa8fe1-f303-43b4-bad8-119d0efa0436n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages