简体   繁体   English

使用Proguard时如何在Android Monitor中获取真实的类名

[英]How to get real class names in Android Monitor when using Proguard

I enabled Proguard for my app and now when I get an exception, in Android Monitor I'm seeing something like 我为我的应用启用了Proguard,现在当我遇到异常时,在Android Monitor中我看到类似

at com.mydomain.myapp.v.c(SourceFile:901)
at com.mydomain.myapp.v.a(SourceFile:1260)

In another app that I have, I also have proguard available, but I'm seeing something like 在我拥有的另一个应用程序中,我也有可用的proguard,但是我看到类似的东西

at com.mydomain.myotherapp.v.c(MainMenuScreen.java:948)

and I can click on the class name and Android Studio takes me to the exact line. 然后我可以单击类名,Android Studio会将我带到确切的行。 I've tried copying the entire contents of the proguard file to the first app and nothing changes. 我尝试将proguard文件的全部内容复制到第一个应用程序,并且没有任何更改。

What is the setting in my project that makes Android Monitor have nice clickable links? 我的项目中的哪些设置可使Android Monitor具有漂亮的可点击链接? In my proguard rules I have: 在我的保障规则中,我有:

-keepattributes Exceptions, InnerClasses, 
                Signature, Deprecated, SourceFile, EnclosingMethod, LineNumberTable

There is a reason why you run proguard and obfuscate the code, that reason is not being able to do that! 运行Proguard并混淆代码是有原因的,原因是无法做到这一点! Else it would totally dismiss the point of obfuscation. 否则,它将完全消除混淆点。

What you can do is to fetch your mapping.txt that is in your outputs folder and with the help of proguardgui.bat that is somewhere in your sdk folder you can get a normal stacktrace 您可以做的是获取输出文件夹中的mapping.txt,并在sdk文件夹中的proguardgui.bat的帮助下,您可以获得正常的stacktrace

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM