-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsign
More file actions
executable file
·37 lines (30 loc) · 734 Bytes
/
Copy pathsign
File metadata and controls
executable file
·37 lines (30 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
Output() {
echo "$(date -d "1970-01-01 UTC $2 seconds") - $1"
}
Duration() {
local S=$(echo $FINISH_TIME $BEGIN_TIME | awk '{print$1-$2}')
((h=S/3600))
((m=S%3600/60))
((s=S%60))
printf "Signing took: %dh:%dm:%ds\n" $h $m $s
}
Begin() {
BEGIN_TIME=$(date +%s)
Output Begin $BEGIN_TIME "$1"
}
Finish() {
FINISH_TIME=$(date +%s)
Output Finished $FINISH_TIME "$1"
Duration
}
[ $# -eq 0 ] && { echo "Usage: $0 'input'"; exit 1; }
SIGNDIR=~/bin/keys
INPUT="$1"
OUTPUT="${INPUT%.*}"-signed.apk
Begin
echo "Signing ${INPUT##*/} as ${OUTPUT##*/}"
java -jar $SIGNDIR/signapk.jar $SIGNDIR/testkey.x509.pem $SIGNDIR/testkey.pk8 "$INPUT" "$OUTPUT"
echo "Done!"
Finish
read -p "Press [Enter] to continue."