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,19 @@ 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 sign --ks android.jks --ks-key-alias activitywatch \
32+ --ks-pass env:JKS_STOREPASS --key-pass env:JKS_KEYPASS \
33+ $input
3034
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
35+ # Verify
36+ apksigner verify $input
37+
38+ # Move to output destination
39+ mv $input $output
You can’t perform that action at this time.
0 commit comments