ACRA / acralyzer

Open source backend for ACRA reports.
GNU General Public License v3.0
489 stars 90 forks source link

ProGuard support #27

Open antoche opened 11 years ago

antoche commented 11 years ago

What's the plan regarding proguard?

Would acra-storage retrace the stacktrace when it receives the report, or would acralyzer retrace them on the fly?

I see the proguard deobfuscator is written in Java. If I understand correctly, CouchApps are Javascript only. Would the deobfuscator have to be rewritten in javascript, or can we run the java code directly through something like Doppio?

Cheers, A.

KevinGaudin commented 11 years ago

Using a pure couchdb, there is no way for Acra-storage to deobfuscate reports on reception. Even if we rewrite proguard in JS, we can't load the mapping when receiving a report as the update function can't access other docs.

The way I see it, deobfuscation has to be an external batch process, either a java that you would run on your own computer / server which would access a view listing all obfuscated reports, retrace them and save them back in the db, or a rewritten JS retrace process that would do the same in the browser, triggered by the user.

hleinone commented 10 years ago

Even if it didn't support de-obfuscation, it would be great if I could add a simple Gradle task that would after the obfuscation upload the mapping.txt to Acralyzer. Then I'd always know from where to get the mapping.txt for each release and wouldn't need to manage those manually.

ozmium commented 10 years ago

There is a good workaround: Use the following settings in your proguard config file, to maintain most of the de-obfuscated class names (especially at the top of the stack trace) and approximate line numbers:

In your proguard-project.txt file, add this -keepattributes SourceFile,LineNumberTable

Ensure that you don't add this to the file: -renamesourcefileattribute SourceFile

Because it will just rename all the de-obfuscated classes to "SourceFile.java"

molexx commented 9 years ago

I've made a start on this with a script that takes the Acralyzer URL, finds the appropriate mapping.txt file from within Jenkyn's build archives and runs retrace. Any suggestions as to how it could be launched from within the browser?

https://github.com/molexx/acra_jenkins_retrace

Alternatively it could be a starting point to automatically retracing every report and replacing the value in the db, I assume couchdb allows writing via a HTTP POST but haven't got there yet.