Skip to content

Instantly share code, notes, and snippets.

@ChenShiChao
Last active August 29, 2015 14:15
Show Gist options
  • Save ChenShiChao/8ab83a87059415a05d38 to your computer and use it in GitHub Desktop.
Save ChenShiChao/8ab83a87059415a05d38 to your computer and use it in GitHub Desktop.
Android根据mapping.txt还原混淆代码
一、把该文件放到附件中的retrace_crash.sh、mapping.txt放在SDK\tool\proguard\bin目录下,修改retrace_crash.sh里面的路径,先就这么用,后面优化
二、把需要分析的文件夹在SDK\tool\proguard\bin下面的crash文件夹下
三、在SDK\tool\proguard\bin目录下运行shell。输入:./retrace_crash.sh
四、如果命令无法运行
1、先试试chmod +x retrace_crash.sh命令
2、/bin/sh^M: bad interpreter: No such file or directory错误 ,vi retrace_crash.sh 使用命令 :set ff? 如果是dos格式的,那么你可以用set ff=unix把它强制为unix格式的, 然后存盘退
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment