mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-08 05:24:39 +01:00
acf7097fda
My sign-inside-gradle is an uncommon trick and unnecessary. Better to follow the old convention of using jarsigner and zipalign.
39 lines
704 B
Bash
Executable file
39 lines
704 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -u -e
|
|
|
|
APKS=''
|
|
XW_WWW_PATH=${XW_WWW_PATH:-''}
|
|
LIST_FILE=1
|
|
|
|
usage() {
|
|
[ $# -gt 0 ] && echo "ERROR: $1"
|
|
echo "usage: $0 [--apk path/to/unsigned.apk]*"
|
|
}
|
|
|
|
while [ $# -gt 0 ]; do
|
|
case $1 in
|
|
--apk)
|
|
[ -e $2 ] || usage "no such file $2"
|
|
APKS="$APKS $2"
|
|
shift
|
|
;;
|
|
*)
|
|
usage "Unexpected flag $1"
|
|
;;
|
|
esac
|
|
shift
|
|
done
|
|
|
|
for APK in $APKS; do
|
|
if [ ${APK/-unsigned} == $APK ]; then
|
|
echo "$APK not unsigned; skipping"
|
|
continue
|
|
fi
|
|
APK_SIGNED=/tmp/$$_tmp.apk
|
|
cp $APK $APK_SIGNED
|
|
jarsigner -verbose -digestalg SHA1 -keystore ~/.keystore $APK_SIGNED mykey
|
|
rm -f ${APK/-unsigned/-signed}
|
|
zipalign -v 4 $APK_SIGNED ${APK/-unsigned/-signed}
|
|
rm -f $APK_SIGNED
|
|
done
|