Skip to content

Commit eaa4f67

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

File tree

6 files changed

+33
-11
lines changed

6 files changed

+33
-11
lines changed

.appveyor.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ environment:
66
PREMAKE_VERSION: 5.0.0-alpha13
77
SDL_VERSION: 2.0.9
88
matrix:
9-
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
10-
SKIP_DEPLOY: skip
11-
TOOLSET: vs2017
12-
platform: Win32
13-
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
14-
SKIP_DEPLOY: skip
9+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 Preview
1510
TOOLSET: vs2017
1611
platform: x64
1712
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 Preview
1813
TOOLSET: vs2017
1914
platform: Win32
20-
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 Preview
15+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
2116
TOOLSET: vs2017
2217
platform: x64
18+
SKIP_DEPLOY: skip
19+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
20+
TOOLSET: vs2017
21+
platform: Win32
22+
SKIP_DEPLOY: skip
2323

2424
# TODO: Move to PowerShell script
2525
before_build:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,5 @@ config.json
7171
src/version.h
7272
out.txt
7373
*.xcworkspace
74+
75+
*.keystore

.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: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
apply plugin: 'com.android.application'
22

3+
def signingPassword = System.getenv("keystore_password")
4+
def signingEnabled = System.getenv("CI") == "true"
5+
36
android {
47
compileSdkVersion 28
58
defaultConfig {
@@ -18,12 +21,28 @@ android {
1821
abiFilters "x86_64", "arm64-v8a"
1922
}
2023
}
24+
signingConfigs {
25+
if (signingEnabled) {
26+
release {
27+
storeFile = file("../avocado.keystore")
28+
keyAlias = "avocado"
29+
storePassword = signingPassword
30+
keyPassword = signingPassword
31+
}
32+
}
33+
}
34+
2135
buildTypes {
2236
release {
2337
minifyEnabled false
2438
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
39+
if (signingEnabled) {
40+
signingConfig signingConfigs.release
41+
}
2542
}
2643
}
44+
45+
2746
// externalNativeBuild {
2847
// ndkBuild {
2948
// path 'jni/Android.mk'

android/avocado.keystore.enc

2.05 KB
Binary file not shown.

0 commit comments

Comments
 (0)