# duwqijlk/google-trial-tool architecture

> Architecture diagram of the GitHub repository duwqijlk/google-trial-tool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/duwqijlk/google-trial-tool
- Repository: https://github.com/duwqijlk/google-trial-tool

## Overview

Google AI Trial Tool is a command-line launcher plus a Frida script that uses Google Play BillingClient inside the Google One app to find subscription offers and launch a selected trial. The workflow runs from device setup and script injection, through offer discovery and trial selection, to a billing prompt and purchase-status logging. The README documents launcher responsibilities and product options; the JavaScript excerpt shows BillingClient setup, selection, UI-thread dispatch, and result handling. Some discovery and launcher internals are not excerpted, so those links rely on README statements.

Main entry points: [`auto-trial.sh`](https://github.com/duwqijlk/google-trial-tool/blob/main/auto-trial.sh) (ADB and Frida launcher), [`frida-auto-trial.js`](https://github.com/duwqijlk/google-trial-tool/blob/main/frida-auto-trial.js) (Offer discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launcher["Device launcher"]
  node_launcher["ADB and Frida launcher<br/>[auto-trial.sh]"]
end

subgraph group_billing["Trial workflow"]
  node_injected["Frida trial script"]
  node_billingclient["BillingClient setup"]
  node_offerquery["Offer discovery"]
  node_trialselection["Trial selection"]
end

subgraph group_checkout["Billing checkout"]
  node_checkoutflow["Billing flow launch"]
  node_result["Purchase status"]
end

node_user(("Operator"))
node_device["Android emulator"]
node_playbilling["Google Play Billing"]

node_user -->|"runs options"| node_launcher
node_launcher -->|"prepares device"| node_device
node_launcher -->|"injects script"| node_injected
node_device -->|"hosts script"| node_injected
node_injected -->|"builds client"| node_billingclient
node_billingclient -->|"queries offers"| node_offerquery
node_offerquery -->|"requests product details"| node_playbilling
node_offerquery -->|"provides trial offers"| node_trialselection
node_trialselection -->|"dispatches selection"| node_checkoutflow
node_checkoutflow -->|"launches billing flow"| node_playbilling
node_playbilling -->|"returns purchase status"| node_result
node_result -->|"monitors logs"| node_launcher

click node_launcher "https://github.com/duwqijlk/google-trial-tool/blob/main/auto-trial.sh"
click node_injected "https://github.com/duwqijlk/google-trial-tool/blob/main/frida-auto-trial.js"
click node_billingclient "https://github.com/duwqijlk/google-trial-tool/blob/main/frida-auto-trial.js"
click node_offerquery "https://github.com/duwqijlk/google-trial-tool/blob/main/frida-auto-trial.js"
click node_trialselection "https://github.com/duwqijlk/google-trial-tool/blob/main/frida-auto-trial.js"
click node_checkoutflow "https://github.com/duwqijlk/google-trial-tool/blob/main/frida-auto-trial.js"
click node_result "https://github.com/duwqijlk/google-trial-tool/blob/main/frida-auto-trial.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_launcher toneBlue
class node_injected,node_billingclient,node_offerquery,node_trialselection toneAmber
class node_checkoutflow,node_result toneMint
class node_user,node_device,node_playbilling toneIndigo
```

## Components

### Device launcher

- [ADB and Frida launcher](https://github.com/duwqijlk/google-trial-tool/blob/main/auto-trial.sh): `auto-trial.sh`

### Trial workflow

- [Frida trial script](https://github.com/duwqijlk/google-trial-tool/blob/main/frida-auto-trial.js): `frida-auto-trial.js`
- [BillingClient setup](https://github.com/duwqijlk/google-trial-tool/blob/main/frida-auto-trial.js): `frida-auto-trial.js`
- [Offer discovery](https://github.com/duwqijlk/google-trial-tool/blob/main/frida-auto-trial.js): `frida-auto-trial.js`
- [Trial selection](https://github.com/duwqijlk/google-trial-tool/blob/main/frida-auto-trial.js): `frida-auto-trial.js`

### Billing checkout

- [Billing flow launch](https://github.com/duwqijlk/google-trial-tool/blob/main/frida-auto-trial.js): `frida-auto-trial.js`
- [Purchase status](https://github.com/duwqijlk/google-trial-tool/blob/main/frida-auto-trial.js): `frida-auto-trial.js`

### Other components

- **Operator**
- **Android emulator**
- **Google Play Billing**

## Connections

- Operator → ADB and Frida launcher: runs options (evidence: `README.md`)
- ADB and Frida launcher → Android emulator: prepares device (evidence: `README.md`)
- ADB and Frida launcher → Frida trial script: injects script (evidence: `README.md`)
- Android emulator → Frida trial script: hosts script (evidence: `README.md`)
- Frida trial script → BillingClient setup: builds client (evidence: `frida-auto-trial.js`)
- BillingClient setup → Offer discovery: queries offers (evidence: `README.md`)
- Offer discovery → Google Play Billing: requests product details (evidence: `README.md`)
- Offer discovery → Trial selection: provides trial offers (evidence: `frida-auto-trial.js`)
- Trial selection → Billing flow launch: dispatches selection (evidence: `frida-auto-trial.js`)
- Billing flow launch → Google Play Billing: launches billing flow (evidence: `README.md`)
- Google Play Billing → Purchase status: returns purchase status (evidence: `frida-auto-trial.js`)
- Purchase status → ADB and Frida launcher: monitors logs (evidence: `README.md`)
