/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import * as FridaJs from 'frida-js';
import { HtkConfig } from '../../config';
/**
 * Terminology:
 * - FridaHost: a device which may contain 1+ Frida targets
 * - FridaTarget: a single app that can be intercepted
 **/
export interface FridaHost {
    id: string;
    name: string;
    type: string;
    state: 'unavailable' | 'setup-required' | 'launch-required' | 'available';
    targets?: FridaTarget[];
}
export interface FridaTarget {
    id: string;
    name: string;
}
export declare const FRIDA_VERSION = "17.9.1";
export declare const FRIDA_DEFAULT_PORT = 27042;
export declare const FRIDA_ALTERNATE_PORT = 24072;
export declare const FRIDA_BINARY_NAME: string;
export declare const FRIDA_SRIS: {
    readonly android: {
        readonly arm: "sha512-zkGBz192uvqJLvJkoWfKd5jGWLK5zpAwU3UIWTpw/3nTXsVMAopoX5YauPaQvaT/rq5pfyCAcZDCibka9j/tCQ==";
        readonly arm64: "sha512-Q6QnFMueCXV/CuvMKXgEeABWn8ewDp4VHn0Gi5HHrwXxPuqCFuSfjqbGox5gAj9RtWbPGisRMuQgVEdh5EVo4A==";
        readonly x86: "sha512-8CtZSJz3e6eHC2Z3n/O3NG1EMEokzTZPA7IJcPIJ+yfP+/X3Kb193+s30hFp5P4tzMaSs6yBwmKRVhdYHzNQXQ==";
        readonly x86_64: "sha512-Hfod8inu+pg7a067onN9/GSmW0rh9E+DWkBWeHet6ceF7lnZDcN3zoBNzaAZwFn6QsNZess3A5X5fyx0M+deew==";
    };
};
export declare const getFridaServer: (config: HtkConfig, platform: 'android', arch: 'arm' | 'arm64' | 'x86' | 'x86_64') => Promise<import("fs").ReadStream | import("stream").PassThrough>;
export declare const cleanupOldFridaServers: (config: HtkConfig) => Promise<void>;
export declare function killProcess(session: FridaJs.FridaAgentSession): Promise<void>;
export declare function testAndSelectProxyAddress(session: FridaJs.FridaAgentSession, proxyPort: number, options?: {
    extraAddresses?: string[];
}): Promise<string>;
/**
 * Launch a script, watching for errors during its initial exception, and logging any
 * output or returned messages from the session to the console.
 *
 * Note that only one session monitor can be active at any time, so this will replace
 * any existing session message monitoring.
 */
export declare function launchScript(targetName: string, session: FridaJs.FridaAgentSession, script: string): Promise<void>;
export interface FridaSessionCache {
    fridaSession: FridaJs.FridaSession;
    cleanup: () => void;
    timeout: NodeJS.Timeout;
}
export declare const FRIDA_SESSION_IDLE_TIMEOUT = 30000;
export declare function createFridaSessionCache(): Record<string, FridaSessionCache>;
export declare function clearFridaSessionCache(cache: Record<string, FridaSessionCache>, hostId: string): void;
export declare function getOrCreateFridaSession(cache: Record<string, FridaSessionCache>, hostId: string, getStream: () => Promise<any>): Promise<{
    fridaSession: FridaJs.FridaSession;
    wasCached: boolean;
}>;
