Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chijikpijik/51c1ba2e245bbe2d8223270fb6062229 to your computer and use it in GitHub Desktop.
Save chijikpijik/51c1ba2e245bbe2d8223270fb6062229 to your computer and use it in GitHub Desktop.
Parse list of activities and deeplinks from AndroidManifest.xml
cat AndroidManifest.xml | sed -e ':a' -e 'N' -e '$!ba' -e 's/\.*<activity\n/\<activity/g' | awk '/\<activity.*/ {activity_line=$0;print activity_line"\n"} /.*scheme.*/ {print $1;} /.*host.*/ {print $1} /.*pathPrefix.*/ {print $1}' | sed $'s/\/\>/\\\n/g' | sed 's/.*\<activity.*android\:\(.*\)/\1/g' | awk '{RS="";FS="\n"}/.*name.*/{an=$0;next;} /.*/{print an"\n"$0}' | awk '/.*name.*/{if (x)print x;x="";}{x=(!x)?$0:x" "$0;}END{print x;}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment