This commit introduces a complete architectural refactoring of the Kotlin-based interception logic, based on the source of 1. https://github.com/5ec1cff/TrickyStore 2. https://github.com/beakthoven/TrickyStoreOSS The primary purpose of this code is to intercept binder transactions to the Android Keystore and KeyMint services. The overall workflow operates in conjunction with a native library (injected via ptrace). The native library hooks the binder's `transact` function and forwards pre- and post-transaction events to the Kotlin side. This Kotlin code contains all the high-level logic for parsing parameters, patching certificates, and generating simulated keys. The codebase is now organized into a clear, package-based architecture: - attestation: Manages the creation and patching of ASN.1 attestation data structures. - config: Handles loading and observing configuration files from disk. - interception: Contains the core binder interception framework and its specific implementations for legacy Keystore (Android Q/R) and modern KeyMint/Keystore2 (Android S+). - logging: Provides a centralized and consistent logging utility. - pki: Manages Public Key Infrastructure, including certificate generation, parsing of key store XML files, and cryptographic helpers. - util: Contains Android-specific utility functions for device properties. This refactoring focuses on establishing a robust and extensible architecture. The fine-tuning of the interception logic itself, especially for corner cases in key generation and patching, is currently under redesign and will be further refined in subsequent commits.
33 lines
1.9 KiB
Java
33 lines
1.9 KiB
Java
package android.security;
|
|
|
|
public class Credentials {
|
|
public static final String APP_SOURCE_CERTIFICATE = "FSV_";
|
|
public static final String CA_CERTIFICATE = "CACERT_";
|
|
public static final String CERTIFICATE_USAGE_APP_SOURCE = "appsrc";
|
|
public static final String CERTIFICATE_USAGE_CA = "ca";
|
|
public static final String CERTIFICATE_USAGE_USER = "user";
|
|
public static final String CERTIFICATE_USAGE_WIFI = "wifi";
|
|
public static final String EXTENSION_CER = ".cer";
|
|
public static final String EXTENSION_CRT = ".crt";
|
|
public static final String EXTENSION_P12 = ".p12";
|
|
public static final String EXTENSION_PFX = ".pfx";
|
|
public static final String EXTRA_CA_CERTIFICATES_DATA = "ca_certificates_data";
|
|
public static final String EXTRA_CERTIFICATE_USAGE = "certificate_install_usage";
|
|
public static final String EXTRA_INSTALL_AS_UID = "install_as_uid";
|
|
public static final String EXTRA_PRIVATE_KEY = "PKEY";
|
|
public static final String EXTRA_PUBLIC_KEY = "KEY";
|
|
public static final String EXTRA_USER_CERTIFICATE_DATA = "user_certificate_data";
|
|
public static final String EXTRA_USER_KEY_ALIAS = "user_key_pair_name";
|
|
public static final String EXTRA_USER_PRIVATE_KEY_DATA = "user_private_key_data";
|
|
public static final String INSTALL_ACTION = "android.credentials.INSTALL";
|
|
public static final String INSTALL_AS_USER_ACTION = "android.credentials.INSTALL_AS_USER";
|
|
public static final String LOCKDOWN_VPN = "LOCKDOWN_VPN";
|
|
private static final String LOGTAG = "Credentials";
|
|
public static final String PLATFORM_VPN = "PLATFORM_VPN_";
|
|
public static final String USER_CERTIFICATE = "USRCERT_";
|
|
public static final String USER_PRIVATE_KEY = "USRPKEY_";
|
|
public static final String USER_SECRET_KEY = "USRSKEY_";
|
|
public static final String VPN = "VPN_";
|
|
public static final String WIFI = "WIFI_";
|
|
}
|