Skip to content

Commit

Permalink
android: added .apk sigining
Browse files Browse the repository at this point in the history
  • Loading branch information
JaCzekanski committed Jul 31, 2019
1 parent d841687 commit eaa4f67
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 11 deletions.
14 changes: 7 additions & 7 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ environment:
PREMAKE_VERSION: 5.0.0-alpha13
SDL_VERSION: 2.0.9
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
SKIP_DEPLOY: skip
TOOLSET: vs2017
platform: Win32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
SKIP_DEPLOY: skip
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 Preview
TOOLSET: vs2017
platform: x64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 Preview
TOOLSET: vs2017
platform: Win32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 Preview
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: vs2017
platform: x64
SKIP_DEPLOY: skip
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: vs2017
platform: Win32
SKIP_DEPLOY: skip

# TODO: Move to PowerShell script
before_build:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@ config.json
src/version.h
out.txt
*.xcworkspace

*.keystore
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ matrix:
sudo: required
dist: trusty
cache: ccache
before_install: openssl aes-256-cbc -K $encrypted_7333c7dd5b15_key -iv $encrypted_7333c7dd5b15_iv -in android/avocado.keystore.enc -out android/avocado.keystore -d
install: "./.travis/android/pull-container.sh"
script: "./.travis/android/run-container.sh"
after_success: "./.travis/notify-discord.sh success $WEBHOOK_URL"
Expand Down
8 changes: 4 additions & 4 deletions .travis/android/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export DATE=`date +%Y%m%d`
export COMMIT=`git rev-parse --short=7 HEAD`
export ARTIFACT=avocado-$OS-$DATE-$COMMIT.apk
export ASSETS_DIR=android/app/src/main/assets
export TARGET_DIR=android/app/build/outputs/apk/debug
export TARGET_DIR=android/app/build/outputs/apk/release
export NDK_CCACHE="$(which ccache)"

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

# Java code (debug for now)
./gradlew assembleDebug
# Java code
./gradlew assembleRelease
popd

# Tests
# No test suite for Android right now

# Package and prepare upload artifact
mkdir -p upload
cp $TARGET_DIR/app-debug.apk upload/$ARTIFACT
cp $TARGET_DIR/app-release.apk upload/$ARTIFACT
19 changes: 19 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
apply plugin: 'com.android.application'

def signingPassword = System.getenv("keystore_password")
def signingEnabled = System.getenv("CI") == "true"

android {
compileSdkVersion 28
defaultConfig {
Expand All @@ -18,12 +21,28 @@ android {
abiFilters "x86_64", "arm64-v8a"
}
}
signingConfigs {
if (signingEnabled) {
release {
storeFile = file("../avocado.keystore")
keyAlias = "avocado"
storePassword = signingPassword
keyPassword = signingPassword
}
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
if (signingEnabled) {
signingConfig signingConfigs.release
}
}
}


// externalNativeBuild {
// ndkBuild {
// path 'jni/Android.mk'
Expand Down
Binary file added android/avocado.keystore.enc
Binary file not shown.

0 comments on commit eaa4f67

Please sign in to comment.