diff --git a/.gitignore b/.gitignore index ee39577df..2e54b01bc 100644 --- a/.gitignore +++ b/.gitignore @@ -418,4 +418,7 @@ temp # libraries and copied to the application so they can be used for debugging, but we don't need # to check them in as it's not needed for the applications to actually run. **/*.js.map -**/*.mjs.map \ No newline at end of file +**/*.mjs.map + +# Android keystore file (for publishing to Google Play) +*.keystore diff --git a/apps/mobile-app/android/app/build.gradle b/apps/mobile-app/android/app/build.gradle index 9b2428ce1..8c02b6a99 100644 --- a/apps/mobile-app/android/app/build.gradle +++ b/apps/mobile-app/android/app/build.gradle @@ -103,6 +103,14 @@ android { keyAlias 'androiddebugkey' keyPassword 'android' } + release { + if (project.hasProperty('ALIASVAULT_UPLOAD_STORE_FILE')) { + storeFile file(ALIASVAULT_UPLOAD_STORE_FILE) + storePassword ALIASVAULT_UPLOAD_STORE_PASSWORD + keyAlias ALIASVAULT_UPLOAD_KEY_ALIAS + keyPassword ALIASVAULT_UPLOAD_KEY_PASSWORD + } + } } buildTypes { debug { @@ -112,6 +120,7 @@ android { // Caution! In production, you need to generate your own keystore file. // see https://reactnative.dev/docs/signed-apk-android. signingConfig signingConfigs.debug + signingConfig signingConfigs.release shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false) minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" diff --git a/docs/misc/release/create-new-release.md b/docs/misc/release/create-new-release.md index f8d6c08d5..69ca8fced 100644 --- a/docs/misc/release/create-new-release.md +++ b/docs/misc/release/create-new-release.md @@ -27,6 +27,7 @@ Follow the steps in the checklist below to prepare a new release. - [ ] Update `./apps/mobile-app/utils/AppInfo.ts` with the minimum supported server version (in case of required API breaking changes). - [ ] Update `./apps/mobile-app/utils/AppInfo.ts` with the minimum supported client vault version (in case of required client vault model changes). - [ ] Update `./apps/mobile-app/ios/AliasVault.xcodeproj/project.pbxproj` and set the version in `MARKETING_VERSION` and increase the build number in `CURRENT_PROJECT_VERSION`. This is the version that will be shown in the iOS App Store. +- [ ] Update `./apps/mobile-app/android/app/build.gradle` and set the version in `versionName` and increase the build number in `versionCode`. ## Docker Images If docker containers have been added or removed: diff --git a/docs/mobile-apps/android/build-from-source.md b/docs/mobile-apps/android/build-from-source.md index aacb4cb52..1e47e7785 100644 --- a/docs/mobile-apps/android/build-from-source.md +++ b/docs/mobile-apps/android/build-from-source.md @@ -52,3 +52,30 @@ adb devices adb -s [device-id] install android/app/build/outputs/apk/release/app-release.apk ``` +6. For publishing to Google Play: +Create a local gradle file in your user directory where the keystore credentials will be placed +```bash +nano ~/.gradle/gradle.properties +``` + +Input the following contents and input the correct password: + +```bash +ALIASVAULT_UPLOAD_STORE_FILE=aliasvault-upload-key.keystore # Path to the keystore file +ALIASVAULT_UPLOAD_KEY_ALIAS=aliasvault-key-alias # Replace with value of the `keystore.keyAlias` +ALIASVAULT_UPLOAD_STORE_PASSWORD=***** # Replace with the password to the keystore +ALIASVAULT_UPLOAD_KEY_PASSWORD=***** # Replace with the password to the keystore +``` + +Then create the bundle for upload to Google Play: + +```bash +cd android +./gradlew app:bundleRelease +``` + +The resulting .aapb file will be available in: + +```bash +app/build/outputs/bundle/release +``` diff --git a/docs/mobile-apps/android/index.md b/docs/mobile-apps/android/index.md index 1efcf7290..4100c2d5b 100644 --- a/docs/mobile-apps/android/index.md +++ b/docs/mobile-apps/android/index.md @@ -11,8 +11,8 @@ In order to install the Android iOS app, see the options below. ## Download from App Store You can download the AliasVault mobile app via the Google Play store. -1. Go to the [Google Play Store](#todo) -2. Click on the "Get" button +1. Go to the [Google Play Store](https://play.google.com/store/apps/details?id=net.aliasvault.app) +2. Click on the "Install" button 3. The app will be installed. Open the app and follow the instructions. ## Build from Source