Skip to content

Instantly share code, notes, and snippets.

@stefan-girlich
Created April 30, 2015 09:15
Show Gist options
  • Save stefan-girlich/3cc6ad46ec2d00ad2b92 to your computer and use it in GitHub Desktop.
Save stefan-girlich/3cc6ad46ec2d00ad2b92 to your computer and use it in GitHub Desktop.
Grabs an ProGuard-obfuscated Android stack trace from the OSX pasteboard, deobfuscates it using the given mapping.txt and writes the result back to the pasteboard.
#!/bin/bash
# Grabs an ProGuard-obfuscated Android stack trace from the OSX pasteboard, deobfuscates it using the given mapping.txt and writes the result back to the pasteboard.
RETRACE_BIN="retrace.sh"
MAPPING_FILE=$1
TMP_FILE="/tmp/"$(basename $0)"_tmp_outfile.txt"
if [ -z "$MAPPING_FILE" ]; then
echo "Mapping file is not given."
exit 1
fi
pbpaste > $TMP_FILE
if [ $? -ne 0 ]; then
echo "Could not write to temporary file $TMP_FILE ."
exit 2
fi
$RETRACE_BIN $MAPPING_FILE $TMP_FILE | pbcopy
rm $TMP_FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment