From 1c3bd87b78701c83bf8dc78ba2bdeabd48035e46 Mon Sep 17 00:00:00 2001 From: Noel Light-Hilary Date: Sun, 16 Sep 2018 16:38:26 +0100 Subject: [PATCH] Document Android production builds and add a helper script --- .env.example | 2 ++ .gitignore | 6 ++++++ Readme.md | 14 ++++++++++++++ build-helpers/android.sh | 8 ++++++++ 4 files changed, 30 insertions(+) create mode 100644 .env.example create mode 100755 build-helpers/android.sh diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..9660c42 --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +ANDROID_KEYSTORE_PATH=../path/to/your.keystore +ANDROID_ZIPALIGN_PATH=../path/to/zipalign/binary diff --git a/.gitignore b/.gitignore index 0286574..df52371 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,12 @@ # Specifies intentionally untracked files to ignore when using Git # http://git-scm.com/docs/gitignore +# Don't check in individual build config settings +.env + +# Don't check in production Android builds +PasswordMaker.apk + *~ *.sw[mnpcod] *.log diff --git a/Readme.md b/Readme.md index ec16cab..8a820f6 100644 --- a/Readme.md +++ b/Readme.md @@ -8,6 +8,20 @@ A modern mobile app supporting [Password Maker](https://passwordmaker.org/). Built with [Ionic](https://ionicframework.com/) and [Angular](https://angular.io/). +## Run locally + +* `ionic serve` +* Note that the clipboard feature is currently not available in browser. + +## Build + +### Android + +* Configure your local `.env` - copy from `.env.example` if missing. +* Run: `./build-helpers/android.sh` +* Enter signing key's password if prompted. +* Signed `PasswordMaker.apk` is created in the project root. + ## Icon & splash screen These use [Ionicons](https://ionicons.com/)' iOS-style key SVG (MIT licensed). diff --git a/build-helpers/android.sh b/build-helpers/android.sh new file mode 100755 index 0000000..ef9a6b5 --- /dev/null +++ b/build-helpers/android.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# Load configs +. .env + +ionic cordova build android --prod --release +jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore $ANDROID_KEYSTORE_PATH platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk webful +$ANDROID_ZIPALIGN_PATH -v 4 platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk PasswordMaker.apk