### Initialize EntryPoint in Zygisk Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/09-java-entrypoint.md Example of how to load properties and initialize the EntryPoint during Zygisk startup. ```java String config = loadPifPropertiesAsJson(); EntryPoint.init(config, true, true, true); ``` -------------------------------- ### Initialize DeviceInfo instance Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/02-types.md Example usage of the DeviceInfo interface for a specific device model. ```typescript const device: DeviceInfo = { model: 'Pixel 6 Pro', product: 'raven' } ``` -------------------------------- ### Initialization Flow Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/14-architecture.md Visual representation of the application startup sequence and terminal subscription setup. ```text App mounts ├─ useEffect: Init │ ├─ i18n.loadTranslations() │ ├─ PifConfig.waitForInit() │ ├─ Update initialized │ ├─ Terminal subscription setup │ ├─ Device list fetched │ └─ System checks (SELinux, ROM sig, dates) │ └─ useEffect: Terminal subscription ├─ terminal.subscribe(setOutputLines) ├─ terminal.onShellStateChange(setShellRunning) └─ i18n.subscribe(() => bumpTranslationRev()) ``` -------------------------------- ### Initialize SpoofConfigItem instance Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/02-types.md Example usage of the SpoofConfigItem interface for a build spoofing toggle. ```typescript const item: SpoofConfigItem = { config: 'spoofBuild', label: 'Spoof Build', playStore: false } ``` -------------------------------- ### Device List Format and Usage Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/06-update-api.md Examples of the expected return format and how to consume the device list. ```typescript [ { model: 'Pixel 6 Pro', product: 'raven' }, { model: 'Pixel 6', product: 'oriole' }, { model: 'Pixel 5a', product: 'barbet' } ] ``` ```typescript const devices = await updater.fetchDeviceList() console.log(`Found ${devices.length} devices`) devices.forEach(d => { console.log(`${d.model} (${d.product})`) }) ``` ```typescript try { const devs = await up.fetchDeviceList() setDevices(devs) if (devs.length === 0) { setDeviceListError(true) } } catch { setDeviceListError(true) } ``` -------------------------------- ### Checking TrickyStore Installation Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/07-file-api.md Verify if TrickyStore is installed and active by checking for the module directory and the absence of a disable file. ```typescript const installed = await File.isDirectory('/data/adb/modules/tricky_store') const disabled = await File.exist('/data/adb/modules/tricky_store/disable') const active = installed && !disabled ``` -------------------------------- ### Example pif.prop Configuration Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/12-configuration.md A sample configuration file demonstrating the key=value format, including comments and various property types. ```properties # Comments start with # spoofBuild=true spoofProps=false spoofProvider=true spoofSignature=false spoofVendingSdk=true # Device properties MODEL=Pixel 6 Pro PRODUCT=raven MANUFACTURER=Google # Build properties DEVICE=raven FINGERPRINT=google/raven/raven:13/TP1A.220624.014/8448907:user/release-keys BUILD_VERSION_RELEASE=13 BUILD_ID=TP1A.220624.014 SECURITY_PATCH=2024-06-05 ``` -------------------------------- ### Example JSON configuration Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/09-java-entrypoint.md The expected JSON format for providing Build property key-value pairs to the init method. ```json { "DEVICE": "raven", "MODEL": "Pixel 6 Pro", "PRODUCT": "raven", "MANUFACTURER": "Google", "FINGERPRINT": "google/raven/raven:...", "BUILD_VERSION_RELEASE": "13", "BUILD_VERSION_SECURITY_PATCH": "2024-06-05" } ``` -------------------------------- ### GitHub Fetch Usage Examples Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/06-update-api.md Demonstrates how to invoke the github method in application logic. ```typescript try { const content = await updater.github('raven') console.log('Fetched for Pixel 6 Pro:', content) } catch (error) { console.error('All GitHub mirrors failed:', error) } ``` ```typescript if (selectedDevice) { await updater.github(selectedDevice.product) } ``` -------------------------------- ### Register CustomProvider Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/11-java-provider-creator.md Example of replacing the default AndroidKeyStore provider with the CustomProvider. ```java Provider original = Security.getProvider("AndroidKeyStore"); CustomProvider custom = new CustomProvider(original); Security.removeProvider("AndroidKeyStore"); Security.insertProviderAt(custom, 1); ``` -------------------------------- ### Update Class Usage Examples Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/06-update-api.md Demonstrates initializing the Update class with a PifConfig instance. ```typescript const pifConfig = new PifConfig(terminal) await pifConfig.waitForInit() const updater = new Update(terminal, pifConfig) ``` ```typescript const pc = new PifConfig(terminal) setPifConfig(pc) await pc.waitForInit() const up = new Update(terminal, pc) setUpdater(up) ``` -------------------------------- ### fallbackFetch usage examples Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/08-utilities.md Demonstrates how to implement fallback fetching for GitHub mirrors and dynamic resource retrieval. ```typescript const urls = [ 'https://fastly.jsdelivr.net/gh/KOWX712/PlayIntegrityFix@inject_s/bot/device_list.json', 'https://raw.githubusercontent.com/KOWX712/PlayIntegrityFix/inject_s/bot/device_list.json', 'https://gh.sevencdn.com/raw.githubusercontent.com/KOWX712/PlayIntegrityFix/inject_s/bot/device_list.json' ] try { const response = await fallbackFetch(urls) const data = await response.json() } catch (error) { console.error('All mirrors failed') } ``` ```typescript const result = await (await fallbackFetch([ `${GITHUB_CDN}@${BRANCH}/bot/device_prop/${product}.prop`, `${GITHUB_RAW}/${BRANCH}/bot/device_prop/${product}.prop`, `${GITHUB_MIRROR}/${BRANCH}/bot/device_prop/${product}.prop`, ])).text() ``` -------------------------------- ### Stringify property map to file Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/08-utilities.md Example demonstrating how to convert a configuration object into a string and write it to a file. ```typescript { spoofBuild: true, MODEL: "Pixel 6 Pro", SDK_INT: 32 } ``` ```typescript const config: PifPropMap = { spoofBuild: true, spoofProps: false, MODEL: "Pixel 6" } const content = PROP.stringify(config) await File.write('/data/adb/pif.prop', content) ``` -------------------------------- ### Implement ShellStateListener Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/02-types.md Example implementation of a ShellStateListener callback. ```typescript const listener: ShellStateListener = (running) => { setButtonDisabled(running) } ``` -------------------------------- ### Cli.loadVersion() Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/05-cli-api.md Retrieves the installed module version from module.prop. ```APIDOC ## loadVersion() ### Description Reads the module version string from `module.prop`. ### Returns - **Promise** - The version string (e.g., "8.5.0") or an empty string if not found. ### Usage Example ```typescript const version = await Cli.loadVersion(); ``` ``` -------------------------------- ### Auto-detection Usage Examples Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/06-update-api.md Examples of calling the autopif method with and without parameters. ```typescript await updater.autopif() ``` ```typescript await updater.autopif('Pixel 6 Pro', 'raven') ``` ```typescript const opts: Record = {} if (model && product) { opts.env = { MODEL: `"${model}"`, PRODUCT: `"${product}"" } } const scriptOutput = Cli.runAutopifScript(opts) scriptOutput.stdout.on('data', (data: string) => this.#terminal.output(data) ) ``` -------------------------------- ### loadVersion() Method Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/05-cli-api.md Retrieves the installed module version from module.prop. ```typescript static async loadVersion(): Promise ``` ```typescript const version = await Cli.loadVersion() console.log(`Module version: ${version}`) ``` -------------------------------- ### Implement TerminalListener Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/02-types.md Example implementation of a TerminalListener callback. ```typescript const listener: TerminalListener = (lines) => { console.log(`Now have ${lines.length} lines`) } ``` -------------------------------- ### Field Mapping Configuration Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/09-java-entrypoint.md Examples showing the transformation from pif.prop properties to JSON and the resulting system property updates. ```text MODEL=Pixel 6 Pro FINGERPRINT=google/raven/raven:13/TP1A.220624.014/8448907:user/release-keys BUILD_VERSION_RELEASE=13 ``` ```json { "MODEL": "Pixel 6 Pro", "FINGERPRINT": "google/raven/raven:13/TP1A.220624.014/8448907:user/release-keys", "BUILD_VERSION_RELEASE": "13" } ``` ```text Build.MODEL = "Pixel 6 Pro" Build.FINGERPRINT = "google/raven/raven:13/TP1A.220624.014/8448907:user/release-keys" Build.VERSION.RELEASE = "13" ``` -------------------------------- ### Define project constants and paths Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/12-configuration.md Defines repository information, module installation paths, and configuration flag locations for the PlayIntegrityFix module. ```typescript export const REPOSITORY = 'KOWX712/PlayIntegrityFix' export const BRANCH = 'inject_s' export const MODDIR = '/data/adb/modules/playintegrityfix' export const PIF_PROP_DEFAULT_PATH = '/data/adb/modules/playintegrityfix/pif.prop' export const PIF_PROP_CUSTOM_PATH = '/data/adb/pif.prop' export const SCRIPT_ONLY_FLAG = '/data/adb/pif_script_only' export const AUTO_SECURITY_PATCH_FLAG = '/data/adb/tricky_store/pif_auto_security_patch' export const GITHUB_CDN = 'https://fastly.jsdelivr.net/gh/KOWX712/PlayIntegrityFix' export const GITHUB_RAW = 'https://raw.githubusercontent.com/KOWX712/PlayIntegrityFix' export const GITHUB_MIRROR = 'https://gh.sevencdn.com/raw.githubusercontent.com/KOWX712/PlayIntegrityFix' ``` -------------------------------- ### get lines() Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/03-terminal-api.md Returns the current array of output lines. ```APIDOC ## get lines() ### Description Returns the current array of output lines. ### Returns - **lines** (OutputLine[]) - Array of all output lines (in order) ### Usage Example ```typescript const allLines = terminal.lines console.log(`Total output lines: ${allLines.length}`) ``` ``` -------------------------------- ### Logcat Output Format Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/09-java-entrypoint.md Example of log entries generated by the PIF tag during operation. ```text [PIF] Set 'FINGERPRINT' to 'google/raven/raven:13/...' [PIF] Parsed 15 fields from JSON [PIF] Don't spoof Provider [PIF] Don't spoof signature ``` -------------------------------- ### Get Keystore Size Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/10-java-keystorespi.md Returns the total number of entries currently present in the keystore. ```java @Override public int engineSize() ``` -------------------------------- ### GitHub Fetch Terminal Output Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/06-update-api.md Example of the raw output displayed in the terminal during a GitHub fetch operation. ```text [+] Fetching from GitHub spoofBuild=true MODEL=Pixel 6 Pro PRODUCT=raven ... - new pif.prop saved to /data/adb/pif.prop ``` -------------------------------- ### Get Single Config Value Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/04-pifconfig-api.md Retrieving specific configuration keys by name. ```typescript getConfig(name: string): string | number | boolean | undefined ``` ```typescript const spoofBuild = pifConfig.getConfig('spoofBuild') // true or false const model = pifConfig.getConfig('MODEL') // string or undefined ``` ```typescript const spoofSig = pc.getConfig('spoofSignature') if (spoofSig) { terminal.output('spoofSignature is enabled') } ``` -------------------------------- ### Parse pif.prop content Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/08-utilities.md Example demonstrating how to parse a raw string into a typed object map. ```typescript const map = PROP.parse(content) // Result: // { // spoofBuild: true, // MODEL: "Pixel 6 Pro", // SDK_INT: 32, // SECURITY_PATCH: "2024-06-05", // VERSION: 1.0 // } ``` ```typescript const content = await File.read('/data/adb/pif.prop') const config = PROP.parse(content) console.log(`spoofBuild: ${config.spoofBuild}`) // true console.log(`MODEL: ${config.MODEL}`) // "Pixel 6 Pro" ``` -------------------------------- ### CMakeLists.txt Configuration Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/zygisk/src/main/cpp/CMakeLists.txt Defines the build configuration for the 'zygisk' project using CMake. It specifies the minimum required CMake version, project name, library linking, and module inclusion. Ensure CMake version 3.30.5 or higher is installed. ```cmake cmake_minimum_required(VERSION 3.30.5) project("zygisk") link_libraries(log) find_package(cxx REQUIRED CONFIG) link_libraries(cxx::cxx) add_library(zygisk SHARED zygisk.cpp pif_config.cpp local_cxa_atexit_finalize_impl/atexit.cpp) add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/Dobby" Dobby) target_link_libraries(zygisk PRIVATE dobby_static) ``` -------------------------------- ### Configuration Read Path Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/14-architecture.md Initialization sequence for loading configuration settings from the filesystem into the application state. ```text App mounts ▼ PifConfig created ▼ Async init: File.read() from pif.prop paths ▼ PROP.parse() converts key=value → map ▼ Defaults merged (all spoofConfig fields) ▼ React state setConfigValues({...}) ▼ UI toggles reflect current state ``` -------------------------------- ### constructor() Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/03-terminal-api.md Initializes a new Terminal instance with empty output lines and no shell running. ```APIDOC ## constructor() ### Description Initialize a new Terminal instance with empty output lines and no shell running. ### Usage Example ```typescript const [terminal] = useState(() => new Terminal()) ``` ``` -------------------------------- ### get shellRunning() Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/03-terminal-api.md Returns whether a shell command is currently executing. ```APIDOC ## get shellRunning() ### Description Returns whether a shell command is currently executing. ### Returns - **running** (boolean) - True if shell is running, false otherwise ### Usage Example ```typescript if (terminal.shellRunning) { button.disabled = true } ``` ``` -------------------------------- ### init(String, boolean, boolean, boolean) Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/09-java-entrypoint.md Initializes the spoofing module with a JSON configuration string and flags to enable specific spoofing features. ```APIDOC ## init(String json, boolean spoofProvider, boolean spoofSignature, boolean spoofBuild) ### Description Initializes the spoofing module with configuration and enable/disable flags. This method handles hidden API bypass, KeyStore provider replacement, signature spoofing, and Build property spoofing. ### Parameters - **json** (String) - Required - JSON object with Build property key-value pairs - **spoofProvider** (boolean) - Required - Enable custom KeyStore provider - **spoofSignature** (boolean) - Required - Enable ROM signature spoofing - **spoofBuild** (boolean) - Required - Enable Android Build property spoofing ### Usage Example ```java String config = loadPifPropertiesAsJson(); EntryPoint.init(config, true, true, true); ``` ``` -------------------------------- ### Call spoofFields directly Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/09-java-entrypoint.md Example of manually triggering a re-application of spoofed fields. ```java EntryPoint.spoofFields() // Re-apply spoof immediately ``` -------------------------------- ### Initialize CustomKeyStoreSpi Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/10-java-keystorespi.md Retrieves the underlying KeyStoreSpi instance via reflection during provider spoofing. ```java KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore"); Field keyStoreSpi = keyStore.getClass().getDeclaredField("keyStoreSpi"); keyStoreSpi.setAccessible(true); CustomKeyStoreSpi.keyStoreSpi = (KeyStoreSpi) keyStoreSpi.get(keyStore); ``` -------------------------------- ### Manage PifConfig Lifecycle and Configuration Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/04-pifconfig-api.md Demonstrates initializing the configuration, reading values, and performing bulk updates. Ensure waitForInit completes before executing other methods. ```typescript // Create and wait for init const pifConfig = new PifConfig(terminal) await pifConfig.waitForInit() // Read a value const isSpoofing = pifConfig.getConfig('spoofBuild') // Update a single value await pifConfig.setConfig('spoofBuild', true) // Read entire config const allConfig = pifConfig.config // Programmatically set multiple via merge const newProp = `spoofBuild=true\nspoofProps=false\n` await pifConfig.write(newProp) ``` -------------------------------- ### Cli.runAutopifScript(opts) Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/05-cli-api.md Runs the autopif.sh script to auto-detect and fetch device fingerprints. ```APIDOC ## static runAutopifScript(opts) ### Description Run the autopif.sh script to auto-detect and fetch device fingerprints. ### Parameters - **opts** ({ env?: Record }) - Optional - Environment variables to pass to script. ### Returns - SpawnResult - Contains stdout/stderr streams and exit event. ``` -------------------------------- ### Build WebUI Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/15-index.md Command to build the WebUI component, resulting in files located in webui/dist/. ```bash npm run build # Output: webui/dist/ ``` -------------------------------- ### Module Directory Structure Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/01-project-overview.md Overview of the project file hierarchy including module, webui, and build configuration components. ```text playintegrityfix/ ├── module/ # Magisk module directory ├── webui/ # React TypeScript web interface ├── zygisk/ # Java Zygisk implementation ├── gradle/ # Gradle configuration └── build.gradle.kts # Gradle build definition ``` -------------------------------- ### github(product) Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/06-update-api.md Fetches the pif.prop file for a specific device product from GitHub, writes it to the configuration, and performs security patching if applicable. ```APIDOC ## github(product) ### Description Fetches pif.prop from the GitHub device tree, writes it via pifConfig, and returns the raw content. It handles fallback URLs and triggers security patching if TrickyStore is enabled. ### Parameters - **product** (string) - Required - Device product name (e.g., "raven" for Pixel 6 Pro) ### Returns - **Promise** - The raw pif.prop file content. ### Usage Example ```typescript try { const content = await updater.github('raven') console.log('Fetched for Pixel 6 Pro:', content) } catch (error) { console.error('All GitHub mirrors failed:', error) } ``` ``` -------------------------------- ### Immutable State Update Patterns Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/14-architecture.md Examples of performing state updates without direct mutation. ```typescript // Terminal output (immutable array): this.#lines = [...this.#lines, newLine] // React state: setConfigValues(prev => ({ ...prev, [key]: value })) // Config map (shallow copy): get config(): PifPropMap { return { ...this.#config } } ``` -------------------------------- ### Using the Cli class for system operations Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/05-cli-api.md Demonstrates common usage patterns for version loading, system integrity checks, configuration updates, and script execution. ```typescript // In Update class const version = await Cli.loadVersion() // In App initialization const tampered = await Cli.checkTampered() const selinux = await Cli.checkSELinux() // On config toggle await pc.setConfig('spoofBuild', true) Cli.killGms() // For script execution const proc = Cli.runAutopifScript() proc.stdout.on('data', (data) => terminal.output(data)) ``` -------------------------------- ### Configuration Write Behavior Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/12-configuration.md Illustrates the internal process of merging and persisting configuration changes to the custom path. ```text PifConfig.write() → Merges result with current config → Writes to /data/adb/pif.prop → Internal state updated ``` -------------------------------- ### Load Configuration from File Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/04-pifconfig-api.md Reads and parses properties from disk, merging them with default spoofConfig fields. ```typescript async #loadFromFile(): Promise ``` -------------------------------- ### File.createDirectory(dir) Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/07-file-api.md Creates a directory and all necessary parent directories. ```APIDOC ## File.createDirectory(dir) ### Description Create a directory and all parent directories. Executes `mkdir -p`. ### Signature `static async createDirectory(dir: string): Promise` ### Parameters - **dir** (string) - Required - Directory path to create ### Returns - **Promise** - Resolves when the operation completes. ### Usage Example ```typescript await File.createDirectory('/data/adb/mymodule') ``` ``` -------------------------------- ### UI Layer Resilience Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/14-architecture.md Example of wrapping asynchronous calls in the UI layer to prevent exception propagation. ```typescript try { const devices = await up.fetchDeviceList() setDevices(devices) } catch { setDeviceListError(true) // UI shows error state } ``` -------------------------------- ### Initialize CustomProvider Constructor Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/11-java-provider-creator.md Constructor signature for initializing the CustomProvider with an existing provider. ```java public CustomProvider(Provider provider) ``` -------------------------------- ### Initialize Configuration Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/04-pifconfig-api.md Runs on construction to load the configuration, triggering a reset to defaults if loading fails. ```typescript async #init(): Promise ``` -------------------------------- ### Initialize PifConfig Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/04-pifconfig-api.md Constructor signature and basic initialization pattern. ```typescript constructor(terminal: Terminal) ``` ```typescript const pifConfig = new PifConfig(terminal) await pifConfig.waitForInit() // Wait for async init ``` -------------------------------- ### Device Fetch Path Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/14-architecture.md Process for downloading and applying device-specific property files from remote mirrors. ```text User selects device "Pixel 6 Pro" ▼ FetchDialog calls Update.github("raven") ▼ fallbackFetch() tries three GitHub mirrors ▼ bot/device_prop/raven.prop downloaded ▼ PifConfig.write() merges fetched + current ▼ File.write() to /data/adb/pif.prop ▼ Terminal displays downloaded properties ▼ Auto security patch runs (if TrickyStore enabled) ``` -------------------------------- ### Initialize Custom PackageInfo Creator Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/11-java-provider-creator.md Replaces the standard PackageInfo.CREATOR with a custom wrapper to intercept signature deserialization. ```java // 1. Create spoofed signature from embedded certificate Signature spoofedSignature = new Signature( Base64.decode(signatureData, Base64.DEFAULT) ) // 2. Get original creator Parcelable.Creator originalCreator = PackageInfo.CREATOR // 3. Create custom creator wrapper Parcelable.Creator customCreator = new CustomPackageInfoCreator(originalCreator, spoofedSignature) // 4. Replace CREATOR field Field creatorField = findField(PackageInfo.class, "CREATOR") creatorField.setAccessible(true) creatorField.set(null, customCreator) creatorField.setAccessible(false) // 5. Clear caches to force re-creation with new creator PackageManager.sPackageInfoCache.clear() Parcel.mCreators.clear() Parcel.sPairedCreators.clear() ``` -------------------------------- ### Initialize PifConfig Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/13-app-initialization.md Creates and initializes the configuration manager instance. ```typescript const pc = new PifConfig(terminal) setPifConfig(pc) await pc.waitForInit() ``` -------------------------------- ### Implement engineGetKey Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/10-java-keystorespi.md Retrieves a key from the keystore by delegating directly to the native implementation. ```java @Override public Key engineGetKey(String alias, char[] password) throws NoSuchAlgorithmException, UnrecoverableKeyException ``` -------------------------------- ### Create directory in TypeScript Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/07-file-api.md Creates a directory and all necessary parent directories using the mkdir -p command. ```typescript static async createDirectory(dir: string): Promise ``` ```typescript await File.createDirectory('/data/adb/mymodule') ``` -------------------------------- ### Java Class Definitions Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/15-index.md Lists the core Java classes and their methods for entry point initialization, custom providers, keystore SPI overrides, and package information creation. ```java EntryPoint (all static) init(json, spoofProvider, spoofSignature, spoofBuild) spoofFields() CustomProvider extends Provider constructor(provider) getService(type, algorithm) CustomKeyStoreSpi extends KeyStoreSpi engineGetKey(alias, password) engineGetCertificateChain(alias) engineGetCertificate(alias) ... (8 other overrides) CustomPackageInfoCreator implements Parcelable.Creator constructor(originalCreator, spoofedSignature) createFromParcel(source) newArray(size) ``` -------------------------------- ### engineLoad(stream, password) Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/10-java-keystorespi.md Loads the keystore from an input stream. ```APIDOC ## engineLoad(stream, password) ### Description Reads and initializes the keystore from the provided input stream. ### Signature `void engineLoad(InputStream stream, char[] password)` ### Parameters - **stream** (InputStream) - The input stream to read from. - **password** (char[]) - The password for decryption. ### Throws - CertificateException, IOException, NoSuchAlgorithmException ``` -------------------------------- ### Initialize Terminal Instance Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/03-terminal-api.md Create a new Terminal instance for managing shell output. ```typescript const terminal = new Terminal() ``` ```typescript const [terminal] = useState(() => new Terminal()) ``` -------------------------------- ### Handle View Configuration Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/13-app-initialization.md Parses and outputs the current pif.prop configuration to the terminal. ```typescript const handleView = useCallback(async () => { const pc = pifConfig if (!pc) return const propText = PROP.stringify(pc.config) if (propText) { propText.split('\n').forEach(line => terminal.output(line)) terminal.output('') } else { terminal.output('[!] ' + i18n.t('output_error_read_pif_prop'), true) } }, [terminal, pifConfig]) ``` -------------------------------- ### Initialize I18n Instance Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/08-utilities.md Constructor and instantiation of the I18n service. ```typescript constructor() ``` ```typescript export const i18n = new I18n() ``` -------------------------------- ### Run Autopif Script Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/05-cli-api.md Spawns the autopif.sh script to fetch device fingerprints, optionally accepting environment variables. ```typescript static runAutopifScript(opts?: { env?: Record }): ReturnType ``` ```typescript const proc = Cli.runAutopifScript() proc.stdout.on('data', (data: string) => terminal.output(data)) proc.stderr.on('data', (data: string) => terminal.output(data, true)) proc.on('exit', () => console.log('Done')) ``` ```typescript const proc = Cli.runAutopifScript({ env: { MODEL: '"Pixel 6"', PRODUCT: '"raven"' } }) ``` ```typescript const opts: Record = {} if (model && product) { opts.env = { MODEL: `"${model}"`, PRODUCT: `"${product}"` } } const scriptOutput = Cli.runAutopifScript(opts) ``` -------------------------------- ### Constructor for CustomPackageInfoCreator Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/11-java-provider-creator.md Initializes the creator with the original creator and the spoofed signature. ```java public CustomPackageInfoCreator(Parcelable.Creator originalCreator, Signature spoofedSignature) ``` -------------------------------- ### Setting Flags Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/07-file-api.md Create or delete files to toggle specific system flags. ```typescript // Enable script-only mode await File.createFile('/data/adb/pif_script_only') // Disable script-only mode await File.delete('/data/adb/pif_script_only') ``` -------------------------------- ### Zygisk Integration Flow Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/09-java-entrypoint.md The sequence of calls from Zygisk loader to the EntryPoint initialization. ```text Zygisk Loader → Loads native library → Calls JNI init → EntryPoint.init() with configuration ``` -------------------------------- ### Wait for Initialization Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/04-pifconfig-api.md Methods to ensure the configuration is loaded before access. ```typescript async waitForInit(): Promise ``` ```typescript const pifConfig = new PifConfig(terminal) await pifConfig.waitForInit() const config = pifConfig.config ``` ```typescript const pc = new PifConfig(terminal) setPifConfig(pc) await pc.waitForInit() // Wait before reading config ``` -------------------------------- ### Cli.runAutopifOta() Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/05-cli-api.md Runs the autopif_ota.sh script for updating the autopif.sh script itself. ```APIDOC ## static runAutopifOta() ### Description Run the autopif_ota.sh script for updating the autopif.sh script itself. ### Returns - SpawnResult - Contains stdout/stderr streams and exit event. ``` -------------------------------- ### fetchDeviceList() Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/06-update-api.md Retrieves a list of available devices from the remote device_list.json file. ```APIDOC ## fetchDeviceList() ### Description Fetches and parses the list of available devices from GitHub. Returns a filtered array of DeviceInfo objects containing model and product information. ### Parameters None ### Returns - **Promise** - An array of device objects. Returns an empty array on error. ### Usage Example ```typescript const devices = await updater.fetchDeviceList() console.log(`Found ${devices.length} devices`) ``` ``` -------------------------------- ### Define EntryPoint class structure Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/09-java-entrypoint.md The core class definition for the EntryPoint, including static fields and method signatures. ```java public final class EntryPoint { public static final String TAG = "PIF" private static final Map map private static final String signatureData public static void init(String json, boolean spoofProvider, boolean spoofSignature, boolean spoofBuild) public static void spoofFields() } ``` -------------------------------- ### Initialize WebUI Components Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/15-index.md Initializes the terminal, configuration, and update services within the React application lifecycle. ```typescript const [terminal] = useState(() => new Terminal()) const [pifConfig, setPifConfig] = useState(null) const [updater, setUpdater] = useState(null) useEffect(() => { const init = async () => { await i18n.loadTranslations() const pc = new PifConfig(terminal) await pc.waitForInit() const up = new Update(terminal, pc) // ... rest of initialization } init() }, [terminal]) ``` -------------------------------- ### Update Class Integration Pattern Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/06-update-api.md Demonstrates initializing the Update class with Terminal and PifConfig dependencies to fetch device data. ```typescript const terminal = new Terminal() const pifConfig = new PifConfig(terminal) await pifConfig.waitForInit() const updater = new Update(terminal, pifConfig) // Fetch device list const devices = await updater.fetchDeviceList() // Fetch specific device await updater.github('raven') // Auto-detect with selection await updater.autopif('Pixel 6 Pro', 'raven') ``` -------------------------------- ### Handle Help Dialog Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/13-app-initialization.md Opens the help dialog and pushes a history state for back button navigation. ```typescript const handleHelpClick = useCallback(() => { helpDialogRef.current?.show() history.push('dialog-help', () => helpDialogRef.current?.close()) }, [history]) ``` -------------------------------- ### Initial Device Resolution Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/13-app-initialization.md Stores and resolves the initial device model after the device list has loaded. ```typescript const initialDeviceRef = useRef(null) ``` ```typescript const modelVal = pc.config.MODEL if (modelVal) { initialDeviceRef.current = String(modelVal) } // Later: if (initialDeviceRef.current) { const match = devs.find(d => d.model === initialDeviceRef.current || d.product === initialDeviceRef.current ) if (match) setSelectedDevice(match) } ``` -------------------------------- ### Handle Fetch Dialog Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/13-app-initialization.md Opens the device selection dialog and pushes a history state for back button navigation. ```typescript const handleFetch = useCallback(() => { deviceDialogRef.current?.show() history.push('dialog-fetch', () => deviceDialogRef.current?.close()) }, [history]) ``` -------------------------------- ### engineSize() Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/10-java-keystorespi.md Returns the total number of entries in the keystore. ```APIDOC ## engineSize() ### Description Retrieves the count of entries currently stored in the keystore. ### Signature `int engineSize()` ### Returns - **int** - The number of entries. ``` -------------------------------- ### Cli.runSecurityPatch() Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/05-cli-api.md Executes the security_patch.sh script to update the security patch timestamp in TrickyStore. ```APIDOC ## static runSecurityPatch() ### Description Execute the security_patch.sh script to update security patch timestamp in TrickyStore. ### Returns - ExecResult promise - Returns immediately with stdio streams. ``` -------------------------------- ### Load Keystore from Stream Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/10-java-keystorespi.md Loads the keystore from an input stream using the provided password for decryption. ```java @Override public void engineLoad(InputStream stream, char[] password) throws CertificateException, IOException, NoSuchAlgorithmException ``` -------------------------------- ### onShellStateChange(listener) Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/03-terminal-api.md Subscribe to shell running state changes. ```APIDOC ## onShellStateChange(listener) ### Description Subscribe to shell running state changes. ### Parameters - **listener** (ShellStateListener) - Required - Callback fired with boolean when shell state changes ### Returns - **() => void** - Unsubscribe function ### Usage Example ```typescript const unsubscribe = terminal.onShellStateChange((running) => { setIsButtonDisabled(running) }) ``` ``` -------------------------------- ### Reset Configuration Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/04-pifconfig-api.md Fetches default properties from GitHub and restores the system state, used primarily during initialization failures. ```typescript async #reset(): Promise ``` -------------------------------- ### Read Configuration from Disk Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/04-pifconfig-api.md Reloading configuration state from the filesystem. ```typescript async read(): Promise ``` ```typescript try { await pifConfig.read() console.log('Config reloaded') } catch (error) { console.error('Failed to read config:', error) } ``` ```typescript scriptOutput.on('exit', async () => { try { await this.#pifConfig.read() } catch { /* config re-read handled silently */ } }) ``` -------------------------------- ### Device List Fetching Method Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/06-update-api.md Defines the signature for retrieving the list of available devices. ```typescript async fetchDeviceList(): Promise ``` -------------------------------- ### GitHub Device Fetching Method Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/06-update-api.md Defines the signature for fetching pif.prop files from GitHub repositories. ```typescript async github(product: string): Promise ``` -------------------------------- ### Define init method signature Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/09-java-entrypoint.md The method signature for initializing the spoofing module with configuration and feature flags. ```java public static void init(String json, boolean spoofProvider, boolean spoofSignature, boolean spoofBuild) ``` -------------------------------- ### File.createFile(path) Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/07-file-api.md Creates an empty file at the specified path. ```APIDOC ## File.createFile(path) ### Description Create an empty file. Executes `touch`. ### Signature `static async createFile(path: string): Promise` ### Parameters - **path** (string) - Required - File path to create ### Returns - **Promise** - Resolves when the operation completes. ### Usage Example ```typescript await File.createFile('/data/adb/pif_script_only') ``` ``` -------------------------------- ### PifConfig API Methods Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/04-pifconfig-api.md Methods available for interacting with the PifConfig instance to manage system configuration. ```APIDOC ## PifConfig Methods ### waitForInit() - **Description**: Ensures the configuration is fully initialized. Must be called before other methods. ### getConfig(key) - **Description**: Retrieves the value of a specific configuration key. - **Parameters**: key (string) ### setConfig(key, value) - **Description**: Updates a single configuration value. - **Parameters**: key (string), value (any) ### write(data) - **Description**: Updates multiple configuration values using a string in pif.prop format. - **Parameters**: data (string) ### config - **Description**: Property returning the entire current configuration object. ``` -------------------------------- ### Implement createFromParcel Method Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/11-java-provider-creator.md Deserializes PackageInfo and replaces the signature if the package name is 'android'. ```java @Override @SuppressWarnings("deprecation") public PackageInfo createFromParcel(Parcel source) ``` ```java packageInfo.signatures[0] = spoofedSignature ``` ```java Signature[] signaturesArray = packageInfo.signingInfo.getApkContentsSigners() if (signaturesArray != null && signaturesArray.length > 0) { signaturesArray[0] = spoofedSignature } ``` -------------------------------- ### Handle PackageInfo Deserialization Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/11-java-provider-creator.md Logic executed within the custom creator to swap the signature when the target package is identified. ```java // 1. System code calls: PackageInfo info = PackageInfo.CREATOR.createFromParcel(parcel) // 2. CustomPackageInfoCreator.createFromParcel() is invoked: PackageInfo info = originalCreator.createFromParcel(parcel) // Real data if (info.packageName.equals("android")) { info.signatures[0] = spoofedSignature // Replace } return info // 3. Caller receives modified PackageInfo with spoofed signature ``` -------------------------------- ### Initialize Update Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/13-app-initialization.md Creates the update manager instance and triggers background OTA updates. ```typescript const up = new Update(terminal, pc) setUpdater(up) ``` -------------------------------- ### Update Utilities Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/15-index.md Methods for fetching device lists and remote content. ```APIDOC ## Update.fetchDeviceList() - Description: Load available devices from GitHub. - Returns: array (possibly empty) on success. Never throws; returns [] on any error. ## Update.github() - Description: Fetches remote content. - Returns: Fetched content on success. - Throws: If all three mirrors fail. ``` -------------------------------- ### autopif(model, product) Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/06-update-api.md Executes the autopif.sh script to auto-detect and extract device fingerprints, optionally filtered by model and product. ```APIDOC ## autopif(model, product) ### Description Runs the autopif.sh script to auto-detect device fingerprints. If model and product are provided, they are passed as environment variables to the script. ### Parameters - **model** (string | null) - Optional - Android Build.MODEL to scan for - **product** (string | null) - Optional - Android Build.PRODUCT to scan for ### Returns - **Promise** - Resolves when the script process completes. ### Usage Example ```typescript // Auto-detect await updater.autopif() // With device selection await updater.autopif('Pixel 6 Pro', 'raven') ``` ``` -------------------------------- ### Implement engineGetCreationDate Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/10-java-keystorespi.md Retrieves the creation date of a key or certificate entry. ```java @Override public Date engineGetCreationDate(String alias) ``` -------------------------------- ### engineStore(stream, password) Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/10-java-keystorespi.md Serializes the keystore to an output stream. ```APIDOC ## engineStore(stream, password) ### Description Writes the keystore contents to the specified output stream using the provided password. ### Signature `void engineStore(OutputStream stream, char[] password)` ### Parameters - **stream** (OutputStream) - The output stream to write to. - **password** (char[]) - The password for encryption. ### Throws - CertificateException, IOException, NoSuchAlgorithmException ``` -------------------------------- ### WebUI Dependency Graph Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/14-architecture.md Visual representation of the WebUI component hierarchy and module dependencies. ```text App.tsx (main component) ├── Terminal.ts (observable output stream) ├── PifConfig.ts (persistent config management) │ ├── PROP.ts (parse/stringify pif.prop) │ ├── File.ts (filesystem I/O) │ └── I18n.ts (translations) ├── Update.ts (GitHub fetches, scripts) │ ├── Cli.ts (shell command execution) │ ├── File.ts (filesystem I/O) │ ├── PROP.ts (property parsing) │ └── fetch.ts (fallback fetch with mirrors) ├── Cli.ts (system operations) │ └── kernelsu-alt (root execution) ├── File.ts (filesystem I/O) ├── I18n.ts (translations) ├── useHistory.ts (dialog history management) └── Components (UI views) ├── Terminal.tsx (output display) ├── FilterGroup.tsx (actions) ├── SwitchItem.tsx (toggle option) ├── FetchDialog.tsx (device selection) ├── WarningDialog.tsx (tampered warning) └── HelpDialog.tsx (help) ``` -------------------------------- ### Configuration Hierarchy Diagram Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/14-architecture.md Visual representation of the data flow from memory to the Zygisk module and Java runtime. ```text Memory (React state) ↓ (on write) Disk (/data/adb/pif.prop) ↓ (on read) Zygisk (module loads on boot) ↓ (on API call) Java Runtime (Build properties) ``` -------------------------------- ### User Interaction Flows Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/14-architecture.md Logic flows for toggling spoof options, fetching device data, and viewing configuration. ```text User clicks toggle → handleToggle(config, value) ├─ terminal.setShellRunning(true) ├─ pifConfig.setConfig(config, value) │ ├─ PROP.stringify() │ └─ File.write() ├─ Cli.killGms() ├─ setConfigValues() → re-render └─ terminal.setShellRunning(false) ``` ```text User selects device, clicks Fetch → FetchDialog renders → User confirms → Update.github(product) ├─ fallbackFetch() from three mirrors ├─ pifConfig.write() ├─ Terminal output each line └─ Optional security_patch.sh ``` ```text User clicks View → handleView() ├─ PROP.stringify(pifConfig.config) └─ Output each line to terminal ``` -------------------------------- ### Cli.checkRomSignature() Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/05-cli-api.md Detects if the ROM is signed with testkey or releasekey. ```APIDOC ## static async checkRomSignature() ### Description Detect if the ROM is signed with testkey or releasekey. ### Returns - Promise - "testkey" if ROM is test-signed, "releasekey" if ROM is release-signed, or an empty string if unable to determine. ``` -------------------------------- ### Build Zygisk Module Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/15-index.md Gradle command to build the Zygisk module, producing a Magisk module ZIP file. ```bash ./gradlew build # Output: Magisk module ZIP ``` -------------------------------- ### Access Configuration Object Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/04-pifconfig-api.md Retrieving the full configuration map as a shallow copy. ```typescript get config(): PifPropMap ``` ```typescript const allConfig = pifConfig.config console.log(allConfig.spoofBuild) // true or false ``` ```typescript const modelVal = pc.config.MODEL // Get MODEL property ``` -------------------------------- ### Reset Configuration to Defaults Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/12-configuration.md Methods to revert to system defaults by either deleting the custom property file or re-fetching from the remote source. ```typescript // Option 1: Delete custom file await File.delete('/data/adb/pif.prop') await pifConfig.read() // Re-reads default // Option 2: Fetch from GitHub (what init failure does) await File.delete('/data/adb/pif.prop') const content = await fallbackFetch([...urls]) await pifConfig.write(content.text()) ``` -------------------------------- ### Cli.toggleAutoSecurityPatch(enable) Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/05-cli-api.md Enables or disables automatic security patch updates via TrickyStore. ```APIDOC ## static async toggleAutoSecurityPatch(enable) ### Description Enable or disable automatic security patch updates via TrickyStore. ### Parameters - **enable** (boolean) - Required - True to enable, false to disable auto-patching. ### Returns - Promise ``` -------------------------------- ### Retrieve Keystore Aliases Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/10-java-keystorespi.md Returns an enumeration of all aliases stored in the keystore by delegating to the native KeyStoreSpi. ```java @Override public Enumeration engineAliases() ``` -------------------------------- ### Cli.checkSELinux() Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/05-cli-api.md Retrieves the current SELinux enforcement status. ```APIDOC ## checkSELinux() ### Description Executes `getenforce` to determine the current SELinux status. ### Returns - **Promise** - Returns "Enforcing", "Permissive", or an empty string on error. ### Usage Example ```typescript const selinux = await Cli.checkSELinux(); ``` ``` -------------------------------- ### Implement engineSetCertificateEntry Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/10-java-keystorespi.md Stores a certificate entry in the keystore. ```java @Override public void engineSetCertificateEntry(String alias, Certificate cert) throws KeyStoreException ``` -------------------------------- ### Implement engineSetKeyEntry Overloads Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/10-java-keystorespi.md Stores key entries in the keystore, supporting both password-protected and encoded key formats. ```java @Override public void engineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain) throws KeyStoreException ``` ```java @Override public void engineSetKeyEntry(String alias, byte[] key, Certificate[] chain) throws KeyStoreException ``` -------------------------------- ### Run Autopif OTA Script Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/05-cli-api.md Spawns the autopif_ota.sh script to update the autopif.sh script itself. ```typescript static runAutopifOta(): ReturnType ``` ```typescript const proc = Cli.runAutopifOta() proc.stdout.on('data', (data: string) => console.log(data)) ``` -------------------------------- ### Implement engineGetCertificate Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/10-java-keystorespi.md Retrieves a single certificate by alias, delegating to the native implementation. ```java @Override public Certificate engineGetCertificate(String alias) ``` -------------------------------- ### Override getService in CustomProvider Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/10-java-keystorespi.md Ensures Build properties are refreshed on every KeyStore access by calling EntryPoint.spoofFields(). ```java public synchronized Service getService(String type, String algorithm) { EntryPoint.spoofFields(); // Re-apply Build spoof return super.getService(type, algorithm); } ``` -------------------------------- ### Cli.openLink(url) Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/05-cli-api.md Opens a URL in the default browser or via Android intent. ```APIDOC ## static openLink(url) ### Description Open a URL in the default browser or Android intent. ### Parameters - **url** (string) - Required - URL to open (e.g., "https://example.com"). ### Returns - void ``` -------------------------------- ### File.write(path, data, cmd) Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/07-file-api.md Writes data to a file, optionally piping through a shell command. ```APIDOC ## File.write(path, data, cmd) ### Description Writes data to a file using a here-document and an optional shell command. ### Parameters - **path** (string) - Required - File path to write to - **data** (string) - Required - Content to write - **cmd** (string) - Optional - Shell command to pipe through (default: 'cat') ### Returns - **Promise** ### Errors - Throws an error if the command fails, with the format: `File.write failed (${errno}): ${stderr}` ``` -------------------------------- ### Implement engineDeleteEntry Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/10-java-keystorespi.md Removes a key or certificate entry from the keystore. ```java @Override public void engineDeleteEntry(String alias) throws KeyStoreException ``` -------------------------------- ### setShellRunning(running) Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/03-terminal-api.md Update the shell running state and notify all listeners. ```APIDOC ## setShellRunning(running) ### Description Update the shell running state and notify all listeners. ### Parameters - **running** (boolean) - Required - True to mark shell as running, false to mark as idle ### Usage Example ```typescript terminal.setShellRunning(true) const result = await Cli.runAutopifScript() terminal.setShellRunning(false) ``` ``` -------------------------------- ### Set configuration value Source: https://github.com/kowx712/playintegrityfix/blob/inject_s/_autodocs/04-pifconfig-api.md Updates a specific configuration key and immediately persists the change to disk. ```typescript async setConfig(name: string, value: boolean): Promise ``` ```typescript await pifConfig.setConfig('spoofBuild', true) await pifConfig.setConfig('spoofProps', false) ``` ```typescript const handleToggle = async (config: string, value: boolean) => { await pc.setConfig(config, value) Cli.killGms() } ```