Raygun Feature Request

Feature Request

Android ProGuard De-obfuscation Support

Current Status:

Completed


Avatar

josefdlange

Android developers can opt into a feature of the build tools called ProGuard, which will pare out unused classes and obfuscate existing ones as part of compilation. Both of these result in smaller binaries and happier users. When ProGuard does this, obviously it means that stack traces of exceptions show the obfuscated class names, which are of little use to a developer. Thankfully, ProGuard outputs a file (mapping.txt) that explains what obfuscated class names point to what real class names.

Similar to how iOS has dSYM files for re-symbolicating a crash log, this mapping.txt file can be used to de-obfuscate an Android stack trace. It's actually much simpler than a dSYM file, too, as it's not attributing names to symbols, but instead just mainly doing string swapping to rebuild the full stack trace. Take a look at Google's doc and you might find it straightforward enough.

http://developer.android.com/tools/help/proguard.html#decoding

The complexity I can foresee on your end is tracking the version and build numbers somehow for this use case. Unlike dSYM files, a mapping.txt file has little information regarding what build of the app it corresponds to, and as such it would be a responsibility of your customers to associate the right mapping.txt with the right version strings they report via Raygun.


Avatar

Alexander

Posted on
Mar 16 2016

This feature has recently been added to Google Play error tracker, but I'd like Raygun to support it as well­ — Google Play error tracker kind of sucks, compared to Raygun's, and having greater control over error reporting is always nice.

Furthermore, Google Play does not yet support uploading Proguard mapping files via API. It would be nice, if that functionality was available in Raygun out-of-box.

Regarding versioning mapping.txt files: there is indeed no fool-proof way to associate them with Android application version. Proguard have always been pure Java obfuscation tool, that simply got integrated into Android built process a good while ago. Anyway, the simplest way to do that is by adding an Android-specific "version code" argument to primary Raygun API, and forcing developer to specify the version code, when Proguard mapping.txt is uploaded — which is how Google Play currently does.

Here is a code of Proguard's built-in deobfuscation tool: https://sourceforge.net/p/proguard/code/ci/default/tree/src/proguard/retrace/. Hope this helps.

Avatar

Raygun

Jason Fauchelle

Posted on
Jul 22 2016

Thanks everyone for the feature request. ProGuard support in Raygun is now available.

A blog post about the release can be found here: https://raygun.com/blog/2016/07/obfuscate-code-proguard

Full documentation about this feature is here: https://raygun.com/docs/workflow/proguard

mapping.txt files can be uploaded either manually, or by POSTing them to an endpoint. A version name needs to be specified for each file so that it can be applied to the correct Raygun reports which already include the version name of your application. The version name can be specified during manual upload by renaming the file first. The API endpoint looks for a "version" field in the payload which is where you can specify the version name.

-Jason Fauchelle