Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Play Dev Console showing Class and Method names in Stacktrace

I have an app with Proguard enabled (minifyenabled true) and recently got a crash report in the Google Play Dev Console. When I looked at it, I saw the following:

enter image description here

I was surprised to see the full class and method names in line 1, as Proguard is enabled. I've always previously seen things like this:

at com.myname.myapp.c.f (Unknown Source)

I'm also curious how the line number is appearing as I'm not preserving line numbers in my Proguard config file (hence, why I usually see 'Unknown Source' in my stacktraces).

I decompiled my .apk, peeked at the classes.dex file and it all looked OK. I located the class referenced in line 1 of the stacktrace and the class name was indeed obfuscated, as was the method name.

Now, 'MyActivity' (line 2 of the stacktrace) is the launch Activity of my app, and as such is declared in the Manifest, so I understand why it's name is not obfuscated, and the 'onConnected' method is not a method of mine (it comes from Google Play Games Services), so, again, this is OK.

'MyMethodName' is called from within onConnected like so:

@Override
public void onConnected(Bundle arg0) {
    myClassObject.myMethodName();       //Where myClassObject is an instance of MyClassName
}

Debug is set to disabled in my build.gradle file.

I don't upload mapping.txt files to the Play Console, I run retrace manually to see my de-obfuscated stacktraces.

I'd appreciate if someone could help me understand why I'm seeing my full class and method name here? What can/should I do to prevent this?

like image 898
Zippy Avatar asked Sep 03 '17 13:09

Zippy


1 Answers

After weeks of agonising over this, I finally discovered the cause...

Suffice is to say, my released app is completely obfuscated - these de-obfuscated stack traces are coming from my own test device!!

Yes, my own test device running the app directly via Android Studio and unsigned. (And for obvious reason, I don't enable ProGuard on my debug builds).

The device I used for testing this app isn't a 'mainstream' device and the 'name' that appears in the Dev Consol bears no resemblance to the actual name of the device so I didn't notice straight away.

I'm fairly sure this never happened in the past (I've certainly not see it until now) - quite why anyone would want crash reports from their debug builds to appear in the Dev Console along with production build crashes, I don't know.

So, if someone is seeing this problem, check it's not your own debug builds causing the influx of stack traces before anything else!

like image 96
Zippy Avatar answered Oct 11 '22 12:10

Zippy