3

So I'm building my app with proguard which obfuscates the code, and I am uploading my mapping.txt to the deobfuscation files. My crash reports show the class and method names, but they don't show line numbers.

In my build.gradle:

    buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

So then I upload as a deobfuscation file: ProjectFolder/app/build/outputs/mapping/release/mapping.txt

So my question is:

  • Am I uploading the correct file for deobfuscation? There is also seeds.txt, dump.txt, usage.txt in that directory.

  • Is it possible to get line numbers in my crash reports through play store when building with proguard?

rosghub
  • 8,924
  • 4
  • 24
  • 37

1 Answers1

5

Yes, I believe mapping.txt is the right one.

As for viewing line numbers, I added the following to my proguard-rules.pro file:

# To be able to see line numbers in stack traces

-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
Farbod Salamat-Zadeh
  • 19,687
  • 20
  • 75
  • 125
  • Thanks will give it a try next time I release an update. Do you have any idea if those rules will compromise the obfuscation and make it more readable or anything like that? – rosghub Jun 06 '16 at 22:19
  • If you haven't uploaded a deobfuscation file, you will get something like this: `at your.package.name.YourClassName.onCreate(SourceFile:123)` if the error is being caused in line 123 in your `onCreate` method, for example. Once you upload the deobfuscation file (`mapping.txt`) it should display as if you had received the error through Android Studio's logcat when testing. I hope that makes things clearer. :) – Farbod Salamat-Zadeh Jun 07 '16 at 11:01