Skip to content

Add support for Google auth token as alternative to aas-token#232

Open
benedikt90 wants to merge 1 commit intoEFForg:masterfrom
benedikt90:master
Open

Add support for Google auth token as alternative to aas-token#232
benedikt90 wants to merge 1 commit intoEFForg:masterfrom
benedikt90:master

Conversation

@benedikt90
Copy link

Full disclosure: This change was done with an LLM and requires: EFForg/rs-google-play#26

Summary

This PR adds support for AUTH tokens (e.g., from Aurora Store's token dispenser), allowing users to authenticate without going through the OAuth → AAS token flow.

Motivation

Aurora Store's token dispenser provides AUTH tokens (starting with ya29.) for anonymous access to Google Play. Previously, apkeep only supported AAS tokens, making it incompatible with these dispensers. This PR bridges that gap.

Changes

New CLI Option

  • --auth-token <TOKEN>: Accepts an AUTH token directly (mutually exclusive with -t/--aas-token)

Modified Files

  1. src/cli.rs

    • Added google_auth_token argument with --auth-token flag
    • Set up mutual exclusivity with --aas-token
  2. src/main.rs

    • Handle both aas_token and auth_token from CLI and config file
    • Auto-detect token type when prompting (tokens starting with ya29. are treated as AUTH)
    • Fixed bug: accept_tos was reading from wrong CLI argument (list_versions instead of google_accept_tos)
  3. src/download_sources/google_play.rs

    • Updated download_apps() signature to accept both token types as Option<&str>
    • Call appropriate gpapi method based on token type provided
    • Simplified TOS acceptance flow (removed redundant login() call after accept_tos())
  4. USAGE-google-play.md

    • Added documentation for AUTH token usage
    • Added config file example with auth_token option

Config File Support

Users can now specify auth_token in their config file:

[google]
email = someone@gmail.com
auth_token = ya29.a0...

Usage Example

# Get AUTH token from Aurora dispenser
python3 get_dispenser_token.py --properties gplayapi_px_9a.properties

# Use with apkeep
apkeep -a com.instagram.android -d google-play \
  -e 'dispenser_email@gmail.com' \
  --auth-token 'ya29.a0...' \
  --accept-tos .

Bug Fixes

  1. Fixed --accept-tos flag not working: The flag was reading from the wrong CLI argument (list_versions instead of google_accept_tos)

Dependencies

This PR requires the corresponding changes to the gpapi crate that add set_auth_token() support.

Before submitting this PR:

  1. First submit and merge the gpapi PR to EFForg/rs-google-play
  2. Publish the updated gpapi crate (or wait for maintainer to publish)
  3. Update Cargo.toml to use the new gpapi version:
    gpapi = "7"  # or whatever version includes set_auth_token()
  4. Then submit this PR

Backward Compatibility

Fully backward compatible

  • Existing -t/--aas-token flow remains unchanged
  • Config file aas_token option still works
  • All existing functionality preserved

Testing

  • Tested with AUTH tokens from Aurora Store's token dispenser
  • Verified TOS acceptance works correctly
  • Confirmed APK downloads succeed
  • Verified backward compatibility with AAS tokens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant