Recently, I wanted to collect code coverage information of an Android APK. Without the source code, we decompiled the APK to dex, got the .class by using dex2jar and tried to intrument .class files directly by using ASM.
This method achieves success, however, implementing the coverage code manually will cost a lot and Jacoco has done a great job in this area so that I prefer to use Jacoco. It seems the offline mode is suitable for this job, however, There is no experience showing that Jacoco in offline mode has an ability to instrument .class files directly without source code.
I am not sure about this, does the source code necessary indeed?