Skip to content

Commit

Permalink
Fix plugin module
Browse files Browse the repository at this point in the history
(cherry picked from commit 7fd73c7)
  • Loading branch information
TomasKypta committed Feb 19, 2024
1 parent 6b102c4 commit 199e6ef
Showing 1 changed file with 155 additions and 35 deletions.
190 changes: 155 additions & 35 deletions www/MalwarelyticsPlugin.module.d.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
export declare enum __MPRaspRetection {
ROOT_DETECTION = "ROOT_DETECTION",
export declare enum __MPRaspDetection {
IS_ROOTED = "IS_ROOTED",
ROOT_DETECTION = "ROOT_DETECTION",
IS_EMULATOR = "IS_EMULATOR",
EMULATOR_INFO = "EMULATOR_INFO",
IS_DEBUGGER = "IS_DEBUGGER",
DEBUGGER_INFO = "DEBUGGER_INFO",
REPACKAGE_INFO = "REPACKAGE_INFO",
IS_SCREEN_SHARED = "IS_SCREEN_SHARED",
SCREEN_SHARED_INFO = "SCREEN_SHARED_INFO",
SCREEN_LOCK_ENABLED = "SCREEN_LOCK_ENABLED",
PLAY_PROTECT_ENABLED = "PLAY_PROTECT_ENABLED",
NOT_ALLOWED_SCREEN_READER_ENABLED = "NOT_ALLOWED_SCREEN_READER_ENABLED",
IS_BAD_TAPJACKING_CAPABLE_APP_PRESENT = "IS_BAD_TAPJACKING_CAPABLE_APP_PRESENT",
TAPJACKING_INFO = "TAPJACKING_INFO",
HTTP_PROXY_INFO = "HTTP_PROXY_INFO",
IS_HTTP_PROXY = "IS_HTTP_PROXY",
HTTP_PROXY_INFO = "HTTP_PROXY_INFO",
IS_VPN = "IS_VPN",
DEVELOPER_OPTIONS = "DEVELOPER_OPTIONS",
ADB_STATUS = "ADB_STATUS",
BIOMETRY = "BIOMETRY",
IS_ACTIVE_CALL = "IS_ACTIVE_CALL",
ACTIVE_CALL_INFO = "ACTIVE_CALL_INFO"
ACTIVE_CALL_INFO = "ACTIVE_CALL_INFO",
APP_PRESENCE_INFO = "APP_PRESENCE_INFO",
NOT_ALLOWED_SCREEN_READER_ENABLED = "NOT_ALLOWED_SCREEN_READER_ENABLED",
SCREEN_READER_INFO = "SCREEN_READER_INFO",
SCREEN_LOCK_ENABLED = "SCREEN_LOCK_ENABLED",
BIOMETRY = "BIOMETRY",
PLAY_PROTECT_ENABLED = "PLAY_PROTECT_ENABLED",
DEVELOPER_OPTIONS = "DEVELOPER_OPTIONS"
}
export declare class __MPService {
private readonly pluginName;
Expand Down Expand Up @@ -51,7 +53,7 @@ export declare class __MPAppleService extends __MPService {
/**
* Malwarelytics features for the Android platform.
*/
export declare class MalwarelyticsAndroid extends __MPService {
export declare class MalwarelyticsAndroid extends __MPAndroidService {
/** Features for antivirus component. */
readonly antivirus: MalwarelyticsAndroidAntivirus;
/** Features for RASP component. */
Expand All @@ -74,7 +76,7 @@ export declare class MalwarelyticsAndroid extends __MPService {
/**
* Antivirus component of the Malwarelytics for Android.
*/
export declare class MalwarelyticsAndroidAntivirus extends __MPService {
export declare class MalwarelyticsAndroidAntivirus extends __MPAndroidService {
/**
* Schedules a job that will execute smart protection run. Note that this is asynchronous and
* can take some time.
Expand Down Expand Up @@ -103,50 +105,54 @@ export declare class MalwarelyticsAndroidRASP extends __MPAndroidService {
/** Adds observer that will be called when security event occures (for example when debugger connects). */
setObserver(observer: MalwarelyticsAndroidRASPObserver): void;
clearObserver(): Promise<void>;
/** Detailed information about the state of the root on this device. */
getRootDetection(): Promise<RootDetection>;
/** If the device is rooted */
isDeviceRooted(): Promise<Boolean>;
/** Detailed information about the state of the emulator detection. */
getEmulatorDetection(): Promise<EmulatorDetection>;
/** Detailed information about the state of the root on this device. */
getRootDetection(): Promise<RootDetection>;
/** If app is running on emulator. */
isDeviceEmulator(): Promise<Boolean>;
/** Detailed information about the debugger. */
getDebuggerDetection(): Promise<DebuggerDetection>;
/** Detailed information about the state of the emulator detection. */
getEmulatorDetection(): Promise<EmulatorDetection>;
/** If debugger is attached to this app. */
isDebuggerAttached(): Promise<Boolean>;
/** Detailed information about the debugger. */
getDebuggerDetection(): Promise<DebuggerDetection>;
/** Detailed info about the repackaging. */
getAppRepackaged(): Promise<RepackagingResult>;
/** Detailed info about screen sharing. */
getScreenSharingDetection(): Promise<ScreenSharingDetection>;
/** If the screen is shared. */
isScreenShared(): Promise<Boolean>;
/** If screen lock is set. */
isDeviceUsingScreenLock(): Promise<Boolean>;
/** If google play protect is enabled. */
isPlayProtectEnabled(): Promise<Boolean>;
/** If disalowed scren reader is enabled. */
isNotAllowedScreenReaderEnabled(): Promise<Boolean>;
/** Detailed info about screen sharing. */
getScreenSharingDetection(): Promise<ScreenSharingDetection>;
/** If app that cn do tapjacking is present. */
isBadTapjackingCapableAppPresent(): Promise<Boolean>;
/** Detailed info about tapjacking. */
getTapjackingDetection(): Promise<TapjackingDetection>;
/** Detailed info about http proxy. */
getHttpProxyDetection(): Promise<HttpProxyDetection>;
/** If http proxy is enabled. */
isHttpProxyEnabled(): Promise<Boolean>;
/** Detailed info about http proxy. */
getHttpProxyDetection(): Promise<HttpProxyDetection>;
/** If VPN is enabled. */
isVpnEnabled(): Promise<Boolean>;
/** If developer options are enabled. */
isDeveloperOptionsEnabled(): Promise<Boolean>;
/** If ADB is enabled. */
isAdbEnabled(): Promise<Boolean>;
/** Obtain biometry detection. */
getBiometryDetection(): Promise<BiometryDetection>;
/** If there's ongoing active call at the moment. */
isCallActive(): Promise<Boolean>;
/** Detailed info about active call. */
getActiveCallDetection(): Promise<ActiveCallDetection>;
/** Detailed info about application presence. */
getAppPresenceDetection(): Promise<AppPresenceDetection>;
/** If disalowed scren reader is enabled. */
isNotAllowedScreenReaderEnabled(): Promise<Boolean>;
/** Detailed info about screen readers. */
getScreenReaderDetection(): Promise<ScreenReaderDetection>;
/** If screen lock is set. */
isDeviceUsingScreenLock(): Promise<Boolean>;
/** Obtain biometry detection. */
getBiometryDetection(): Promise<BiometryDetection>;
/** If google play protect is enabled. */
isPlayProtectEnabled(): Promise<Boolean>;
/** If developer options are enabled. */
isDeveloperOptionsEnabled(): Promise<Boolean>;
private getInfo;
private getBoolState;
}
Expand All @@ -161,6 +167,7 @@ export interface MalwarelyticsAndroidRASPObserver {
vpnDetected(vpnEnabled: boolean): void;
adbStatusDetected(adbStatus: boolean): void;
activeCallDetected(activeCallDetection: ActiveCallDetection): void;
appPresenceDetected(appPresenceDetection: AppPresenceDetection): void;
}
/**
* Malwarelytics features for the Apple platforms.
Expand All @@ -172,6 +179,10 @@ export declare class MalwarelyticsApple extends __MPAppleService {
* If the malwarelytics are initialized in the online mode.
*/
isOnline(): Promise<boolean>;
/**
* Obtain list of DetectableApp.KnownApp items that are predefined in native iOS library.
*/
getKnownDetectableApps(): Promise<MalwarelyticsAppleDetectableApp[]>;
}
/**
* Malwarelytics RASP features for the Apple platforms.
Expand Down Expand Up @@ -202,6 +213,13 @@ export declare class MalwarelyticsAppleRASP extends __MPAppleService {
isVpnActive(): Promise<Boolean>;
/** If there is active (phone) call. */
isOnCall(): Promise<Boolean>;
/**
* Obtain the list of installed apps.
* Available apps to check needs to be configured in the `AppProtectionRaspConfig.appPresence` configuration.
*
* @returns list of installed apps.
*/
installedApps(): Promise<MalwarelyticsAppleDetectableApp[]>;
}
export interface MalwarelyticsAppleRASPObserver {
debuggerDetected(): void;
Expand All @@ -215,6 +233,7 @@ export interface MalwarelyticsAppleRASPObserver {
systemBiometryConfigurationChanged(enabled: boolean): void;
vpnChanged(active: boolean): void;
onCallChanged(isOnCall: boolean): void;
installedAppsChanged(installedApps: MalwarelyticsAppleDetectableApp[]): void;
}
export declare enum AppleRaspCallbackType {
DEBUGGER = "DEBUGGER",
Expand All @@ -227,7 +246,8 @@ export declare enum AppleRaspCallbackType {
DEVICE_PASSCODE_CHANGED = "DEVICE_PASSCODE_CHANGED",
DEVICE_BIOMETRY_CHANGED = "DEVICE_BIOMETRY_CHANGED",
VPN_CHANGED = "VPN_CHANGED",
ON_CALL_CHANGED = "ON_CALL_CHANGED"
ON_CALL_CHANGED = "ON_CALL_CHANGED",
INSTALLED_APPS_CHANGED = "INSTALLED_APPS_CHANGED"
}
/** Configuration of the Malwarelytics SDK for the Android platform. */
export interface MalwarelyticsAndroidConfig {
Expand All @@ -239,6 +259,8 @@ export interface MalwarelyticsAndroidConfig {
raspConfig?: MalwarelyticsAndroidRaspConfig;
/** Configuration of customer grouping and naming in the Malwarelytics web console. */
customerGrouping?: MalwarelyticsAndroidCustomerGroupingConfig;
/** Configurre device fingerprinting. */
fingerprint?: MalwarelyticsAndroidFingerprintType;
}
/** Configuration of customer grouping and naming in the Malwarelytics web console. */
export interface MalwarelyticsAndroidCustomerGroupingConfig {
Expand Down Expand Up @@ -266,6 +288,19 @@ export interface MalwarelyticsAndroidCustomerGroupingConfig {
*/
audienceGroupId?: string;
}
/**
* Type of device fingerprinting performed.
* NONE - Fingerprinting is completely turned off on all devices.
* No fingerprinting method is used.
* BASIC - Basic fingerprinting.
* Fingerprinting uses only some fingerprinting methods. Only the methods that are safe on all devices.
* SAFE - Safe fingerprinting.
* Using full fingerprinting on non-problematic device.
* Using basic fingerprinting on problematic devices. Those are some Pixel devices with Android 14.
* FULL - Full fingerprinting.
* Using all available fingerprinting methods.
*/
export declare type MalwarelyticsAndroidFingerprintType = "NONE" | "BASIC" | "SAFE" | "FULL";
/**
* Antivirus component configuration for Android platform
*/
Expand All @@ -286,7 +321,7 @@ export interface MalwarelyticsAndroidRaspConfig {
/** Root detection configuration. The default action is `NOTIFY`. */
root?: MalwarelyticsAndroidRootDetectionConfig;
/** Debugger detection configuration. The default action is `NOTIFY`. */
debugger?: MalwarelyticsAndroidDetectionConfig;
debugger?: MalwarelyticsAndroidDebuggerDetectionConfig;
/** Repackaging detection configuration. The default action is `EXIT`. */
repackage?: MalwarelyticsAndroidRepackageDetectionConfig;
/** Screen sharing detection configuration. The default action is `NOTIFY`. */
Expand All @@ -307,6 +342,8 @@ export interface MalwarelyticsAndroidRaspConfig {
adb?: MalwarelyticsAndroidAdbDetectionConfig;
/** Active call detection configuration. The default action is `NOTIFY`. */
activeCall?: MalwarelyticsAndroidSimpleDetectionConfig;
/** App presence detection configuration. The default action is `NOTIFY`. */
appPresence?: MalwarelyticsAndroidAppPresenceDetectionConfig;
}
/** Data that describes Android APK. */
export interface Apk {
Expand All @@ -329,6 +366,15 @@ export interface MalwarelyticsAndroidRootDetectionConfig {
/** Minimum confidence value of heuristic root detections that triggers app termination. */
exitOnRootMinConfidence?: number;
}
/** Configuration of the debugger detection behavior */
export interface MalwarelyticsAndroidDebuggerDetectionConfig {
/** Behavior of the detection */
action: MalwarelyticsAndroidDetectionAction;
/** This URL will be open in the default browser when app is terminated in case that the `action` is `EXIT`. */
exitUrl?: string;
/** Minimum confidence value of heuristic root detections that triggers app termination. */
debuggerTypes?: DebuggerType[];
}
/** Configuration of the repackage detection behavior */
export interface MalwarelyticsAndroidRepackageDetectionConfig {
/** Behavior of the detection */
Expand Down Expand Up @@ -390,6 +436,26 @@ export interface MalwarelyticsAndroidSimpleDetectionConfig {
/** Behavior of the detection */
action: MalwarelyticsAndroidSimpleDetectionAction;
}
/** Configuration of the app presence detection behavior */
export interface MalwarelyticsAndroidAppPresenceDetectionConfig {
/** Behavior of the detection */
action: MalwarelyticsAndroidDetectionAction;
/** This URL will be open in the default browser when app is terminated in case that the `action` is `EXIT`. */
exitUrl?: string;
/** List of apps that the SDK is looking for.
* When not defined, the default list of remote apps from native SDK is used.
*/
remoteDesktopApps?: MalwarelyticsAndroidNamedApkItem[];
}
/** Configuration of app the presence of which should be checked. */
export interface MalwarelyticsAndroidNamedApkItem {
/** Defined custom name to be used for the application. */
displayName: String;
/** Package name (application ID) of the app. */
packageName: String;
/** SHA-1 hash of the app's signature. The signature hash is optional. */
signatureHash?: String;
}
/**
* NO_ACTION - do nothing
* NOTIFY - notify via the observer
Expand Down Expand Up @@ -492,6 +558,8 @@ export interface MalwarelyticsAppleRaspConfig {
vpnChanged?: MalwarelyticsAppleDetectionConfig;
/** Call detection. The default value is `NOTIFY`. */
callDetection?: MalwarelyticsAppleSimpleDetectionConfig;
/** App presence detection. 3rd party app presence. The default value is `.manual` with empty array of apps. */
appPresence?: MalwarelyticsAppleAppPresenceDetectionConfig;
}
/** Configuration of the debugger detection behavior */
export interface MalwarelyticsAppleDebuggerDetectionConfig {
Expand Down Expand Up @@ -541,6 +609,13 @@ export interface MalwarelyticsAppleSimpleDetectionConfig {
/** Behavior of the detection */
action: MalwarelyticsAppleSimpleDetectionAction;
}
/** Configuration of the app presence detection behavior */
export interface MalwarelyticsAppleAppPresenceDetectionConfig {
/** Behavior of the detection */
action: MalwarelyticsAppleAppPresenceDetectionAction;
/** Applications that can be detected on the phone if present. */
apps: MalwarelyticsAppleDetectableApp[];
}
/** Configuration of the overlay */
export interface MalwarelyticsAppleOverlay {
type: MalwarelyticsAppleOverlayType;
Expand Down Expand Up @@ -572,6 +647,11 @@ export declare type MalwarelyticsAppleDetectionAction = "NO_ACTION" | "NOTIFY" |
* NOTIFY - notify via the observer
*/
export declare type MalwarelyticsAppleSimpleDetectionAction = "NO_ACTION" | "NOTIFY";
/**
* MANUAL - automatic detection is turned off, you can do a manual check
* NOTIFY - notify via the observer
*/
export declare type MalwarelyticsAppleAppPresenceDetectionAction = "MANUAL" | "NOTIFY";
/**
* DEFAULT - default cover with solid color and application icon
* COLOR - cover with a solid color
Expand All @@ -593,6 +673,20 @@ export interface MalwarelyticsAppleColor {
export interface MalwarelyticsAppleImage {
name: string;
}
/**
* Configuration of application that can be detected on the phone if present.
*/
export interface MalwarelyticsAppleDetectableApp {
deeplinkProtocols: string[];
name: string;
category: MalwarelyticsAppleDetectableAppCategory;
tag?: string;
}
/**
* Category of MalwarelyticsAppleDetectableApp
* REMOTE_DESKTOP - Remote desktop apps are apps that can screen cast phone screen.
*/
export declare type MalwarelyticsAppleDetectableAppCategory = "REMOTE_DESKTOP";
/**
* Malwarelytics configuration.
*/
Expand Down Expand Up @@ -651,7 +745,6 @@ export declare class MalwarelyticsPlugin extends __MPService {
*/
setDeviceId(deviceId: string): Promise<void>;
}
export declare var module: any;
/**
* Information about android apk.
*/
Expand Down Expand Up @@ -781,6 +874,25 @@ export declare enum CallState {
ACTIVE_COMMUNICATION_REDIRECT = "ACTIVE_COMMUNICATION_REDIRECT",
UNKNOWN = "UNKNOWN"
}
/** App presence detection data. */
export interface AppPresenceDetection {
remoteDesktopApps: [NamedApkItemInfo];
}
/** Rasp detection app item. */
export interface NamedApkItemInfo {
/** Display name item as defined in the configuration. */
displayName: string;
/** Obtained application name. */
appName: string;
/** Package name (application ID) of the app. */
packageName: string;
/** Version name. */
versionName: string;
/** Version code. */
versionCode: number;
/** Base64 encoded SHA-1 signature hash. */
signatureHash: string;
}
export interface BiometryDetection {
biometricStatus: BiometricStatus;
androidxLibStatus: number;
Expand Down Expand Up @@ -849,7 +961,8 @@ export declare enum RaspCallbackType {
HTTP_PROXY = "HTTP_PROXY",
VPN = "VPN",
ADB_STATUS = "ADB_STATUS",
ACTIVE_CALL = "ACTIVE_CALL"
ACTIVE_CALL = "ACTIVE_CALL",
APP_PRESENCE = "APP_PRESENCE"
}
export declare enum RepackagingResult {
REPACKAGED_APP = "REPACKAGED_APP",
Expand Down Expand Up @@ -877,6 +990,13 @@ export declare enum RootDetectionProof {
RDP_11 = "RDP_11",
RDP_12 = "RDP_12"
}
/** Screen reader blocking data. */
export interface ScreenReaderDetection {
/** Whether a not allowed screen reader is enabled. */
isNotAllowedScreenReaderEnabled: boolean;
/** Not allowed screen readers that are enabled. Identified by their package names (application IDs). */
notAllowedScreenReaders: [string];
}
export interface ScreenSharingDetection {
numberOfDisplays: number;
isScreenShared: number;
Expand Down

0 comments on commit 199e6ef

Please sign in to comment.