永发信息网

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

答案:2  悬赏:40  手机版
解决时间 2021-02-24 17:28
如何根据mapping.txt还原混淆的代码
最佳答案
1.把附件中的retrace_crash.sh、mapping.txt放在SDK\tool\proguard\bin目录下,修改retrace_crash.sh里面的路径,先就这么用,后面优化
retrace_crash.sh 修改此文件中的输出路径
mapping.txt 需要混淆打包过程中去获取

2.把需要分析的文件夹在SDK\tool\proguard\bin下面的crash文件夹下

3.在SDK\tool\proguard\bin目录下运行shell。输入:./retrace_crash.sh

4.如果命令无法运行
先试试chmod +x retrace_crash.sh命令
如果出现 /bin/sh^M: bad interpreter: No such file or directory错误,解决方法如下:
运行 vi retrace_crash.sh 使用命令 :set ff? 如果是dos格式的,那么你可以用set ff=unix把它强制为unix格式的, 然后存盘退

5.retrace_crash.sh 文件内容如下
#!/bin/bash
function ergodic(){
for file in ` ls $1 `
do
if [ -d $1"/"$file ]
then
ergodic $1"/"$file
else
#echo $1"/"$file >> b
./retrace.sh mapping.txt $1"/"$file >> $1"/_"$file
rm $1"/"$file
echo $1"/"$file
fi
done
}
INIT_PATH="/X_DISK/android-sdk-mac/tools/proguard/bin/crash"
ergodic $INIT_PATH
#echo 'hello'
#txt=$(ls crash/*.txt)
#for var in ${txt}
#do
#./retrace.sh mapping.txt ${var} >> parse${var}
#done
全部回答
根据mapping.txt还原混淆的代码 before 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.
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
一首歌,歌词里有:你哭着说永远,我笑着说再
真唐养生馆在什么地方啊,我要过去处理事情
直角悬垂举腿主要适用于发展以下哪块肌肉群()
辣鸡王怎么去啊,有知道地址的么
【人体正常血糖值的范围是多少】人体正常血糖
哺乳期间奶水少如何按摩乳房增加奶水分泌
东风小康富源东辰特约服务站我想知道这个在什
1990年5000万日元和1000万日元分别折合多少美
赛欧和悦纳RV汽车哪个好
我新开的淘宝店 有人昨天拍了我乱设置的一块
蜂蜜爽肤水怎么制作
曹县到上海的长途车一天有几班,票价多少,几
42e380s灯亮不开机,
天津军粮城工业园区管委会地址在什么地方,想
龙卷风是一种灾害性天气。小强同学根据天气预
推荐资讯
截然不同井然有序造句
丹妮鹭怎么去啊,有知道地址的么
乡村爱情3女演员名字
(4分)具有社会行为的动物,群体内部往往形
丁紫函姓名打分
劳动法不定时工作制与上下班考勤有矛盾
挚诚农机配件中心地址在哪,我要去那里办事
背架山在哪里啊,我有事要去这个地方
【内切】什么是两个圆的外离、外切、相交、内
爱宝童装屋在哪里啊,我有事要去这个地方
朵朵鲜花蛋糕店(师院店)这个地址在什么地方,
免疫抑制药的分类
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?