Android R8, a significant regression

10/13/2021

Android R8, a significant regression

Google has made the use of its obfuscator R8 mandatory in lieu of PorGuard for code shrinking and obfuscation.  It is a nightmare for many app developers because it obfuscates source line numbers.  One significant advantage of Android apps over Windows apps is the ease of debugging based on app analytics that records errors with stack traces. R8 has eliminated this advantage.

One way to cope with this nightmare is to make the deobfuscation as automatic as possible.

Example:

  1. Copy mapping.txt to "E:\Retrace"
  2. Create a permanent file "E:\Retrace\myapp_stack_trace.txt"
  3. Create a batch file "E:\Retrace\retrace.bat" with the following content:
    java -jar "C:\Applications\proguard6.0.3\lib\retrace.jar" E:\Retrace\mapping.txt E:\Retrace\myapp_stack_trace.txt
    pause
  4. When examining a stack trace obtained from analytics's log, paste the trace to "E:\Retrace\myapp_stack_trace.txt" with any text editor (e.g., Notepad), then click "E:\Retrace\retrace.bat".  This will display deobfuscated stack traces.