# google-authenticator-android **Repository Path**: mirrors_google/google-authenticator-android ## Basic Information - **Project Name**: google-authenticator-android - **Description**: Open source fork of the Google Authenticator Android app - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-01-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Google Authenticator for Android (Open Source Version) This project is an open source fork of the Google Authenticator Android app on the [Play Store][playstore]. While this fork is open source, the [official version][playstore] of the app still remains proprietary. There is no guarantee that the [open source repository][Android] will receive any changes made upstream (or vice versa). > Google Authenticator generates 2-Step Verification codes on your phone. > > 2-Step Verification provides stronger security for your Google Account by > requiring a second step of verification when you sign in. In addition to your > password, you’ll also need a code generated by the Google Authenticator app on > your phone. > > Learn more about 2-Step Verification: https://g.co/2step > > Features: > * Generate verification codes without a data connection > * Google Authenticator works with many providers & accounts > * Dark theme available > * Automatic setup via QR code **Disclaimer:** This _open source fork_ of Authenticator is **not** an officially supported Google product. ## Description The Google Authenticator project includes implementations of one-time passcode generators for several mobile platforms, as well as a Pluggable Authentication Module [(PAM)][PAM]. One-time passcodes are generated using open standards developed by the [Initiative for Open Authentication (OATH)][OATH] (which is unrelated to [OAuth][]). * This project contains the Android app. [All other apps][iOS] and the [PAM module][libpam] are hosted in separate projects. * The Android implementation supports the HMAC-Based One-time Password (HOTP) algorithm specified in [RFC 4226][] and the Time-based One-time Password (TOTP) algorithm specified in [RFC 6238][]. * By design, there are **no account backups** in any of the apps. Further documentation is available in the [Wiki][]. ## Installation The APKs for the official version and the open source version of Authenticator are hosted separately. Installing the app should be as simple as downloading the APK from your desired source. ### Official Google Build You can install the official (proprietary) version of Google Authenticator from the [Google Play Store][playstore]. ### Open Source Version The easiest way to install the open source flavor of Authenticator is to download the latest version of the APK from the [releases page][] from the GitHub repository. To build the APK from the source code, see the section about [building from source](#building-from-source). ## Developer Guide Interested in developing with Authenticator? Instructions to get started are below. Please be sure to review the [Contributor Guide](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md) if you would like to contribute to this repository. ### Prerequisites * [Android SDK][] v28 * [Android Build Tools][] v28.0.3 * [Bazel][] 0.12.0+ * [Git][] Google Authenticator is built with [Bazel][]. To install Bazel on your machine, follow the [installation instructions][bazel-install] provided in the official Bazel documentation. You can download the appropriate versions of the Android SDK and Build Tools via the Android [SDK Manager][]. ### Building from Source 1. Clone the repository. ```bash git clone https://github.com/google/google-authenticator-android.git cd google-authenticator-android ``` 2. Set the `ANDROID_HOME` environment variable to the path of your Android SDK, or hardcode the value into the `WORKSPACE` file. ```bash export ANDROID_HOME="/path/to/sdk" # or $EDITOR WORKSPACE ``` 3. Build the APK with Bazel. The APK build target is at `//java/com/google/android/apps/authenticator`. If you already have an emulator running or device attached to your machine, you can use the `mobile-install` Bazel directive to put the app directly on your Android device. Otherwise, build the APK normally and install it on your device via `adb`. ```bash bazel mobile-install //java/com/google/android/apps/authenticator # or bazel build //java/com/google/android/apps/authenticator \ && adb install -r -d bazel-bin/java/com/google/android/apps/authenticator/authenticator.apk ``` ### Running Tests Running the tests for Authenticator requires additional [prerequisites][test-prerequisites] described in the `android_instrumentation_test` documentation. Most notably, at the moment, _tests can only be run on [Linux][test-known-issues]_. There is an open [tracking issue][bazel-test-tracking-issue] for adding test support to other operating systems. Please file Bazel-related issues against the [Bazel repository][] instead of this repository. Running tests also requires the appropriate Android emulator images to be installed (depending on the specific test target). You can download any necessary images from the [AVD Manager][system-images]. #### Test Targets All test targets can be found under the `javatests/` directory. ```bash bazel test //javatests/... ``` #### Test Configs By default, all tests will be run on a headless emulator. To see the Android device running the test, or to run tests on a specific device or emulator, specify the value of the `config` flag in the Bazel test command to be one of `headless`, `gui`, or `local_device`. ```bash # Run headless tests (default) bazel test --config=headless //javatests/com/google/android/apps/authenticator:authenticator_instrumentation_tests-19 # Run tests on an ephemeral emulator that displays the GUI bazel test --config=gui //javatests/com/google/android/apps/authenticator:authenticator_instrumentation_tests-19 # Run tests on an emulator or attached device bazel test --config=local_device //javatests/com/google/android/apps/authenticator:authenticator_instrumentation_tests-19 ``` **WARNING:** Running tests on a real device may delete your preexisting OTP seeds. Do it at your own risk. If you must run tests on a real device, it is recommended to use a test device that doesn't hold important data. ## License ``` Copyright 2019 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ``` [playstore]: https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2 [PAM]: http://www.opengroup.org/rfc/rfc86.0.html [OATH]: http://www.openauthentication.org/ [OAuth]: http://oauth.net/ [RFC 4226]: https://tools.ietf.org/html/rfc4226 [RFC 6238]: https://tools.ietf.org/html/rfc6238 [Android]: https://github.com/google/google-authenticator-android [iOS]: https://github.com/google/google-authenticator [libpam]: https://github.com/google/google-authenticator-libpam [Wiki]: https://github.com/google/google-authenticator/wiki [releases page]: https://github.com/google/google-authenticator-android/releases [Android SDK]: https://developer.android.com/studio/index.html [Android Build Tools]: https://developer.android.com/studio/releases/build-tools [Bazel]: https://bazel.build/ [Bazel repository]: https://github.com/bazelbuild/bazel [Git]: https://git-scm.com/ [SDK Manager]: https://developer.android.com/studio/intro/update.html [bazel-install]: https://docs.bazel.build/versions/master/install.html#installing-bazel [test-prerequisites]: https://docs.bazel.build/versions/master/android-instrumentation-test.html#prerequisites [test-known-issues]: https://docs.bazel.build/versions/master/android-instrumentation-test.html#known-issues [bazel-test-tracking-issue]: https://github.com/bazelbuild/bazel/issues/7069 [system-images]: https://developer.android.com/studio/run/managing-avds#system-image