Skip to content

A trick of keystore, spoofing locked bootloader

Notifications You must be signed in to change notification settings

d3545t3r/TrickyStoreFork

 
 

Repository files navigation

Tricky Store

A trick of keystore. Android 12 or above is required.

PIFork is required for device spoofing using Build fields and system properties, for SafetyNet/Play Integrity purposes. This provides a larger working pool of fingerprints for DEVICE integrity with the included default AOSP software keybox.

Shamiko (or similar) may also be required/desired for the global props changes (if not using PIFork) and root hiding it provides.

Usage

  1. Flash this module and reboot.
  2. For more than possible DEVICE integrity, put an unrevoked hardware keybox.xml at /data/adb/tricky_store/keybox.xml (Optional).
  3. Customize target packages at /data/adb/tricky_store/target.txt (Optional).
  4. Enjoy!

All configuration files will automatically take effect after a short time, or immediately by killing gms.

keybox.xml

format:

<?xml version="1.0"?>
<AndroidAttestation>
    <NumberOfKeyboxes>1</NumberOfKeyboxes>
    <Keybox DeviceID="...">
        <Key algorithm="ecdsa|rsa">
            <PrivateKey format="pem">
-----BEGIN EC PRIVATE KEY-----
...
-----END EC PRIVATE KEY-----
            </PrivateKey>
            <CertificateChain>
                <NumberOfCertificates>...</NumberOfCertificates>
                    <Certificate format="pem">
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
                    </Certificate>
                ... more certificates
            </CertificateChain>
        </Key>...
    </Keybox>
</AndroidAttestation>

Support TEE broken devices

Tricky Store will hack the leaf certificate by default. On TEE broken devices, this will not work because we can't retrieve the leaf certificate from TEE. You can add a ! after a package name to enable generate certificate support for this package.

For example:

# target.txt
# use leaf certificate hacking mode for KeyAttestation App
io.github.vvb2060.keyattestation
# use certificate generating mode for gms
com.google.android.gms!

Known Issues

  • App Attest Key doesn't work (so users should disable testing for it in Key Attestation Demo for now).
  • Android 11 and below is not currently supported.

Pull Requests welcome.

Acknowledgement

About

A trick of keystore, spoofing locked bootloader

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 61.4%
  • Java 20.6%
  • Kotlin 10.3%
  • Shell 4.0%
  • C 3.3%
  • CMake 0.4%