react-native-malwarelytics
Version:
Malwarelytics for React Native protects your banking or fintech app from a broad range of mobile security threats with an industry-leading mobile threat intelligence solution.
291 lines • 9.7 kB
TypeScript
import type { EmulatorInfo } from "./model/rasp/EmulatorInfo";
import type { HttpProxyInfo } from "./model/rasp/HttpProxyInfo";
import type { RepackagingInfo } from "./model/rasp/RepackageInfo";
import type { ScreenSharingInfo } from "./model/rasp/ScreenSharingInfo";
import type { ScreenReaderInfo } from "./model/rasp/ScreenReaderInfo";
import type { SystemIntegrityInfo } from "./model/rasp/SystemIntegrityInfo";
import type { TapjackingInfo } from "./model/rasp/TapjackingInfo";
import type { ActiveCallInfo } from "./model/rasp/ActiveCallInfo";
import type { AppPresenceInfo } from "./model/rasp/AppPresenceInfo";
import type { DebuggerInfo } from "./model/rasp/DebuggerInfo";
import type { BiometryInfo } from "./model/rasp/BiometryInfo";
import type { EventHelper } from "./internal/EventHelper";
/**
* Malwarelytics RASP module.
*/
export declare class MalwarelyticsRasp {
constructor(eventHelper: EventHelper);
/**
* Instance of EventHelper shared with Malwarelytics class.
*/
private readonly eventHelper;
/**
* Instance of native module interface.
*/
private readonly module;
/**
* Object representing a subscription to RASP events.
*/
private raspEventsSubscription;
/**
* Set listener for RASP events.
* @param listener Listener implementation.
*/
setRaspListener(listener: MalwarelyticsRaspListener): Promise<void>;
/**
* Remove RASP listener previously set by `setRaspListener()` method.
*/
removeRaspListener(): void;
/**
* Get information about Jailbreak or Root presence on the device.
*/
getSystemIntegrityInfo(): Promise<SystemIntegrityInfo>;
/**
* Get information whether app is running in emulator. You can use `getEmulatorInfo()` method to get more details
* about the emulator type.
*/
isRunningInEmulator(): Promise<boolean>;
/**
* Get information whether debugger is connected.
*/
isDebuggerConnected(): Promise<boolean>;
/**
* Get detailed information about debugger detection.
*/
getDebuggerInfo(): Promise<DebuggerInfo>;
/**
* Get information about application repackaging.
*/
getRepackagingInfo(): Promise<RepackagingInfo>;
/**
* Get information about HTTP proxy configured on the system.
*/
getHttpProxyInfo(): Promise<HttpProxyInfo>;
/**
* Get information whether app is running in emulator.
*/
getEmulatorInfo(): Promise<EmulatorInfo>;
/**
* Get information about active screen sharing or screen capturing.
*/
getScreenSharingInfo(): Promise<ScreenSharingInfo>;
/**
* Get information about active VPN connection.
*/
isVpnActive(): Promise<boolean>;
/**
* Get information about the active phone call.
*/
isOnCall(): Promise<boolean>;
/**
* Obtain information about app presence.
*/
getAppPresenceInfo(): Promise<AppPresenceInfo>;
/**
* Apple specific: Get information whether reverse engineering tools are present on the device.
*/
isReverseEngineeringToolsPresent(): Promise<boolean>;
/**
* Apple specific: Get information about enabled passcode in the system (device lock)
*/
isSystemPasscodeEnabled(): Promise<boolean>;
/**
* Apple specific: Get information about biometry enrolled by the user in the system.
*/
isSystemBiometryEnabled(): Promise<boolean>;
/**
* Android specific: Get information about tapjacking.
*/
getTapjackingInfo(): Promise<TapjackingInfo>;
/**
* Android specific: Get information about connected ADB.
*/
getAdbStatus(): Promise<boolean>;
/**
* Android specific: Check if system screen lock (PIN or pattern) is being used to prevent
* unauthorized usage of the device by other people. It does not check if the device is currently locked.
*/
isScreenLockEnabled(): Promise<boolean>;
/**
* Android specific: Check if Play Protect is enabled on the device. `undefined` value indicates that there was
* a problem obtaining the information.
*/
isPlayProtectEnabled(): Promise<boolean | undefined>;
/**
* Android specific: Get information about screen readers.
*/
getScreenReaderInfo(): Promise<ScreenReaderInfo>;
/**
* Android specific: Check if any not allowed screen reader is enabled on the device. Allowed screen readers are configured
* in `MalwarelyticsAndroidRaspScreenReadersConfig.allowedScreenReaders`.
*/
isNotAllowedScreenReaderEnabled(): Promise<boolean>;
/**
* Android specific: Check if there's a bad app that is able to create a system overlay. A bad app is one that
* has a treat index same or higher than `MalwarelyticsAndroidRaspTapjackingConfig.blockSensitivity`.
*/
isBadTapjackingCapableAppPresent(): Promise<boolean>;
/**
* Android specific: Check if developer options are enabled on the device.
*/
isDeveloperOptionsEnabled(): Promise<boolean>;
/**
* Android specific: Obtain information about biometry on the device.
*/
getBiometryInfo(): Promise<BiometryInfo>;
/**
* Android specific: Obtain information about active call.
*/
getActiveCallInfo(): Promise<ActiveCallInfo>;
/**
* Acquire typed information about RASP detection.
* @param messageType RASP message to get.
* @returns Value returned from native code.
*/
private getRaspInfo;
/**
* Acquire typed information about RASP detection. This function fails if called on non-Apple platform.
* @param messageType RASP message to get.
* @returns Value returned from native code.
*/
private getRaspAppleInfo;
/**
* Acquire typed information about RASP detection. This function fails if called on non-Android platform.
* @param messageType RASP message to get.
* @returns Value returned from native code.
*/
private getRaspAndroidInfo;
}
export interface MalwarelyticsRaspListener {
/**
* Called when debuger is attached to the executable.
*
* Platforms: Apple, Android
*
* @param detected True is debugger is attached.
*/
debuggerDetected(detected: boolean): void;
/**
* Called when repackage is detected.
*
* Platforms: Apple, Android
*
* @param info Information about repackaging.
*/
repackagingDetected(info: RepackagingInfo): void;
/**
* Called when device is jailbroken or rooted.
*
* Platforms: Apple, Android
*
* @param info Information about compromited system integrity.
*/
systemIntegrityCompromised(info: SystemIntegrityInfo): void;
/**
* Called when application is running in emulator environment.
*
* Platforms: Apple, Android
*
* @param info Information about emulator environment.
*/
emulatorDetected(info: EmulatorInfo): void;
/**
* Called when HTTP proxy is detected.
*
* Platforms: Apple (limited), Android
*
* @param info Information about proxy configuration.
*/
httpProxyDetected(info: HttpProxyInfo): void;
/**
* Called when screen sharing or capturing is detected.
*
* Platforms: Apple, Android
*
* @param info Information about screen sharing.
*/
screenSharingDetected(info: ScreenSharingInfo): void;
/**
* Called when VPN status is changed
*
* Platforms: Apple, Android
* @param active VPN status
*/
vpnDetected(active: boolean): void;
/**
* Called when application detects a change in enabled screen readers.
*
* Platforms: Android
*
* @param info Information about detected screen readers.
*/
screenReaderDetected(info: ScreenReaderInfo): void;
/**
* Called when tapjacking is detected.
*
* Platforms: Android
* @param info Information about detected tapjacking.
*/
tapjackingDetected(info: TapjackingInfo): void;
/**
* Called when ADB status is changed. (TODO)
*
* Platforms: Android
*
* @param adbStatus ADB status changed
*/
adbStatusDetected(adbStatus: boolean): void;
/**
* Call when active call detection changes are detected.
*
* Platforms: Android
*
* @param info Information about active call.
*/
activeCallDetected(info: ActiveCallInfo): void;
/**
* Called when app presence changes.
*
* Platforms: Android
*
* @param info Information about app presence.
*/
appPresenceChangeDetected(info: AppPresenceInfo): void;
/**
* Called after user took the screenshot.
*
* Platforms: Apple
*/
userScreenshotDetected(): void;
/**
* Called when reverse engineering tools detected on the system.
*
* Platforms: Apple
*/
reverseEngineeringToolsDetected(): void;
/**
* Called when device passcode configuration is changed.
*
* Platforms: Apple
*
* @param enabled Passcode is enabled or disabled.
*/
systemPasscodeConfigurationChanged(enabled: boolean): void;
/**
* Called when device's biometry configuration is changed.
*
* Platforms: Apple
*
* @param enabled Biometry is enabled or disabled.
*/
systemBiometryConfigurationChanged(enabled: boolean): void;
/**
* Called when the status of phone call is changed.
*
* Platforms: Apple
*
* @param isOnCall `true` if there's active call right now.
*/
isOnCallChanged(isOnCall: boolean): void;
}
//# sourceMappingURL=MalwarelyticsRasp.d.ts.map