diff --git a/docs/Release-Notes.md b/docs/Release-Notes.md index 70e213b..d48179c 100644 --- a/docs/Release-Notes.md +++ b/docs/Release-Notes.md @@ -6,6 +6,7 @@ - Update Malwarelytics for Android to 1.1.1 (#87, #92) - Update ApkThreat with flags (#89) +- Improve model classes with read-only properties (#94) ## Previous Releases diff --git a/scripts/android/model/ApkInfo.ts b/scripts/android/model/ApkInfo.ts index 5c3baee..2052a99 100644 --- a/scripts/android/model/ApkInfo.ts +++ b/scripts/android/model/ApkInfo.ts @@ -6,11 +6,11 @@ interface ApkInfo { /** * Application name as displayed in the system. */ - label: String; + readonly label: String; /** * Base64 encode PNG icon in the original size. * You can use it in html as `` */ - icon?: String; + readonly icon?: String; } \ No newline at end of file diff --git a/scripts/android/model/SmartProtectionResult.ts b/scripts/android/model/SmartProtectionResult.ts index b72eaa3..f676c98 100644 --- a/scripts/android/model/SmartProtectionResult.ts +++ b/scripts/android/model/SmartProtectionResult.ts @@ -6,13 +6,13 @@ interface SmartProtectionResult { /** * Wether was the UI displayed. A UI can be either a threat screen or a notification. */ - uiDisplayed: Boolean; + readonly uiDisplayed: Boolean; /** * Whether data update from server succeeded. */ - onlineUpdateSucceeded: Boolean; + readonly onlineUpdateSucceeded: Boolean; /** * Whether evaluation of threats succeeded. */ - evaluationSucceeded: Boolean; + readonly evaluationSucceeded: Boolean; } \ No newline at end of file diff --git a/scripts/android/model/rasp/ActiveCallDetection.ts b/scripts/android/model/rasp/ActiveCallDetection.ts index 296b899..1dc7df7 100644 --- a/scripts/android/model/rasp/ActiveCallDetection.ts +++ b/scripts/android/model/rasp/ActiveCallDetection.ts @@ -1,14 +1,34 @@ +/** Active call detection data. */ interface ActiveCallDetection { - callState: CallState; + /** State of ongoing call. */ + readonly callState: CallState; } +/** State of ongoing call. */ enum CallState { + /** Idle state: not ringing and no call established. */ IDLE = "IDLE", + /** Device is ringing. An incoming call is being signaled. */ RINGING = "RINGING", + /** In call. A telephony call is established. */ ACTIVE_CALL = "ACTIVE_CALL", + /** In communication. An audio/video chat or VoIP call is established. */ ACTIVE_COMMUNNICATION = "ACTIVE_COMMUNNICATION", + /** + * Call screening is in progress. + * The call is connected, and audio is accessible to call screening applications, + * but other audio use cases are still possible. + */ CALL_SCREENING = "CALL_SCREENING", + /** + * A telephony call is established, and its audio is being redirected to another device. + */ ACTIVE_CALL_REDIRECT = "ACTIVE_CALL_REDIRECT", + /** + * An audio/video chat or VoIP call is established, + * and its audio is being redirected to another device. + */ ACTIVE_COMMUNICATION_REDIRECT = "ACTIVE_COMMUNICATION_REDIRECT", + /** Unknown state. */ UNKNOWN = "UNKNOWN" } \ No newline at end of file diff --git a/scripts/android/model/rasp/AppPresenceDetection.ts b/scripts/android/model/rasp/AppPresenceDetection.ts index 6f73b21..5b57f77 100644 --- a/scripts/android/model/rasp/AppPresenceDetection.ts +++ b/scripts/android/model/rasp/AppPresenceDetection.ts @@ -1,20 +1,21 @@ /** App presence detection data. */ interface AppPresenceDetection { - remoteDesktopApps: [NamedApkItemInfo]; + /** Detected remote desktop apps. */ + readonly remoteDesktopApps: [NamedApkItemInfo]; } /** Rasp detection app item. */ interface NamedApkItemInfo { /** Display name item as defined in the configuration. */ - displayName: string; + readonly displayName: string; /** Obtained application name. */ - appName: string; + readonly appName: string; /** Package name (application ID) of the app. */ - packageName: string; + readonly packageName: string; /** Version name. */ - versionName: string; + readonly versionName: string; /** Version code. */ - versionCode: number; + readonly versionCode: number; /** Base64 encoded SHA-1 signature hash. */ - signatureHash: string; + readonly signatureHash: string; } \ No newline at end of file diff --git a/scripts/android/model/rasp/BiometryDetection.ts b/scripts/android/model/rasp/BiometryDetection.ts index 5c2785f..03177ca 100644 --- a/scripts/android/model/rasp/BiometryDetection.ts +++ b/scripts/android/model/rasp/BiometryDetection.ts @@ -1,12 +1,35 @@ +/** Biometry config detection data. */ interface BiometryDetection { - biometricStatus: BiometricStatus; - androidxLibStatus: number; + /** Status of the biometry config on the device. */ + readonly biometricStatus: BiometricStatus; + /** + * Status of the biometry config on the device, the raw value obtained + * from 'androidx.biometric.BiometricManager'. + */ + readonly androidxLibStatus: number; } enum BiometricStatus { + /** + * Corresponds to 'androidx.biometric.BiometricManager.BIOMETRIC_SUCCESS'. + */ CONFIGURED = "CONFIGURED", + /** + * Corresponds to 'androidx.biometric.BiometricManager.BIOMETRIC_STATUS_UNKNOWN'. + */ UNKNOWN = "UNKNOWN", + /** + * Corresponds to either 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_UNSUPPORTED' + * or 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE'. + */ UNSUPPORTED = "UNSUPPORTED", + /** + * Corresponds to either 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE' + * or 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED'. + */ CURRENTLY_UNAVAILABLE = "CURRENTLY_UNAVAILABLE", + /** + * Corresponds to 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED'. + */ NONE_ENROLLED = "NONE_ENROLLED" } \ No newline at end of file diff --git a/scripts/android/model/rasp/DebuggerDetection.ts b/scripts/android/model/rasp/DebuggerDetection.ts index 873a667..65fc3b5 100644 --- a/scripts/android/model/rasp/DebuggerDetection.ts +++ b/scripts/android/model/rasp/DebuggerDetection.ts @@ -1,8 +1,11 @@ - +/** Debugger detection data. */ interface DebuggerDetection { - isDebuggerAttached: boolean; - isWaitingForDebugger: boolean; - debuggerType: [DebuggerType]; + /** Whether a debugger is attached. */ + readonly isDebuggerAttached: boolean; + /** Whether one or more threads is waiting for a debugger to attach. */ + readonly isWaitingForDebugger: boolean; + /** Type of detected debugger. */ + readonly debuggerType: [DebuggerType]; } enum DebuggerType { diff --git a/scripts/android/model/rasp/EmulatorDetection.ts b/scripts/android/model/rasp/EmulatorDetection.ts index 8344aa0..bc1a5d4 100644 --- a/scripts/android/model/rasp/EmulatorDetection.ts +++ b/scripts/android/model/rasp/EmulatorDetection.ts @@ -1,10 +1,14 @@ - +/** Emulator detection data. */ interface EmulatorDetection { - isEmulator: boolean; - detectedEmulatorType?: EmulatorType; - emulatorDetectionProofs: [EmulatorDetectionProof]; + /** Whether the device is recognized as an emulator. */ + readonly isEmulator: boolean; + /** Type of detected emulator. */ + readonly detectedEmulatorType?: EmulatorType; + /** Some troubleshooting information. */ + readonly emulatorDetectionProofs: [EmulatorDetectionProof]; } +/** Type of the emulator. */ enum EmulatorType { AVD = "AVD", GENYMOTION = "GENYMOTION", diff --git a/scripts/android/model/rasp/HttpProxyDetection.ts b/scripts/android/model/rasp/HttpProxyDetection.ts index c80ad93..545ebec 100644 --- a/scripts/android/model/rasp/HttpProxyDetection.ts +++ b/scripts/android/model/rasp/HttpProxyDetection.ts @@ -4,15 +4,15 @@ */ interface HttpProxyDetection { /** Whether the proxy data indicate that a proxy is enabled. */ - isHttpProxyEnabled: boolean; - - isUsingAutoConfig: boolean; + readonly isHttpProxyEnabled: boolean; + /** Whether the HTTP proxy is using an auto-config with a PAC script. */ + readonly isUsingAutoConfig: boolean; /** Host of the proxy server or null if proxy is not enabled. */ - host?: string; + readonly host?: string; /** Port of the proxy server or null if proxy is not enabled. */ - port?: number; + readonly port?: number; /** Comma separated list of host for which the proxy is ignored or null if there are no excluded hosts. */ - exclusionList?: string; + readonly exclusionList?: string; /** he URL of the current PAC script or null if there is no PAC script. */ - pacFileUrl?: string; + readonly pacFileUrl?: string; } \ No newline at end of file diff --git a/scripts/android/model/rasp/RepackagingResult.ts b/scripts/android/model/rasp/RepackagingResult.ts index fe78ece..ee1b026 100644 --- a/scripts/android/model/rasp/RepackagingResult.ts +++ b/scripts/android/model/rasp/RepackagingResult.ts @@ -1,6 +1,12 @@ - +/** The result type of repackaging detection. */ enum RepackagingResult { + /** The app is repackaged. */ REPACKAGED_APP = "REPACKAGED_APP", + /** The app is original, unaltered. */ ORIGINAL_APP = "ORIGINAL_APP", + /** + * Invalid configuration of repackaging detection. + * Repackaging can't be determined. + */ INVALID_CONFIG = "INVALID_CONFIG" } \ No newline at end of file diff --git a/scripts/android/model/rasp/RootDetection.ts b/scripts/android/model/rasp/RootDetection.ts index e3018e1..dab0b28 100644 --- a/scripts/android/model/rasp/RootDetection.ts +++ b/scripts/android/model/rasp/RootDetection.ts @@ -1,10 +1,15 @@ - +/** Root detection data. */ interface RootDetection { - isRooted: boolean; - isRootCloaked: boolean; - rootDetectionProofs: [RootDetectionProof]; - rootDetectionConfidence: number; - rootCloakDetectionConfidence: number; + /** Whether the device is rooted with a non-zero confidence. */ + readonly isRooted: boolean; + /** Whether there's an attempt to cloak the root. */ + readonly isRootCloaked: boolean; + /** Some troubleshooting information. */ + readonly rootDetectionProofs: [RootDetectionProof]; + /** Confidence of root detection, value from 0.0 to 1.0. */ + readonly rootDetectionConfidence: number; + /** Confidence of root cloak detection, value from 0.0 to 1.0. */ + readonly rootCloakDetectionConfidence: number; } enum RootDetectionProof { diff --git a/scripts/android/model/rasp/ScreenReaderDetection.ts b/scripts/android/model/rasp/ScreenReaderDetection.ts index b9025f2..f5bba29 100644 --- a/scripts/android/model/rasp/ScreenReaderDetection.ts +++ b/scripts/android/model/rasp/ScreenReaderDetection.ts @@ -1,11 +1,11 @@ /** Screen reader blocking data. */ interface ScreenReaderDetection { /** Whether a not allowed screen reader is enabled. */ - isNotAllowedScreenReaderEnabled: boolean; + readonly isNotAllowedScreenReaderEnabled: boolean; /** Not allowed screen readers that are enabled. Identified by their package names (application IDs). */ - notAllowedScreenReaders: [string]; + readonly notAllowedScreenReaders: [string]; /** List of all enabled screen readers on the device. */ - enabledScreenReaders: [string]; + readonly enabledScreenReaders: [string]; /** List of all installed screen readers on the device. */ - installedScreenReaders: [string]; + readonly installedScreenReaders: [string]; } \ No newline at end of file diff --git a/scripts/android/model/rasp/ScreenSharingDetection.ts b/scripts/android/model/rasp/ScreenSharingDetection.ts index 9012c62..550459b 100644 --- a/scripts/android/model/rasp/ScreenSharingDetection.ts +++ b/scripts/android/model/rasp/ScreenSharingDetection.ts @@ -1,21 +1,21 @@ /** Screen sharing detection data. */ interface ScreenSharingDetection { /** Number of detected displays that the content is displayed on. */ - numberOfDisplays: number; + readonly numberOfDisplays: number; /** Whether a device screen is being shared (mirror) elsewhere. */ - isScreenShared: number; + readonly isScreenShared: number; /** Transient data containing information about detected transient changes. */ - transientData: TransientScreenSharingData; + readonly transientData: TransientScreenSharingData; /** Whether the detection result is problematic for the app. */ - isProblematic: boolean; + readonly isProblematic: boolean; /** Whether the detection result indicates a transient change. */ - isTransientChange: boolean; + readonly isTransientChange: boolean; } /** Obtained transient data. */ interface TransientScreenSharingData { /** Whether an added display has just been detected. */ - displayAdded: boolean; + readonly displayAdded: boolean; /** Whether a removed display has just been detected. */ - displayRemoved: boolean; + readonly displayRemoved: boolean; } \ No newline at end of file diff --git a/scripts/android/model/rasp/TapjackingDetection.ts b/scripts/android/model/rasp/TapjackingDetection.ts index f35f6bc..a3e9824 100644 --- a/scripts/android/model/rasp/TapjackingDetection.ts +++ b/scripts/android/model/rasp/TapjackingDetection.ts @@ -1,5 +1,11 @@ - +/** Tapjacking detection data. */ interface TapjackingDetection { - isTapjackingBlocked: boolean; - tapjackingCapableApps: [string]; + /** Whether the SDK is currently blocking tapjacking. */ + readonly isTapjackingBlocked: boolean; + /** + * List of "bad" apps capable of performing tapjacking. + * A bad app is one that has a treat index same or higher + * than @see MalwarelyticsAndroidTapjackingBlockConfig.blockTapjackingSensitivity. + */ + readonly tapjackingCapableApps: [string]; } \ No newline at end of file diff --git a/www/MalwarelyticsPlugin.d.ts b/www/MalwarelyticsPlugin.d.ts index 72cfb6f..f1fbcd6 100644 --- a/www/MalwarelyticsPlugin.d.ts +++ b/www/MalwarelyticsPlugin.d.ts @@ -781,12 +781,12 @@ interface ApkInfo { /** * Application name as displayed in the system. */ - label: String; + readonly label: String; /** * Base64 encode PNG icon in the original size. * You can use it in html as `` */ - icon?: String; + readonly icon?: String; } /** * Result of initialization on Android. @@ -803,15 +803,15 @@ interface SmartProtectionResult { /** * Wether was the UI displayed. A UI can be either a threat screen or a notification. */ - uiDisplayed: Boolean; + readonly uiDisplayed: Boolean; /** * Whether data update from server succeeded. */ - onlineUpdateSucceeded: Boolean; + readonly onlineUpdateSucceeded: Boolean; /** * Whether evaluation of threats succeeded. */ - evaluationSucceeded: Boolean; + readonly evaluationSucceeded: Boolean; } /** * An apk with analyzed threats. @@ -1000,63 +1000,116 @@ interface UpdateInfoFailure { /** Reason for the last update failure. */ readonly lastFailureReason?: string; } +/** Active call detection data. */ interface ActiveCallDetection { - callState: CallState; + /** State of ongoing call. */ + readonly callState: CallState; } +/** State of ongoing call. */ declare enum CallState { + /** Idle state: not ringing and no call established. */ IDLE = "IDLE", + /** Device is ringing. An incoming call is being signaled. */ RINGING = "RINGING", + /** In call. A telephony call is established. */ ACTIVE_CALL = "ACTIVE_CALL", + /** In communication. An audio/video chat or VoIP call is established. */ ACTIVE_COMMUNNICATION = "ACTIVE_COMMUNNICATION", + /** + * Call screening is in progress. + * The call is connected, and audio is accessible to call screening applications, + * but other audio use cases are still possible. + */ CALL_SCREENING = "CALL_SCREENING", + /** + * A telephony call is established, and its audio is being redirected to another device. + */ ACTIVE_CALL_REDIRECT = "ACTIVE_CALL_REDIRECT", + /** + * An audio/video chat or VoIP call is established, + * and its audio is being redirected to another device. + */ ACTIVE_COMMUNICATION_REDIRECT = "ACTIVE_COMMUNICATION_REDIRECT", + /** Unknown state. */ UNKNOWN = "UNKNOWN" } /** App presence detection data. */ interface AppPresenceDetection { - remoteDesktopApps: [NamedApkItemInfo]; + /** Detected remote desktop apps. */ + readonly remoteDesktopApps: [NamedApkItemInfo]; } /** Rasp detection app item. */ interface NamedApkItemInfo { /** Display name item as defined in the configuration. */ - displayName: string; + readonly displayName: string; /** Obtained application name. */ - appName: string; + readonly appName: string; /** Package name (application ID) of the app. */ - packageName: string; + readonly packageName: string; /** Version name. */ - versionName: string; + readonly versionName: string; /** Version code. */ - versionCode: number; + readonly versionCode: number; /** Base64 encoded SHA-1 signature hash. */ - signatureHash: string; + readonly signatureHash: string; } +/** Biometry config detection data. */ interface BiometryDetection { - biometricStatus: BiometricStatus; - androidxLibStatus: number; + /** Status of the biometry config on the device. */ + readonly biometricStatus: BiometricStatus; + /** + * Status of the biometry config on the device, the raw value obtained + * from 'androidx.biometric.BiometricManager'. + */ + readonly androidxLibStatus: number; } declare enum BiometricStatus { + /** + * Corresponds to 'androidx.biometric.BiometricManager.BIOMETRIC_SUCCESS'. + */ CONFIGURED = "CONFIGURED", + /** + * Corresponds to 'androidx.biometric.BiometricManager.BIOMETRIC_STATUS_UNKNOWN'. + */ UNKNOWN = "UNKNOWN", + /** + * Corresponds to either 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_UNSUPPORTED' + * or 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE'. + */ UNSUPPORTED = "UNSUPPORTED", + /** + * Corresponds to either 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE' + * or 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED'. + */ CURRENTLY_UNAVAILABLE = "CURRENTLY_UNAVAILABLE", + /** + * Corresponds to 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED'. + */ NONE_ENROLLED = "NONE_ENROLLED" } +/** Debugger detection data. */ interface DebuggerDetection { - isDebuggerAttached: boolean; - isWaitingForDebugger: boolean; - debuggerType: [DebuggerType]; + /** Whether a debugger is attached. */ + readonly isDebuggerAttached: boolean; + /** Whether one or more threads is waiting for a debugger to attach. */ + readonly isWaitingForDebugger: boolean; + /** Type of detected debugger. */ + readonly debuggerType: [DebuggerType]; } declare enum DebuggerType { JAVA = "JAVA", NATIVE = "NATIVE" } +/** Emulator detection data. */ interface EmulatorDetection { - isEmulator: boolean; - detectedEmulatorType?: EmulatorType; - emulatorDetectionProofs: [EmulatorDetectionProof]; -} + /** Whether the device is recognized as an emulator. */ + readonly isEmulator: boolean; + /** Type of detected emulator. */ + readonly detectedEmulatorType?: EmulatorType; + /** Some troubleshooting information. */ + readonly emulatorDetectionProofs: [EmulatorDetectionProof]; +} +/** Type of the emulator. */ declare enum EmulatorType { AVD = "AVD", GENYMOTION = "GENYMOTION", @@ -1079,16 +1132,17 @@ declare enum EmulatorDetectionProof { */ interface HttpProxyDetection { /** Whether the proxy data indicate that a proxy is enabled. */ - isHttpProxyEnabled: boolean; - isUsingAutoConfig: boolean; + readonly isHttpProxyEnabled: boolean; + /** Whether the HTTP proxy is using an auto-config with a PAC script. */ + readonly isUsingAutoConfig: boolean; /** Host of the proxy server or null if proxy is not enabled. */ - host?: string; + readonly host?: string; /** Port of the proxy server or null if proxy is not enabled. */ - port?: number; + readonly port?: number; /** Comma separated list of host for which the proxy is ignored or null if there are no excluded hosts. */ - exclusionList?: string; + readonly exclusionList?: string; /** he URL of the current PAC script or null if there is no PAC script. */ - pacFileUrl?: string; + readonly pacFileUrl?: string; } declare enum RaspCallbackType { DEBUGGER = "DEBUGGER", @@ -1104,17 +1158,30 @@ declare enum RaspCallbackType { ACTIVE_CALL = "ACTIVE_CALL", APP_PRESENCE = "APP_PRESENCE" } +/** The result type of repackaging detection. */ declare enum RepackagingResult { + /** The app is repackaged. */ REPACKAGED_APP = "REPACKAGED_APP", + /** The app is original, unaltered. */ ORIGINAL_APP = "ORIGINAL_APP", + /** + * Invalid configuration of repackaging detection. + * Repackaging can't be determined. + */ INVALID_CONFIG = "INVALID_CONFIG" } +/** Root detection data. */ interface RootDetection { - isRooted: boolean; - isRootCloaked: boolean; - rootDetectionProofs: [RootDetectionProof]; - rootDetectionConfidence: number; - rootCloakDetectionConfidence: number; + /** Whether the device is rooted with a non-zero confidence. */ + readonly isRooted: boolean; + /** Whether there's an attempt to cloak the root. */ + readonly isRootCloaked: boolean; + /** Some troubleshooting information. */ + readonly rootDetectionProofs: [RootDetectionProof]; + /** Confidence of root detection, value from 0.0 to 1.0. */ + readonly rootDetectionConfidence: number; + /** Confidence of root cloak detection, value from 0.0 to 1.0. */ + readonly rootCloakDetectionConfidence: number; } declare enum RootDetectionProof { RDP_01 = "RDP_01", @@ -1133,35 +1200,42 @@ declare enum RootDetectionProof { /** Screen reader blocking data. */ interface ScreenReaderDetection { /** Whether a not allowed screen reader is enabled. */ - isNotAllowedScreenReaderEnabled: boolean; + readonly isNotAllowedScreenReaderEnabled: boolean; /** Not allowed screen readers that are enabled. Identified by their package names (application IDs). */ - notAllowedScreenReaders: [string]; + readonly notAllowedScreenReaders: [string]; /** List of all enabled screen readers on the device. */ - enabledScreenReaders: [string]; + readonly enabledScreenReaders: [string]; /** List of all installed screen readers on the device. */ - installedScreenReaders: [string]; + readonly installedScreenReaders: [string]; } /** Screen sharing detection data. */ interface ScreenSharingDetection { /** Number of detected displays that the content is displayed on. */ - numberOfDisplays: number; + readonly numberOfDisplays: number; /** Whether a device screen is being shared (mirror) elsewhere. */ - isScreenShared: number; + readonly isScreenShared: number; /** Transient data containing information about detected transient changes. */ - transientData: TransientScreenSharingData; + readonly transientData: TransientScreenSharingData; /** Whether the detection result is problematic for the app. */ - isProblematic: boolean; + readonly isProblematic: boolean; /** Whether the detection result indicates a transient change. */ - isTransientChange: boolean; + readonly isTransientChange: boolean; } /** Obtained transient data. */ interface TransientScreenSharingData { /** Whether an added display has just been detected. */ - displayAdded: boolean; + readonly displayAdded: boolean; /** Whether a removed display has just been detected. */ - displayRemoved: boolean; + readonly displayRemoved: boolean; } +/** Tapjacking detection data. */ interface TapjackingDetection { - isTapjackingBlocked: boolean; - tapjackingCapableApps: [string]; + /** Whether the SDK is currently blocking tapjacking. */ + readonly isTapjackingBlocked: boolean; + /** + * List of "bad" apps capable of performing tapjacking. + * A bad app is one that has a treat index same or higher + * than @see MalwarelyticsAndroidTapjackingBlockConfig.blockTapjackingSensitivity. + */ + readonly tapjackingCapableApps: [string]; } diff --git a/www/MalwarelyticsPlugin.js b/www/MalwarelyticsPlugin.js index 60e53c8..d41d801 100644 --- a/www/MalwarelyticsPlugin.js +++ b/www/MalwarelyticsPlugin.js @@ -1102,23 +1102,58 @@ var UpdateType; /** Updating all apps. */ UpdateType["FULL"] = "FULL"; })(UpdateType || (UpdateType = {})); +/** State of ongoing call. */ var CallState; (function (CallState) { + /** Idle state: not ringing and no call established. */ CallState["IDLE"] = "IDLE"; + /** Device is ringing. An incoming call is being signaled. */ CallState["RINGING"] = "RINGING"; + /** In call. A telephony call is established. */ CallState["ACTIVE_CALL"] = "ACTIVE_CALL"; + /** In communication. An audio/video chat or VoIP call is established. */ CallState["ACTIVE_COMMUNNICATION"] = "ACTIVE_COMMUNNICATION"; + /** + * Call screening is in progress. + * The call is connected, and audio is accessible to call screening applications, + * but other audio use cases are still possible. + */ CallState["CALL_SCREENING"] = "CALL_SCREENING"; + /** + * A telephony call is established, and its audio is being redirected to another device. + */ CallState["ACTIVE_CALL_REDIRECT"] = "ACTIVE_CALL_REDIRECT"; + /** + * An audio/video chat or VoIP call is established, + * and its audio is being redirected to another device. + */ CallState["ACTIVE_COMMUNICATION_REDIRECT"] = "ACTIVE_COMMUNICATION_REDIRECT"; + /** Unknown state. */ CallState["UNKNOWN"] = "UNKNOWN"; })(CallState || (CallState = {})); var BiometricStatus; (function (BiometricStatus) { + /** + * Corresponds to 'androidx.biometric.BiometricManager.BIOMETRIC_SUCCESS'. + */ BiometricStatus["CONFIGURED"] = "CONFIGURED"; + /** + * Corresponds to 'androidx.biometric.BiometricManager.BIOMETRIC_STATUS_UNKNOWN'. + */ BiometricStatus["UNKNOWN"] = "UNKNOWN"; + /** + * Corresponds to either 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_UNSUPPORTED' + * or 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE'. + */ BiometricStatus["UNSUPPORTED"] = "UNSUPPORTED"; + /** + * Corresponds to either 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE' + * or 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED'. + */ BiometricStatus["CURRENTLY_UNAVAILABLE"] = "CURRENTLY_UNAVAILABLE"; + /** + * Corresponds to 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED'. + */ BiometricStatus["NONE_ENROLLED"] = "NONE_ENROLLED"; })(BiometricStatus || (BiometricStatus = {})); var DebuggerType; @@ -1126,6 +1161,7 @@ var DebuggerType; DebuggerType["JAVA"] = "JAVA"; DebuggerType["NATIVE"] = "NATIVE"; })(DebuggerType || (DebuggerType = {})); +/** Type of the emulator. */ var EmulatorType; (function (EmulatorType) { EmulatorType["AVD"] = "AVD"; @@ -1160,10 +1196,17 @@ var RaspCallbackType; RaspCallbackType["ACTIVE_CALL"] = "ACTIVE_CALL"; RaspCallbackType["APP_PRESENCE"] = "APP_PRESENCE"; })(RaspCallbackType || (RaspCallbackType = {})); +/** The result type of repackaging detection. */ var RepackagingResult; (function (RepackagingResult) { + /** The app is repackaged. */ RepackagingResult["REPACKAGED_APP"] = "REPACKAGED_APP"; + /** The app is original, unaltered. */ RepackagingResult["ORIGINAL_APP"] = "ORIGINAL_APP"; + /** + * Invalid configuration of repackaging detection. + * Repackaging can't be determined. + */ RepackagingResult["INVALID_CONFIG"] = "INVALID_CONFIG"; })(RepackagingResult || (RepackagingResult = {})); var RootDetectionProof; diff --git a/www/MalwarelyticsPlugin.module.d.ts b/www/MalwarelyticsPlugin.module.d.ts index 4801e20..92342ed 100644 --- a/www/MalwarelyticsPlugin.module.d.ts +++ b/www/MalwarelyticsPlugin.module.d.ts @@ -781,12 +781,12 @@ export interface ApkInfo { /** * Application name as displayed in the system. */ - label: String; + readonly label: String; /** * Base64 encode PNG icon in the original size. * You can use it in html as `` */ - icon?: String; + readonly icon?: String; } /** * Result of initialization on Android. @@ -803,15 +803,15 @@ export interface SmartProtectionResult { /** * Wether was the UI displayed. A UI can be either a threat screen or a notification. */ - uiDisplayed: Boolean; + readonly uiDisplayed: Boolean; /** * Whether data update from server succeeded. */ - onlineUpdateSucceeded: Boolean; + readonly onlineUpdateSucceeded: Boolean; /** * Whether evaluation of threats succeeded. */ - evaluationSucceeded: Boolean; + readonly evaluationSucceeded: Boolean; } /** * An apk with analyzed threats. @@ -1000,63 +1000,116 @@ export interface UpdateInfoFailure { /** Reason for the last update failure. */ readonly lastFailureReason?: string; } +/** Active call detection data. */ export interface ActiveCallDetection { - callState: CallState; + /** State of ongoing call. */ + readonly callState: CallState; } +/** State of ongoing call. */ export declare enum CallState { + /** Idle state: not ringing and no call established. */ IDLE = "IDLE", + /** Device is ringing. An incoming call is being signaled. */ RINGING = "RINGING", + /** In call. A telephony call is established. */ ACTIVE_CALL = "ACTIVE_CALL", + /** In communication. An audio/video chat or VoIP call is established. */ ACTIVE_COMMUNNICATION = "ACTIVE_COMMUNNICATION", + /** + * Call screening is in progress. + * The call is connected, and audio is accessible to call screening applications, + * but other audio use cases are still possible. + */ CALL_SCREENING = "CALL_SCREENING", + /** + * A telephony call is established, and its audio is being redirected to another device. + */ ACTIVE_CALL_REDIRECT = "ACTIVE_CALL_REDIRECT", + /** + * An audio/video chat or VoIP call is established, + * and its audio is being redirected to another device. + */ ACTIVE_COMMUNICATION_REDIRECT = "ACTIVE_COMMUNICATION_REDIRECT", + /** Unknown state. */ UNKNOWN = "UNKNOWN" } /** App presence detection data. */ export interface AppPresenceDetection { - remoteDesktopApps: [NamedApkItemInfo]; + /** Detected remote desktop apps. */ + readonly remoteDesktopApps: [NamedApkItemInfo]; } /** Rasp detection app item. */ export interface NamedApkItemInfo { /** Display name item as defined in the configuration. */ - displayName: string; + readonly displayName: string; /** Obtained application name. */ - appName: string; + readonly appName: string; /** Package name (application ID) of the app. */ - packageName: string; + readonly packageName: string; /** Version name. */ - versionName: string; + readonly versionName: string; /** Version code. */ - versionCode: number; + readonly versionCode: number; /** Base64 encoded SHA-1 signature hash. */ - signatureHash: string; + readonly signatureHash: string; } +/** Biometry config detection data. */ export interface BiometryDetection { - biometricStatus: BiometricStatus; - androidxLibStatus: number; + /** Status of the biometry config on the device. */ + readonly biometricStatus: BiometricStatus; + /** + * Status of the biometry config on the device, the raw value obtained + * from 'androidx.biometric.BiometricManager'. + */ + readonly androidxLibStatus: number; } export declare enum BiometricStatus { + /** + * Corresponds to 'androidx.biometric.BiometricManager.BIOMETRIC_SUCCESS'. + */ CONFIGURED = "CONFIGURED", + /** + * Corresponds to 'androidx.biometric.BiometricManager.BIOMETRIC_STATUS_UNKNOWN'. + */ UNKNOWN = "UNKNOWN", + /** + * Corresponds to either 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_UNSUPPORTED' + * or 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE'. + */ UNSUPPORTED = "UNSUPPORTED", + /** + * Corresponds to either 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE' + * or 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED'. + */ CURRENTLY_UNAVAILABLE = "CURRENTLY_UNAVAILABLE", + /** + * Corresponds to 'androidx.biometric.BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED'. + */ NONE_ENROLLED = "NONE_ENROLLED" } +/** Debugger detection data. */ export interface DebuggerDetection { - isDebuggerAttached: boolean; - isWaitingForDebugger: boolean; - debuggerType: [DebuggerType]; + /** Whether a debugger is attached. */ + readonly isDebuggerAttached: boolean; + /** Whether one or more threads is waiting for a debugger to attach. */ + readonly isWaitingForDebugger: boolean; + /** Type of detected debugger. */ + readonly debuggerType: [DebuggerType]; } export declare enum DebuggerType { JAVA = "JAVA", NATIVE = "NATIVE" } +/** Emulator detection data. */ export interface EmulatorDetection { - isEmulator: boolean; - detectedEmulatorType?: EmulatorType; - emulatorDetectionProofs: [EmulatorDetectionProof]; -} + /** Whether the device is recognized as an emulator. */ + readonly isEmulator: boolean; + /** Type of detected emulator. */ + readonly detectedEmulatorType?: EmulatorType; + /** Some troubleshooting information. */ + readonly emulatorDetectionProofs: [EmulatorDetectionProof]; +} +/** Type of the emulator. */ export declare enum EmulatorType { AVD = "AVD", GENYMOTION = "GENYMOTION", @@ -1079,16 +1132,17 @@ export declare enum EmulatorDetectionProof { */ export interface HttpProxyDetection { /** Whether the proxy data indicate that a proxy is enabled. */ - isHttpProxyEnabled: boolean; - isUsingAutoConfig: boolean; + readonly isHttpProxyEnabled: boolean; + /** Whether the HTTP proxy is using an auto-config with a PAC script. */ + readonly isUsingAutoConfig: boolean; /** Host of the proxy server or null if proxy is not enabled. */ - host?: string; + readonly host?: string; /** Port of the proxy server or null if proxy is not enabled. */ - port?: number; + readonly port?: number; /** Comma separated list of host for which the proxy is ignored or null if there are no excluded hosts. */ - exclusionList?: string; + readonly exclusionList?: string; /** he URL of the current PAC script or null if there is no PAC script. */ - pacFileUrl?: string; + readonly pacFileUrl?: string; } export declare enum RaspCallbackType { DEBUGGER = "DEBUGGER", @@ -1104,17 +1158,30 @@ export declare enum RaspCallbackType { ACTIVE_CALL = "ACTIVE_CALL", APP_PRESENCE = "APP_PRESENCE" } +/** The result type of repackaging detection. */ export declare enum RepackagingResult { + /** The app is repackaged. */ REPACKAGED_APP = "REPACKAGED_APP", + /** The app is original, unaltered. */ ORIGINAL_APP = "ORIGINAL_APP", + /** + * Invalid configuration of repackaging detection. + * Repackaging can't be determined. + */ INVALID_CONFIG = "INVALID_CONFIG" } +/** Root detection data. */ export interface RootDetection { - isRooted: boolean; - isRootCloaked: boolean; - rootDetectionProofs: [RootDetectionProof]; - rootDetectionConfidence: number; - rootCloakDetectionConfidence: number; + /** Whether the device is rooted with a non-zero confidence. */ + readonly isRooted: boolean; + /** Whether there's an attempt to cloak the root. */ + readonly isRootCloaked: boolean; + /** Some troubleshooting information. */ + readonly rootDetectionProofs: [RootDetectionProof]; + /** Confidence of root detection, value from 0.0 to 1.0. */ + readonly rootDetectionConfidence: number; + /** Confidence of root cloak detection, value from 0.0 to 1.0. */ + readonly rootCloakDetectionConfidence: number; } export declare enum RootDetectionProof { RDP_01 = "RDP_01", @@ -1133,35 +1200,42 @@ export declare enum RootDetectionProof { /** Screen reader blocking data. */ export interface ScreenReaderDetection { /** Whether a not allowed screen reader is enabled. */ - isNotAllowedScreenReaderEnabled: boolean; + readonly isNotAllowedScreenReaderEnabled: boolean; /** Not allowed screen readers that are enabled. Identified by their package names (application IDs). */ - notAllowedScreenReaders: [string]; + readonly notAllowedScreenReaders: [string]; /** List of all enabled screen readers on the device. */ - enabledScreenReaders: [string]; + readonly enabledScreenReaders: [string]; /** List of all installed screen readers on the device. */ - installedScreenReaders: [string]; + readonly installedScreenReaders: [string]; } /** Screen sharing detection data. */ export interface ScreenSharingDetection { /** Number of detected displays that the content is displayed on. */ - numberOfDisplays: number; + readonly numberOfDisplays: number; /** Whether a device screen is being shared (mirror) elsewhere. */ - isScreenShared: number; + readonly isScreenShared: number; /** Transient data containing information about detected transient changes. */ - transientData: TransientScreenSharingData; + readonly transientData: TransientScreenSharingData; /** Whether the detection result is problematic for the app. */ - isProblematic: boolean; + readonly isProblematic: boolean; /** Whether the detection result indicates a transient change. */ - isTransientChange: boolean; + readonly isTransientChange: boolean; } /** Obtained transient data. */ export interface TransientScreenSharingData { /** Whether an added display has just been detected. */ - displayAdded: boolean; + readonly displayAdded: boolean; /** Whether a removed display has just been detected. */ - displayRemoved: boolean; + readonly displayRemoved: boolean; } +/** Tapjacking detection data. */ export interface TapjackingDetection { - isTapjackingBlocked: boolean; - tapjackingCapableApps: [string]; + /** Whether the SDK is currently blocking tapjacking. */ + readonly isTapjackingBlocked: boolean; + /** + * List of "bad" apps capable of performing tapjacking. + * A bad app is one that has a treat index same or higher + * than @see MalwarelyticsAndroidTapjackingBlockConfig.blockTapjackingSensitivity. + */ + readonly tapjackingCapableApps: [string]; }