File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,13 +21,20 @@ if [ -z $JKS_KEYPASS ]; then
2121 exit 1
2222fi
2323
24+ # Zipalign
25+ zipalign=$( find $ANDROID_HOME /build-tools -name " zipalign" -print | head -n 1)
26+ $zipalign -v 4 $input $input .new
27+ mv $input .new $input
28+
2429# Sign
25- jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 \
26- -storepass $JKS_STOREPASS -keypass $JKS_KEYPASS \
27- -keystore android.jks $input activitywatch
28- jarsigner -verify $input
29- mv $input $output
30+ # Using apksigner instead of jarsigner since API 30+: https://stackoverflow.com/a/69473649
31+ apksigner= $( find $ANDROID_HOME /build-tools -name " apksigner " -print | head -n 1 )
32+ $apksigner sign --ks android.jks --ks-key-alias activitywatch \
33+ --ks-pass env:JKS_STOREPASS --key-pass env:JKS_KEYPASS \
34+ $input
3035
31- zipalign=$( find $ANDROID_HOME /build-tools -name " zipalign" -print | head -n 1)
32- $zipalign -v 4 $output $output .new
33- mv $output .new $output
36+ # Verify
37+ $apksigner verify $input
38+
39+ # Move to output destination
40+ mv $input $output
You can’t perform that action at this time.
0 commit comments