如何根据mapping.txt还原混淆的代码

转载:http://blog.csdn.net/oo_oo_/article/details/37651335

Here’s the stack trace as obfuscated by ProGuard:

Caused by: java.lang.NullPointerException
at net.simplyadvanced.ltediscovery.be.u(Unknown Source)
at net.simplyadvanced.ltediscovery.at.v(Unknown Source)
at net.simplyadvanced.ltediscovery.at.d(Unknown Source)
at net.simplyadvanced.ltediscovery.av.onReceive(Unknown Source)
AFTER
All you need to do is write one line in the command prompt, and the obfuscation will be removed, as you can see here:

Caused by: java.lang.NullPointerException
at net.simplyadvanced.ltediscovery.UtilTelephony.boolean is800MhzNetwork()(Unknown Source)
at net.simplyadvanced.ltediscovery.ServiceDetectLte.void checkAndAlertUserIf800MhzConnected()(Unknown Source)
at net.simplyadvanced.ltediscovery.ServiceDetectLte.void startLocalBroadcastReceiver()(Unknown Source)
at net.simplyadvanced.ltediscovery.ServiceDetectLte$2.void onReceive(android.content.Context,android.content.Intent)(Unknown Source)

HOW TO DECODE STACK TRACE
You can choose either the command line method or GUI (Graphical User Interface) method.


HOW TO DECODE STACK TRACE VIA GUI
1) Open <android-sdk>/tools/proguard/bin/proguardgui.bat
2) Select the “ReTrace” option on the left column.
3) Add your mapping file and obfuscated stack trace.
4) Click “ReTrace!”

Thanks to David Bilik for mentioning this GUI method.

HOW TO DECODE STACK TRACE VIA COMMAND LINE
1) You will need your ProGuard’s mapping.txt file and the stack trace (Ex: stacktrace.txt) that you want to de-obfuscate.
2) The easiest way to do the next step is copy both these files into your<android_sdk_root>/tools/proguard/bin.
3) If you are on Windows, run the following command in the same directory as the files (make sure you change to your own file names):

retrace.bat -verbose mapping.txt stacktrace.txt > out.txt
4) out.txt will have the stack trace de-obfuscated. Now you can debug much easier and faster than before.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值