appium-adb
Version:
Android Debug Bridge interface
78 lines • 2.98 kB
TypeScript
import type { ADB } from '../adb';
import type { CertCheckOptions, KeystoreHash } from './types';
/**
* Execute apksigner utility with given arguments.
*
* @param args - The list of tool arguments.
* @returns - Command stdout
* @throws If apksigner binary is not present on the local file system
* or the return code is not equal to zero.
*/
export declare function executeApksigner(this: ADB, args: string[]): Promise<string>;
/**
* (Re)sign the given apk file on the local file system with the default certificate.
*
* @param apk - The full path to the local apk file.
* @throws If signing fails.
*/
export declare function signWithDefaultCert(this: ADB, apk: string): Promise<void>;
/**
* (Re)sign the given apk file on the local file system with a custom certificate.
*
* @param apk - The full path to the local apk file.
* @throws If signing fails.
*/
export declare function signWithCustomCert(this: ADB, apk: string): Promise<void>;
/**
* (Re)sign the given apk file on the local file system with either
* custom or default certificate based on _this.useKeystore_ property value
* and Zip-aligns it after signing.
*
* @param appPath - The full path to the local .apk(s) file.
* @throws If signing fails.
*/
export declare function sign(this: ADB, appPath: string): Promise<void>;
/**
* Perform zip-aligning to the given local apk file.
*
* @param apk - The full path to the local apk file.
* @returns True if the apk has been successfully aligned
* or false if the apk has been already aligned.
* @throws If zip-align fails.
*/
export declare function zipAlignApk(this: ADB, apk: string): Promise<boolean>;
/**
* Check if the app is already signed with the default Appium certificate.
*
* @param appPath - The full path to the local .apk(s) file.
* @param pkg - The name of application package.
* @param opts - Certificate checking options
* @returns True if given application is already signed.
*/
export declare function checkApkCert(this: ADB, appPath: string, pkg: string, opts?: CertCheckOptions): Promise<boolean>;
/**
* Retrieve the the hash of the given keystore.
*
* @returns
* @throws If getting keystore hash fails.
*/
export declare function getKeystoreHash(this: ADB): Promise<KeystoreHash>;
/**
* Get the absolute path to apksigner tool
*
* @returns An absolute path to apksigner tool.
* @throws If the tool is not present on the local file system.
*/
export declare function getApksignerForOs(this: ADB): Promise<string>;
/**
* Unsigns the given apk by removing the
* META-INF folder recursively from the archive.
* !!! The function overwrites the given apk after successful unsigning !!!
*
* @param apkPath The path to the apk
* @returns `true` if the apk has been successfully
* unsigned and overwritten
* @throws if there was an error during the unsign operation
*/
export declare function unsignApk(apkPath: string): Promise<boolean>;
//# sourceMappingURL=apk-signing.d.ts.map