diff --git a/.github/workflows/build-authenticator.yml b/.github/workflows/build-authenticator.yml index fdf8be78c..a3ba414e1 100644 --- a/.github/workflows/build-authenticator.yml +++ b/.github/workflows/build-authenticator.yml @@ -127,6 +127,12 @@ jobs: az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ --name authenticator_aab-keystore.jks --file ${{ github.workspace }}/keystores/authenticator_aab-keystore.jks --output none + az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ + --name com.bitwarden.authenticator-google-services.json --file ${{ github.workspace }}/authenticator/src/google-services.json --output none + + az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ + --name com.bitwarden.authenticator.dev-google-services.json --file ${{ github.workspace }}/authenticator/src/debug/google-services.json --output none + - name: Download Firebase credentials if : ${{ inputs.distribute-to-firebase || github.event_name == 'push' }} env: diff --git a/.gitignore b/.gitignore index 81a240a15..3a70d94cd 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,7 @@ local.properties fastlane/report.xml fastlane/README.md /.kotlin/ + +# Secrets +/keystores/*.jks +google-services.json diff --git a/README-bwa.md b/README-bwa.md new file mode 100644 index 000000000..7e1b0b09a --- /dev/null +++ b/README-bwa.md @@ -0,0 +1,61 @@ +[![Github Workflow build on main](https://github.com/bitwarden/authenticator-android/actions/workflows/build-authenticator.yml/badge.svg?branch=main)](https://github.com/bitwarden/authenticator-android/actions/workflows/build-authenticator.yml?query=branch:main) +[![Join the chat at https://gitter.im/bitwarden/Lobby](https://badges.gitter.im/bitwarden/Lobby.svg)](https://gitter.im/bitwarden/Lobby) + +# Bitwarden Authenticator Android App + +Get it on Google Play + +Bitwarden Authenticator allows you easily store and generate two-factor authentication codes on your device. The Bitwarden Authenticator Android application is written in Kotlin. + + + +## Compatibility + +- **Minimum SDK**: 28 +- **Target SDK**: 34 +- **Device Types Supported**: Phone and Tablet +- **Orientations Supported**: Portrait and Landscape + +## Setup + + +1. Clone the repository: + + ```sh + $ git clone https://github.com/bitwarden/authenticator-android + ``` + +2. Create a `user.properties` file in the root directory of the project and add the following properties: + + - `gitHubToken`: A "classic" Github Personal Access Token (PAT) with the `read:packages` scope (ex: `gitHubToken=gph_xx...xx`). These can be generated by going to the [Github tokens page](https://github.com/settings/tokens). See [the Github Packages user documentation concerning authentication](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#authenticating-to-github-packages) for more details. + +3. Setup the code style formatter: + + All code must follow the guidelines described in the [Code Style Guidelines document](docs/STYLE_AND_BEST_PRACTICES.md). To aid in adhering to these rules, all contributors should apply `docs/bitwarden-style.xml` as their code style scheme. In IntelliJ / Android Studio: + + - Navigate to `Preferences > Editor > Code Style`. + - Hit the `Manage` button next to `Scheme`. + - Select `Import`. + - Find the `bitwarden-style.xml` file in the project's `docs/` directory. + - Import "from" `BitwardenStyle` "to" `BitwardenStyle`. + - Hit `Apply` and `OK` to save the changes and exit Preferences. + + Note that in some cases you may need to restart Android Studio for the changes to take effect. + + All code should be formatted before submitting a pull request. This can be done manually but it can also be helpful to create a macro with a custom keyboard binding to auto-format when saving. In Android Studio on OS X: + + - Select `Edit > Macros > Start Macro Recording` + - Select `Code > Optimize Imports` + - Select `Code > Reformat Code` + - Select `File > Save All` + - Select `Edit > Macros > Stop Macro Recording` + + This can then be mapped to a set of keys by navigating to `Android Studio > Preferences` and editing the macro under `Keymap` (ex : shift + command + s). + + Please avoid mixing formatting and logical changes in the same commit/PR. When possible, fix any large formatting issues in a separate PR before opening one to make logical changes to the same code. This helps others focus on the meaningful code changes when reviewing the code. + +## Contribute + +Code contributions are welcome! Please commit any pull requests against the `main` branch. Learn more about how to contribute by reading the [Contributing Guidelines](https://contributing.bitwarden.com/contributing/). Check out the [Contributing Documentation](https://contributing.bitwarden.com/) for how to get started with your first contribution. + +Security audits and feedback are welcome. Please open an issue or email us privately if the report is sensitive in nature. You can read our security policy in the [`SECURITY.md`](SECURITY.md) file. diff --git a/authenticator/src/google-services.json b/authenticator/src/google-services.json deleted file mode 100644 index 8ddec8643..000000000 --- a/authenticator/src/google-services.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "project_info": { - "project_number": "867301491091", - "project_id": "bitwarden-authenticator", - "storage_bucket": "bitwarden-authenticator.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:867301491091:android:50b626dba42a361651e866", - "android_client_info": { - "package_name": "com.bitwarden.authenticator" - } - }, - "oauth_client": [], - "api_key": [ - { - "current_key": "AIzaSyDDXnnBuWzuh8rlihiMWRPif_sqkGk3fxw" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [] - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ac92a0a8b..e1dfa28c8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -71,7 +71,7 @@ androidx-compose-material3 = { module = "androidx.compose.material3:material3" } androidx-compose-runtime = { module = "androidx.compose.runtime:runtime" } androidx-compose-ui = { module = "androidx.compose.ui:ui" } androidx-compose-ui-graphics = { module = "androidx.compose.ui:ui-graphics" } -androidx-compose-ui-test = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "androidxComposeUiTest" } +androidx-compose-ui-test = { module = "androidx.compose.ui:ui-test-junit4" } androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" } androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }