Skip to content

Instantly share code, notes, and snippets.

@kaedea
Created October 21, 2019 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaedea/595e570f4b51c80df580d86a12eaabb3 to your computer and use it in GitHub Desktop.
Save kaedea/595e570f4b51c80df580d86a12eaabb3 to your computer and use it in GitHub Desktop.
Retrace proguard stacktrace by copy-paste
# ENV
retraceJar=~/retrace/retrace-*.jar
# get input
mapping=$1
if [ ! "$mapping" ];then
read -p "Input mapping file path: " mapping
fi
if [ ! -f "$mapping" ];then
echo "mapping is not file"
exit 1
fi
input=$2
if [ ! "$input" ];then
read -rp 'please input the origin text to retrce. (press CTRL + D to commit): ' -d $'\04' data
declare -p data
input=$data
tempDir=$(mktemp -d)
tempFile="$tempDir/temp.txt"
echo "write input text to file, path = $tempFile"
echo "$input" >> "$tempFile"
input=$tempFile
fi
if [ ! -f "$input" ];then
echo "input is not file"
exit 1
fi
# dump input
echo ""
echo "args:"
echo "mapping: $mapping"
echo "retrace text:"
echo $input
# run retrace
function call {
cmd=$1
if [ ! "$cmd" ];then
echo "cmd is not given"
exit 1
fi
echo "execute: $cmd"
eval $cmd
}
echo ""
call "java -jar $retraceJar $mapping $input"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment