| 11 | |
| 12 | class Accounts(GAPI): |
| 13 | def __init__(self, creds: GHuntCreds, headers: Dict[str, str] = {}): |
| 14 | super().__init__() |
| 15 | |
| 16 | if not headers: |
| 17 | headers = gb.config.headers |
| 18 | |
| 19 | base_headers = {} |
| 20 | |
| 21 | headers = {**headers, **base_headers} |
| 22 | |
| 23 | # Android OAuth fields |
| 24 | self.api_name = "chrome" |
| 25 | self.package_name = "com.android.chrome" |
| 26 | self.scopes = [ |
| 27 | "https://www.google.com/accounts/OAuthLogin" |
| 28 | ] |
| 29 | |
| 30 | self.hostname = "accounts.google.com" |
| 31 | self.scheme = "https" |
| 32 | |
| 33 | self.authentication_mode = "oauth" # sapisidhash, cookies_only, oauth or None |
| 34 | self.require_key = None # key name, or None |
| 35 | |
| 36 | self._load_api(creds, headers) |
| 37 | |
| 38 | async def OAuthLogin(self, as_client: httpx.AsyncClient) -> str: |
| 39 | endpoint_name = inspect.currentframe().f_code.co_name |