{"id":13604405,"url":"https://github.com/infinum/Android-Goldfinger","last_synced_at":"2025-04-12T02:30:35.888Z","repository":{"id":39285807,"uuid":"109246147","full_name":"infinum/Android-Goldfinger","owner":"infinum","description":"Android library to simplify Biometric authentication implementation.","archived":false,"fork":false,"pushed_at":"2024-09-03T14:46:41.000Z","size":353,"stargazers_count":653,"open_issues_count":7,"forks_count":76,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-11-05T04:10:33.945Z","etag":null,"topics":["android","android-development","android-library","biometric","biometric-authentication","cipher","encryption","fingerprint","fingerprint-authentication","open-source"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/infinum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-02T09:49:22.000Z","updated_at":"2024-11-02T04:35:12.000Z","dependencies_parsed_at":"2024-10-01T03:01:16.027Z","dependency_job_id":"081b2056-8df1-4c6c-8075-1ed194d6d0c9","html_url":"https://github.com/infinum/Android-Goldfinger","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinum%2FAndroid-Goldfinger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinum%2FAndroid-Goldfinger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinum%2FAndroid-Goldfinger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinum%2FAndroid-Goldfinger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infinum","download_url":"https://codeload.github.com/infinum/Android-Goldfinger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223489529,"owners_count":17153776,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-development","android-library","biometric","biometric-authentication","cipher","encryption","fingerprint","fingerprint-authentication","open-source"],"created_at":"2024-08-01T19:00:45.125Z","updated_at":"2025-04-12T02:30:35.882Z","avatar_url":"https://github.com/infinum.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# Deprecated\nThis library is no longer supported and will not receive any more updates.\n\n# Goldfinger\n\n\u003cimg src='./logo.svg' width='264'/\u003e\n\n## Description\n\nAndroid library to simplify Biometric authentication implementation.\n\n## Table of contents\n\n* [Requirements](#requirements)\n* [Getting started](#getting-started)\n* [Usage](#usage)\n* [Rx module](#rx-module)\n* [Configuration](#configuration)\n* [Known issues](#known-issues)\n* [Contributing](#contributing)\n* [License](#license)\n* [Credits](#credits)\n\n## Requirements\n\nThe project requires a minimum API version 14.\n\n#### Important\n\nThis version is compatible with `androidx.biometric`. If you do not want to use `androidx.biometric`, feel free to use [older version of Goldfinger](https://github.com/infinum/Android-Goldfinger/tree/v1.2.1).\n\n## Getting started\n\n#### Add mavenCentral\n\nTo include Goldfinger in your project, you have to add buildscript dependencies in your project level `build.gradle`:\n\n```groovy\nbuildscript {\n    repositories {\n        mavenCentral()\n    }\n}\n```\n\n#### Add dependency\n\n```gradle\nimplementation 'com.infinum:goldfinger:2.2.0'\n```\n\n## Usage\n\n#### Initialize\n\n```java\nGoldfinger.Builder(context).build()\n```\n\n#### Check prerequisites\n\n```java\nif (goldfinger.canAuthenticate(@AuthenticatorTypes int authenticators)) {\n  /* Authenticate */\n}\n```\n\n#### Build params\n\nPromptParams are directly linked to [BiometricPrompt.PromptInfo](https://developer.android.com/reference/androidx/biometric/BiometricPrompt.PromptInfo.Builder.html) so be sure to read which parameters are required.\n\n```java\nGoldfinger.PromptParams params = new Goldfinger.PromptParams.Builder(activity)\n  .title(\"Title\")\n  .negativeButtonText(\"Cancel\")\n  .description(\"Description\")\n  .subtitle(\"Subtitle\")\n  .build();\n```\n\nI also suggest looking at [ValidateUtils](./core/src/main/java/co/infinum/goldfinger/ValidateUtils.java) class to understand what is allowed by the Biometric library.\n\n#### Authenticate\n\n```java\ngoldfinger.authenticate(params, new Goldfinger.Callback() {\n    @Override\n    public void onError(@NonNull Exception e) {\n        /* Critical error happened */\n    }\n\n    @Override\n    public void onResult(@NonNull Goldfinger.Result result) {\n        /* Result received */\n    }\n});\n```\n\nYou can see all Goldfinger methods [here](./core/src/main/java/co/infinum/goldfinger/Goldfinger.java).\n\n## Rx module\n\nGoldfinger has separate Rx module in case you want to use reactive approach.\n\n#### Add dependencies\n\n```gradle\nimplementation 'com.infinum:goldfinger:2.2.0'\nimplementation 'com.infinum:goldfinger-rx:2.2.0'\n```\n\n#### Initialize\n\n```java\nRxGoldfinger.Builder(context).build()\n```\n\n#### Authenticate\n\n```java\ngoldfinger.authenticate(params).subscribe(new DisposableObserver\u003cGoldfinger.Result\u003e() {\n\n  @Override\n  public void onComplete() {\n    /* Biometrics authentication is finished */\n  }\n\n  @Override\n  public void onError(Throwable e) {\n    /* Critical error happened */\n  }\n\n  @Override\n  public void onNext(Goldfinger.Result result) {\n    /* Result received */\n  }\n});\n```\n\nYou can see all RxGoldfinger methods [here](./rx/src/main/java/co/infinum/goldfinger/rx/RxGoldfinger.java).\n\n## Configuration\n\nIf you don’t like default implementations, you can easily modify them using `Goldfinger.Builder` object.\n\n```java\nGoldfinger.Builder(context)\n  .logEnabled(true)\n  .cipherFactory(factory)\n  .cipherCrypter(crypter)\n  .build()\n```\n\n**Important**: Both Factory and Crypter should use same object type. If MacFactory is used, be sure to also provide MacCrypter!\n\n#### Factory (Cipher, Mac, Signature)\n\nFactory class should be used to create `Cipher`/`Mac`/`Signature` which will be used internally when `CryptoObject` is created.\n\n```java\nnew CipherFactory() {\n  @Nullable\n  @Override\n  public Cipher createEncryptionCrypter(String key) {\n     /* Create Cipher for encryption */\n  }\n\n  @Nullable\n  @Override\n  public Cipher createDecryptionCrypter(String key) {\n    /* Create Cipher for decryption */\n  }\n};\n```\n\nGoldfinger will default to [AesCipherFactory](./core/src/main/java/co/infinum/goldfinger/crypto/impl/AesCipherFactory.java) if other implementation is not provided.\n\n#### Crypter (Cipher, Mac, Signature)\n\nCrypter class should be used to encrypt/decrypt data with `Cipher`/`Mac`/`Signature` which was created with `Factory` above.\n\n```java\nnew CipherCrypter() {\n  @Nullable\n  @Override\n  public String encrypt(@NonNull Cipher crypter, @NonNull String value) {\n    /* Encrypt data with given crypter */\n  }\n\n  @Nullable\n  @Override\n  public String decrypt(@NonNull Cipher crypter, @NonNull String value) {\n    /* Decrypt data with given crypter */\n  }\n};\n```\n\nGoldfinger will default to [Base64CipherCrypter](./core/src/main/java/co/infinum/goldfinger/crypto/impl/Base64CipherCrypter.java) if other implementation is not provided.\n\n#### Logging\n\nLogging is **off** by default. You can enable it by calling `Goldfinger.Builder(context).logEnabled(true)`.\n\n## Known issues\n\n- Android Oreo does not throw `KeyPermanentlyInvalidatedException` - [Link](https://issuetracker.google.com/issues/65578763)\n\n## Contributing\n\nWe believe that the community can help us improve and build better a product.\nPlease refer to our [contributing guide](CONTRIBUTING.md) to learn about the types of contributions we accept and the process for submitting them.\n\nTo ensure that our community remains respectful and professional, we defined a [code of conduct](CODE_OF_CONDUCT.md) \u003c!-- and [coding standards](\u003clink\u003e) --\u003e that we expect all contributors to follow.\n\nWe appreciate your interest and look forward to your contributions.\n\n## License\n\n```\nCopyright 2018 Infinum\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\n## Credits\n\nMaintained and sponsored by [Infinum](https://infinum.com).\n\n\u003cp align=\"center\"\u003e\n  \u003ca href='https://infinum.com'\u003e\n    \u003cpicture\u003e\n        \u003csource srcset=\"https://assets.infinum.com/brand/logo/static/white.svg\" media=\"(prefers-color-scheme: dark)\"\u003e\n        \u003cimg src=\"https://assets.infinum.com/brand/logo/static/default.svg\"\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinum%2FAndroid-Goldfinger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfinum%2FAndroid-Goldfinger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinum%2FAndroid-Goldfinger/lists"}