~/talk

Bytecode Transformations: Exploring new AGP APIs for instrumenting your app

slides:none on file

Explains how the deprecated Transform API is replaced by the new AGP instrumentation API (available since AGP 4.2) that runs a single Gradle task, uses ASM ClassVisitorFactory + Gradle instrumentation API, and instruments dependency jars via cached artifact transforms. Shows a working example that replaces Log.d with Timber.tag(...).d across project and third-party code (Glide), details ASM MethodVisitor edits, stack tweaks (swap, invoke_static/invoke_virtual), and frame recomputation modes; claims much less boilerplate and faster, cacheable builds.

AI-written summary · about

  1. 0:00Introduction
  2. 1:07Error monitoring setup
  3. 3:38Meta programming approaches
  4. 6:30Transform API overview
  5. 9:22Transform API limitations
  6. 11:07New instrumentation API
  7. 13:55Instrumentation API code
  8. 15:01ASM library basics
  9. 16:51JVM bytecode crash course
  10. 21:28Bytecode manipulation goal
  11. 23:12Gradle plugin setup
  12. 24:41Frames computation modes
  13. 26:47Class visitor implementation
  14. 33:39Testing bytecode changes
  15. 34:44Gradle artifact cache tips
  16. 36:10R8 and debugging instructions
  17. 36:50ASM plugin and JADX tools
  18. 37:13Real-world plugin examples
  19. 38:15Conclusion and call to action
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.