Skip to content

Commit 3bcf9fd

Browse files
committed
android: added .apk sigining
1 parent d841687 commit 3bcf9fd

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ matrix:
1515
sudo: required
1616
dist: trusty
1717
cache: ccache
18+
before_install: openssl aes-256-cbc -K $encrypted_7333c7dd5b15_key -iv $encrypted_7333c7dd5b15_iv -in android/avocado.keystore.enc -out android/avocado.keystore -d
1819
install: "./.travis/android/pull-container.sh"
1920
script: "./.travis/android/run-container.sh"
2021
after_success: "./.travis/notify-discord.sh success $WEBHOOK_URL"

.travis/android/build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export DATE=`date +%Y%m%d`
88
export COMMIT=`git rev-parse --short=7 HEAD`
99
export ARTIFACT=avocado-$OS-$DATE-$COMMIT.apk
1010
export ASSETS_DIR=android/app/src/main/assets
11-
export TARGET_DIR=android/app/build/outputs/apk/debug
11+
export TARGET_DIR=android/app/build/outputs/apk/release
1212
export NDK_CCACHE="$(which ccache)"
1313

1414
# Configure cache
@@ -28,13 +28,13 @@ pushd android
2828
NDK_PROJECT_PATH=`pwd`/app ndk-build PM5_CONFIG=release_x64 -j4 avocado NDK_DEBUG=0
2929
ccache -s
3030

31-
# Java code (debug for now)
32-
./gradlew assembleDebug
31+
# Java code
32+
./gradlew assembleRelease
3333
popd
3434

3535
# Tests
3636
# No test suite for Android right now
3737

3838
# Package and prepare upload artifact
3939
mkdir -p upload
40-
cp $TARGET_DIR/app-debug.apk upload/$ARTIFACT
40+
cp $TARGET_DIR/app-release.apk upload/$ARTIFACT

android/app/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ android {
2424
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2525
}
2626
}
27+
28+
def isRunningOnTravis = System.getenv("CI") == "true"
29+
if (isRunningOnTravis) {
30+
signingConfigs.release.storeFile = file("../avocado.keystore")
31+
signingConfigs.release.keyAlias = "avocado"
32+
signingConfigs.release.storePassword = System.getenv("keystore_password")
33+
signingConfigs.release.keyPassword = System.getenv("keystore_password")
34+
}
35+
2736
// externalNativeBuild {
2837
// ndkBuild {
2938
// path 'jni/Android.mk'

android/avocado.keystore.enc

2.05 KB
Binary file not shown.

0 commit comments

Comments
 (0)