Skip to content

Commit

Permalink
Switch to apk-signer
Browse files Browse the repository at this point in the history
  • Loading branch information
danielyrovas committed Feb 15, 2024
1 parent 36048c8 commit da2f36f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,23 @@ jobs:
- name: Execute Gradle build
run: ./gradlew --no-daemon --build-cache assembleRelease

- name: Get build tools
run: |
BUILD_TOOLS_PATH=/usr/local/lib/android/sdk/build-tools/$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
echo "BUILD_TOOLS=$BUILD_TOOLS_PATH" >> $GITHUB_ENV
- name: Zipalign the APK
run: |
$BUILD_TOOLS/zipalign -v 4 app/build/outputs/apk/release/app-release-unsigned.apk app-release-unsigned.apk
- name: Sign the APK
run: |
echo "${{ secrets.KEYSTORE }}" > keystore.asc
gpg -d --passphrase "${{ secrets.KEY_PASSWD }}" --batch keystore.asc > keystore.jks
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore keystore.jks -storepass ${{ secrets.KEY_PASSWD }} -keypass ${{ secrets.KEY_PASSWD }} app/build/outputs/apk/release/app-release-unsigned.apk ${{ secrets.KEY_ALIAS }}
$BUILD_TOOLS/apksigner sign --ks keystore.jks --ks-key-alias ${{ secrets.KEY_ALIAS }} --ks-pass pass:${{ secrets.KEY_PASSWD }} --key-pass pass:${{ secrets.KEY_PASSWD }} --out app-release.apk app-release-unsigned.apk
- name: Verify the APK signature
run: jarsigner -verify -verbose -certs -keystore keystore.jks -storepass ${{ secrets.KEY_PASSWD }} app/build/outputs/apk/release/app-release-unsigned.apk ${{ secrets.KEY_ALIAS }}

- name: Zipalign the APK
run: |
BUILD_TOOLS_PATH=/usr/local/lib/android/sdk/build-tools/$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
$BUILD_TOOLS_PATH/zipalign -v 4 app/build/outputs/apk/release/app-release-unsigned.apk app/build/outputs/apk/release/app-release.apk
run: apksigner verify app-release.apk

- name: Create Release
id: create_release
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
app-versionID = "org.yrovas.linklater"
app-versionCode = "2"
app-versionName = "0.1.1"
app-versionCode = "1"
app-versionName = "0.1.0"
app-compileSDK = "34"
app-targetSDK = "34"
app-minimumSDK = "23"
Expand Down

0 comments on commit da2f36f

Please sign in to comment.