From ebce94f7a478b0af49412deadac2fbb18c88a27a Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Mon, 19 Nov 2018 14:38:49 +0200 Subject: improvements to the andre-apk.sh --- andre-apk.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/andre-apk.sh b/andre-apk.sh index 90afffa..5a22206 100644 --- a/andre-apk.sh +++ b/andre-apk.sh @@ -1,7 +1,7 @@ #!/bin/sh argv0="$0" -msg() { printf -- '%s: %s\n' "$(basename "$argv0")" "$@" 1>&2; } +msg() { printf -- '%s: %s\n' "${argv0##*/}" "$@" 1>&2; } err() { msg "$@"; exit 1; } [ -z "$1" ] && err 'usage: ' @@ -20,7 +20,7 @@ case "$arch" in ;; esac -pkgname="$(aapt2 dump --file AndroidManifest.xml "$1" | grep -o '^ \+A: package="[a-zA-Z0-9._]\+"' | awk -F'"' '{print $2}')" +pkgname="$(aapt2 dump --file AndroidManifest.xml "$1" | sed -nr 's/.*A: package="([^ "]+).*/\1/p')" [ -z "$pkgname" ] && err "not a valid apk (missing package name)" tmpdir="$(mktemp -d)" -- cgit v1.2.3-70-g09d2