{"id":15519598,"url":"https://github.com/ethanblake4/exponentcore","last_synced_at":"2026-04-28T20:31:32.432Z","repository":{"id":115638519,"uuid":"158064270","full_name":"ethanblake4/ExponentCore","owner":"ethanblake4","description":"The core library of Exponent, a set of Android utilities for accessing private Google APIs.","archived":false,"fork":false,"pushed_at":"2021-03-14T07:15:44.000Z","size":513,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T20:13:09.593Z","etag":null,"topics":["android","android-library","google","login"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ethanblake4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-11-18T08:35:57.000Z","updated_at":"2021-03-14T07:15:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"f0f58db0-41bb-497a-af7c-dc37d6af1bac","html_url":"https://github.com/ethanblake4/ExponentCore","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ethanblake4/ExponentCore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethanblake4%2FExponentCore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethanblake4%2FExponentCore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethanblake4%2FExponentCore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethanblake4%2FExponentCore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethanblake4","download_url":"https://codeload.github.com/ethanblake4/ExponentCore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethanblake4%2FExponentCore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32398433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-library","google","login"],"created_at":"2024-10-02T10:22:07.225Z","updated_at":"2026-04-28T20:31:32.417Z","avatar_url":"https://github.com/ethanblake4.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExponentCore\nThis is the core library of Exponent, a set of Android utilities for accessing private Google APIs. Standalone, it provides comprehensive support for authentication via reimplementation of Play Services methods, including support for multi-factor/2-factor authentication. It offers both high-level and low-level APIs for interacting directly with Play Services at any skill level. \n\nExponent is written in Kotlin and has library dependencies on the Kotlin stdlib, AppCompat v7, and OkHttp.\n\nExponent has *no dependency* on Play Services (or microG etc.) being installed on a target device, so it's also great for open-source apps intended for custom ROMs. However, support for public Google APIs is currently nonexistent (feel free to open an issue).\n\nTo use Exponent in your project, simply add the following line to your app module's build.gradle:\n`implementation 'io.ethanblake4:exponent-core:0.0.1'`\n\n### Initialization\nBefore using any of the below methods, make sure to call `Exponent.init(context)`. A good place to put it is in your Application subclass, but it can go anywhere as long as it is called before any other Exponent method.\n\n## AuthFlow Authentication\nExponent provides a high-level API, AuthFlow, that creates and manages the entire authentication process, including UI and multi-factor authentication, with minimal effort. To use AuthFlow, call the `ExAuthFlow.start` method from within your Activity or Fragment:\n```kotlin\nclass MyActivity : Activity() {\n\n  override fun onCreate(savedInstanceState: Bundle?) {\n  \n    super.onCreate(savedInstanceState)\n    \n    loginButton.setOnClickListener {\n      ExAuthFlow.start(this@MyActivity, ExAuthFlow.Format.WEB_AUTH, { loginState -\u003e\n       if(loginState == ExAuthFlow.State.COMPLETE) {\n        // Auth complete. Do something!\n        Log.d(\"My First Name\", ExponentAccounts.currentAccount!!.firstName)\n       }\n      }, { throwable -\u003e\n        Toast.makeText(this@MyActivity, \"Error logging in\", Toast.LENGTH_LONG).show();\n      })\n    }\n  }\n}\n```\n\n## One Level Down: ExponentAccounts\nIf you want to implement a custom authentication UI, ExponentAccounts is still a fairly high level API that manages login, persistence, and service tokens. It's highly encouraged to use it in concert with `AutoMFA` to enable multi-factor authentication. Here's the example from above, modified to use ExponentAccounts:\n```kotlin\nclass MyActivity : Activity() {\n\n  override fun onCreate(savedInstanceState: Bundle?) {\n  \n    super.onCreate(savedInstanceState)\n    \n    loginButton.setOnClickListener {\n    \n      // You'll have to prompt the user for these on your own\n      val email = emailTextField.text\n      val password = passwordTextField.text\n      \n      ExponentAccounts.login(email, password, { accountInfo -\u003e \n        // Auth complete. Do something!\n        Log.d(\"My First Name\", accountInfo.firstName)\n      }, { throwable -\u003e\n      \n        // Did this error happen because the user has MFA? If so, we can use AutoMFA to recover!\n        if(throwable is NeedsBrowserException) {\n        \n          // Use AutoMFA to recover\n          AutoMFA.handleBrowserRecover(this@MyActivity, email, throwable, { accountInfo -\u003e\n            // Auth complete. Do something!\n            Log.d(\"My First Name\", accountInfo.firstName)\n          }, { err -\u003e\n            Toast.makeText(this@MyActivity, \"Error logging in\", Toast.LENGTH_LONG).show();\n          })\n          \n        } else {\n          Toast.makeText(this@MyActivity, \"Error logging in\", Toast.LENGTH_LONG).show();\n        }\n        \n      })\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethanblake4%2Fexponentcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethanblake4%2Fexponentcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethanblake4%2Fexponentcore/lists"}