A docker image, which on run, extracts API keys (which constantly change) and other details required to allow users to directly call the Twickets API used by the Android app.
It does this by running a rooted Android emulator in docker (using androotu), launching Twickets and capturing & inspecting requests the app makes. See how it works section for more info.
Leveraging androotu allows us to work around the protections put in place by Twickets to prevent this - but is now possible using magic ✨
Twickets recently introduced Prosopo bot protection to their site which makes it near impossible to now scrape or use APIs the website itself uses without being a human.
The Android app also has these anti-bot protections but via a different method - utilising Play Integrity rather than bot challenges.
By using a rooted emulator which passes Play Integrity, we can therefore extract the keys the app uses, allowing us to use the API the app uses.
v3.20 (Sept 2026): the app now also signs every main-API request with hardware-backed key attestation, and the server enforces it. The image handles this via TrickyStore (bundled in the base image, signed with a keybox rooted in Google's genuine attestation root) - the extractor now adds the app to its target list, so the app itself passes attestation and extraction works as before. But the per-request signatures mean the extracted keys cannot be replayed from outside the app any more - the JWE alone gets 403 even minutes after minting. Until that changes, keys.json is useful for the 3 static keys and for inspecting what the live app sends.
By default, this image when run, will simply boot, extract the API keys the app uses to a json file and exit.
A run can take a while ~10 mins on GitHub actions (see FAQ for why).
Sadly these keys are short lived - server-side the integrity JWE is rejected within minutes of minting (verified live), so plan to re-extract per session rather than on a schedule. And as of v3.20, replay is blocked entirely by the enforced hardware attestation (see the note above).
Before you can run this project, you will first need to set up gplaydl so that the Twickets app can be downloaded on start.
This is a one-time setup and is easy to do - but you will need an Android device.
Follow instructions at gplaydl here: https://github.com/rehmatworks/gplaydl
After running gplaydl and completing the process copy the contents of ~/.config/gplaydl/config.json into the GPLAYDL_CONFIG environment variable in your .env (see .env.example), docker run or GitHub workflow.
Get the contents with:
cat ~/.config/gplaydl/config.jsonIt will look like:
{
"dispenser": "https://dispenser.gplaydl.com",
"api_key": "your-key-here"
}The repo ships an extract-keys.yaml workflow that runs daily at 06:00 UTC.
This workflow pulls the prebuilt image, boots the emulator, and extracts the keys and pushes them to a gist for use (if set up).
To run this yourself:
- Fork the repo
- Delete the
docker-build-push.yamlworkflow - Add the
GPLAYDL_CONFIGrepository secret (see below). - (Optional) Add
GIST_IDrepository variable and aGIST_TOKENsecret. The workflow will work without these, it just will not update a gist. - Trigger the workflow manually or wait for the next daily run.
To run this project locally you will need
- Docker
- KVM installed (and a Linux machine with
/dev/kvmexposed) - Task
First copy the .env.example to .env
cp .env.example .envThen set GPLAYDL_CONFIG in the .env to the full config JSON
Then run the container (runs can take a bit of time)
task runOr
docker compose up Keys land in ./output/keys.json.
Remember: the JWE is rejected server-side within minutes of minting, so treat each extraction as valid for one session - re-extract when you need fresh keys, not on a schedule. (Under v3.20 the JWE is additionally blocked by enforced attestation - see the note in Why.)
Other useful tasks:
task logs # see container logs
task adb # connect to emulator using adb
task screenshot # capture a screenshot of the emulatorEach run writes output/keys.json with exactly the fields below. These should be set on any request to the API (as a query param or header).
| key | set in | kind |
|---|---|---|
api_key |
query param | static |
User-Agent |
header | static |
x-prosopo-site-key |
header | static |
x-prosopo-android-integrity-token |
header | dynamic JWE, minted per launch |
You can use these against the catalogue endpoint for example, no cookie needed:
curl 'https://www.twickets.live/services/catalogue?count=10&q=countryCode%3DGB&api_key=<key>' \
-H 'User-Agent: <user agent>' \
-H 'x-prosopo-site-key: <key>' \
-H 'x-prosopo-android-integrity-token: <token>'Note: since v3.20 the app also signs every main-API request with hardware-backed key attestation headers (bound per-request, so not reproducible outside Android), and the server enforces these - so this replay is currently blocked, even with a freshly minted JWE (verified live: a byte-identical replay 0.7s after capture is still rejected). The last working replay recipe is documented in the decompile repo; if enforcement is ever relaxed, the keys above will work again as before.
- Boots
ghcr.io/ahobsonsayers/androotu, a rooted Android 16 emulator with modules installed (Integrity Box, KSU-Next, SUSFS, ReZygisk, TEESimulator, BetterKnownInstalled) that make the emulator pass Play Integrity, and make apps appear as if installed from the Play Store. 01-install-twickets.shadds Twickets to TrickyStore's target list (so the app's v3.20 hardware key attestation is signed with the bundled Google-rooted keybox), downloads Twickets (co.twickets.droid) from Google Play via gplaydl, installs it, then reboots so the BetterKnownInstalled module re-marks it as a Play Store install - bypassing the app's Play Automatic Integrity Protection.02-start-frida.shensures frida-server is running and forwards its port.04-open-twickets.shlaunches the app, waits for the bottom-nav to appear, attaches Frida, opens the Find tab, and retries the page until the Prosopo integrity JWE is minted. Retries the whole cycle up to 3 times.05-extract-attest.shextracts the v3.20 attestation signing key (zero Twickets traffic) intoattest.json— required for the run.06-extract-keys.shparses the Frida output, foldsattest.jsonin, and writes all keys to/data/output/keys.json. Fails if any of the 4 catalogue keys is missing.
The Frida hook (scripts/capture-keys.js) intercepts requests and emits the keys once a request carries the
JWE - which is what we use as the signal that all 4 keys are available. It hooks the app's own interceptors to find the live request pipeline at runtime, so it survives the obfuscated-class renaming Twickets ships with each release.
Why does the run sometimes take a while to start? On a fresh boot the app needs to "warm up" before the JWE mints and before the Find tab works. The JWE is NOT present on the very first request after launch.
The scripts try the launch→attach→capture cycle up to 3 times to handle this.
Can I run this on macOS / Windows?
The container needs /dev/kvm (Linux KVM), so a Linux machine is required for
local runs. Use the provided GitHub Actions if you do not have a Linux machine accessible.
In the age of LLMs and coding agents, code is now cheap - for better or for worse. Your time however, is not ⌛
Therefore this project, like most of my projects, uses a hand written "artisan" README to ensure it is clear, correct and concise. This makes it easy to read and in my opinion encourages reading and engagement - no one likes AI slop!
As someone wiser than me once told a colleague:
"if you can't be bothered to take the time to write these words, then why should I be bothered to read them"
Enjoy!
