Hacktricks-skills play-integrity-bypass
Android pentesting skill for bypassing Play Integrity API attestation (SafetyNet replacement). Use this skill whenever you need to test Android app security, bypass device attestation checks, achieve MEETS_BASIC_INTEGRITY/MEETS_DEVICE_INTEGRITY/MEETS_STRONG_INTEGRITY, or work with root hiding and key attestation spoofing. Trigger this for any Android security testing involving Play Integrity, SafetyNet, device certification, or app attestation validation.
git clone https://github.com/abelrguezr/hacktricks-skills
skills/mobile-pentesting/android-app-pentesting/play-integrity-attestation-bypass/SKILL.MDPlay Integrity Attestation Bypass
A guide for Android security researchers to bypass Play Integrity API checks during application pentesting.
What Play Integrity Does
Play Integrity is Google's SafetyNet successor for app attestation. The flow:
- App calls the Play Integrity API
- Google Play Services gathers software/hardware signals
- Sends encrypted data to
googleapis.com - Google returns a JWT (signed and encrypted)
- App forwards token to backend
- Backend validates signature with Google's public key, decrypts payload, enforces policy
Key Verdict Fields
| Field | Purpose |
|---|---|
| APK build/signature match (no repack/tamper) |
| Genuine & certified device, locked bootloader, no root/system tamper |
| Installation via Google Play |
Commonly Enforced Flags
: Token generated by genuine Play Services (not emulator/tampered transport)MEETS_BASIC_INTEGRITY
: Genuine/certified device, bootloader locked, no root/system tamperMEETS_DEVICE_INTEGRITY
: RequiresMEETS_STRONG_INTEGRITY
plus recent security patches on all partitions (OS + vendor)DEVICE
Bypass Model
Instead of forging Google's JWT (impossible), spoof the signals Google evaluates so they correspond to a different, legitimate device profile.
Attack Chain
- Hide root so local checks and Play Services probes don't see Magisk/su
- Replace the key attestation certificate chain (
) with one from a genuine device so Play Integrity sees a certified/locked devicekeybox.xml - Spoof the security patch level to satisfy
MEETS_STRONG_INTEGRITY
Important: Google mitigates by revoking abused keyboxes; rotation is required when a keybox is blocked.
Prerequisites & Tooling
Required Tools
| Tool | Purpose | Link |
|---|---|---|
| ReZygisk | Root hiding (or ZygiskNext) | https://github.com/PerformanC/ReZygisk |
| TrickyStore | Key attestation spoofing (Magisk module) | https://github.com/5ec1cff/TrickyStore |
| Tricky Addon | Target list for TrickyStore | https://github.com/KOWX712/Tricky-Addon-Update-Target-List |
| KSU Web UI | UI helper to drive TrickyStore | https://github.com/adivenxnataly/KsuWebUI |
Validation Tools
| Tool | Purpose |
|---|---|
| Play Integrity API Checker | Verify integrity flags |
| Key Attestation | Check bootloader/attestation chain |
Background Reading
Procedure: Achieve MEETS_BASIC_INTEGRITY + MEETS_DEVICE_INTEGRITY
Step 1: Install Root Hiding
- Install ReZygisk (or ZygiskNext) Magisk module
- In Magisk: Disable Zygisk, Enable Magisk Hide
- Reboot device
Step 2: Install TrickyStore Modules
- Flash TrickyStore Magisk module
- Flash Tricky Addon Magisk module
- Reboot device
Step 3: Configure TrickyStore
- Open KSU Web UI
- Navigate to
→TrickyStoreSelect All
(keep core system apps)Deselect Unnecessary- Save configuration
Step 4: Inject Valid Keybox
- In KSU Web UI, go to
sectionKeybox - Choose Valid to download/apply a new
keybox.xml - This file contains vendor attestation credentials from a certified/locked device
- The attestation chain is now spoofed
Step 5: Verify
- Run Play Integrity API Checker
- Confirm
= PASSMEETS_BASIC_INTEGRITY - Confirm
= PASSMEETS_DEVICE_INTEGRITY - In Key Attestation APK, verify bootloader shows as locked
Procedure: Achieve MEETS_STRONG_INTEGRITY
STRONG integrity fails on outdated patch levels. TrickyStore can spoof a modern security patch date for all partitions.
Step 1: Set Security Patch
- In TrickyStore (via KSU Web UI), pick Set Security Patch
- Select Get Security Patch Date (fetches current date)
- Save configuration
Step 2: Verify
- Re-run Play Integrity API Checker
- Confirm
= PASSMEETS_STRONG_INTEGRITY
Operational Notes
Revocation Risk
- Hitting the API repeatedly with the same
can flag and block itkeybox.xml - If blocked, replace with a fresh valid keybox
- Monitor for
failures as a sign of revocationMEETS_DEVICE_INTEGRITY
Keybox Management
- Publicly shared keyboxes burn fast (get revoked quickly)
- Keep private copies of working keyboxes
- Track community module updates (XDA/Telegram/GitHub) for new working chains
- Rotate keyboxes periodically during extended testing
Scope Limitations
- This bypass only spoofs attestation inputs
- Backend signature verification by Google still succeeds because the JWT itself is genuine
- Does not bypass
checks (APK signature verification)appIntegrity - Does not bypass backend business logic checks
Troubleshooting
| Issue | Likely Cause | Solution |
|---|---|---|
fails | Root not hidden | Verify ReZygisk installed, Zygisk disabled, Magisk Hide enabled |
fails | Keybox revoked or invalid | Download fresh keybox, check TrickyStore configuration |
fails | Patch level not spoofed | Run "Set Security Patch" in TrickyStore |
| Bootloader shows unlocked | Keybox not applied | Re-inject keybox, reboot, verify in Key Attestation APK |
Security Research Context
This technique is used for:
- Testing Android app security controls
- Understanding attestation bypass vectors
- Red teaming mobile applications
- Security research and education
Always obtain proper authorization before testing any application or device.