From 953499807c7d924aae5509665d2c61297bb9ad8c Mon Sep 17 00:00:00 2001 From: Tomas Kypta Date: Wed, 20 Mar 2024 11:23:11 +0100 Subject: [PATCH 1/4] Improve model classes with read-only properties --- scripts/android/model/ApkInfo.ts | 4 +- .../android/model/SmartProtectionResult.ts | 6 +- .../android/model/rasp/ActiveCallDetection.ts | 2 +- .../model/rasp/AppPresenceDetection.ts | 14 +-- .../android/model/rasp/BiometryDetection.ts | 4 +- .../android/model/rasp/DebuggerDetection.ts | 6 +- .../android/model/rasp/EmulatorDetection.ts | 6 +- .../android/model/rasp/HttpProxyDetection.ts | 12 +-- scripts/android/model/rasp/RootDetection.ts | 10 +-- .../model/rasp/ScreenReaderDetection.ts | 8 +- .../model/rasp/ScreenSharingDetection.ts | 14 +-- .../android/model/rasp/TapjackingDetection.ts | 4 +- www/MalwarelyticsPlugin.d.ts | 90 +++++++++---------- www/MalwarelyticsPlugin.module.d.ts | 90 +++++++++---------- 14 files changed, 135 insertions(+), 135 deletions(-) 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..f3d056c 100644 --- a/scripts/android/model/rasp/ActiveCallDetection.ts +++ b/scripts/android/model/rasp/ActiveCallDetection.ts @@ -1,5 +1,5 @@ interface ActiveCallDetection { - callState: CallState; + readonly callState: CallState; } enum CallState { diff --git a/scripts/android/model/rasp/AppPresenceDetection.ts b/scripts/android/model/rasp/AppPresenceDetection.ts index 6f73b21..d8953b2 100644 --- a/scripts/android/model/rasp/AppPresenceDetection.ts +++ b/scripts/android/model/rasp/AppPresenceDetection.ts @@ -1,20 +1,20 @@ /** App presence detection data. */ interface AppPresenceDetection { - remoteDesktopApps: [NamedApkItemInfo]; + 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..a6bc2e5 100644 --- a/scripts/android/model/rasp/BiometryDetection.ts +++ b/scripts/android/model/rasp/BiometryDetection.ts @@ -1,6 +1,6 @@ interface BiometryDetection { - biometricStatus: BiometricStatus; - androidxLibStatus: number; + readonly biometricStatus: BiometricStatus; + readonly androidxLibStatus: number; } enum BiometricStatus { diff --git a/scripts/android/model/rasp/DebuggerDetection.ts b/scripts/android/model/rasp/DebuggerDetection.ts index 873a667..b932b5d 100644 --- a/scripts/android/model/rasp/DebuggerDetection.ts +++ b/scripts/android/model/rasp/DebuggerDetection.ts @@ -1,8 +1,8 @@ interface DebuggerDetection { - isDebuggerAttached: boolean; - isWaitingForDebugger: boolean; - debuggerType: [DebuggerType]; + readonly isDebuggerAttached: boolean; + readonly isWaitingForDebugger: boolean; + readonly debuggerType: [DebuggerType]; } enum DebuggerType { diff --git a/scripts/android/model/rasp/EmulatorDetection.ts b/scripts/android/model/rasp/EmulatorDetection.ts index 8344aa0..50a9612 100644 --- a/scripts/android/model/rasp/EmulatorDetection.ts +++ b/scripts/android/model/rasp/EmulatorDetection.ts @@ -1,8 +1,8 @@ interface EmulatorDetection { - isEmulator: boolean; - detectedEmulatorType?: EmulatorType; - emulatorDetectionProofs: [EmulatorDetectionProof]; + readonly isEmulator: boolean; + readonly detectedEmulatorType?: EmulatorType; + readonly emulatorDetectionProofs: [EmulatorDetectionProof]; } enum EmulatorType { diff --git a/scripts/android/model/rasp/HttpProxyDetection.ts b/scripts/android/model/rasp/HttpProxyDetection.ts index c80ad93..82f0e3d 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; + readonly isHttpProxyEnabled: boolean; - isUsingAutoConfig: boolean; + 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/RootDetection.ts b/scripts/android/model/rasp/RootDetection.ts index e3018e1..6f653eb 100644 --- a/scripts/android/model/rasp/RootDetection.ts +++ b/scripts/android/model/rasp/RootDetection.ts @@ -1,10 +1,10 @@ interface RootDetection { - isRooted: boolean; - isRootCloaked: boolean; - rootDetectionProofs: [RootDetectionProof]; - rootDetectionConfidence: number; - rootCloakDetectionConfidence: number; + readonly isRooted: boolean; + readonly isRootCloaked: boolean; + readonly rootDetectionProofs: [RootDetectionProof]; + readonly rootDetectionConfidence: number; + 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..423558b 100644 --- a/scripts/android/model/rasp/TapjackingDetection.ts +++ b/scripts/android/model/rasp/TapjackingDetection.ts @@ -1,5 +1,5 @@ interface TapjackingDetection { - isTapjackingBlocked: boolean; - tapjackingCapableApps: [string]; + readonly isTapjackingBlocked: boolean; + readonly tapjackingCapableApps: [string]; } \ No newline at end of file diff --git a/www/MalwarelyticsPlugin.d.ts b/www/MalwarelyticsPlugin.d.ts index 72cfb6f..6fc16a2 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. @@ -1001,7 +1001,7 @@ interface UpdateInfoFailure { readonly lastFailureReason?: string; } interface ActiveCallDetection { - callState: CallState; + readonly callState: CallState; } declare enum CallState { IDLE = "IDLE", @@ -1015,26 +1015,26 @@ declare enum CallState { } /** App presence detection data. */ interface AppPresenceDetection { - remoteDesktopApps: [NamedApkItemInfo]; + 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; } interface BiometryDetection { - biometricStatus: BiometricStatus; - androidxLibStatus: number; + readonly biometricStatus: BiometricStatus; + readonly androidxLibStatus: number; } declare enum BiometricStatus { CONFIGURED = "CONFIGURED", @@ -1044,18 +1044,18 @@ declare enum BiometricStatus { NONE_ENROLLED = "NONE_ENROLLED" } interface DebuggerDetection { - isDebuggerAttached: boolean; - isWaitingForDebugger: boolean; - debuggerType: [DebuggerType]; + readonly isDebuggerAttached: boolean; + readonly isWaitingForDebugger: boolean; + readonly debuggerType: [DebuggerType]; } declare enum DebuggerType { JAVA = "JAVA", NATIVE = "NATIVE" } interface EmulatorDetection { - isEmulator: boolean; - detectedEmulatorType?: EmulatorType; - emulatorDetectionProofs: [EmulatorDetectionProof]; + readonly isEmulator: boolean; + readonly detectedEmulatorType?: EmulatorType; + readonly emulatorDetectionProofs: [EmulatorDetectionProof]; } declare enum EmulatorType { AVD = "AVD", @@ -1079,16 +1079,16 @@ declare enum EmulatorDetectionProof { */ interface HttpProxyDetection { /** Whether the proxy data indicate that a proxy is enabled. */ - isHttpProxyEnabled: boolean; - isUsingAutoConfig: boolean; + readonly isHttpProxyEnabled: boolean; + 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", @@ -1110,11 +1110,11 @@ declare enum RepackagingResult { INVALID_CONFIG = "INVALID_CONFIG" } interface RootDetection { - isRooted: boolean; - isRootCloaked: boolean; - rootDetectionProofs: [RootDetectionProof]; - rootDetectionConfidence: number; - rootCloakDetectionConfidence: number; + readonly isRooted: boolean; + readonly isRootCloaked: boolean; + readonly rootDetectionProofs: [RootDetectionProof]; + readonly rootDetectionConfidence: number; + readonly rootCloakDetectionConfidence: number; } declare enum RootDetectionProof { RDP_01 = "RDP_01", @@ -1133,35 +1133,35 @@ 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; } interface TapjackingDetection { - isTapjackingBlocked: boolean; - tapjackingCapableApps: [string]; + readonly isTapjackingBlocked: boolean; + readonly tapjackingCapableApps: [string]; } diff --git a/www/MalwarelyticsPlugin.module.d.ts b/www/MalwarelyticsPlugin.module.d.ts index 4801e20..326f162 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. @@ -1001,7 +1001,7 @@ export interface UpdateInfoFailure { readonly lastFailureReason?: string; } export interface ActiveCallDetection { - callState: CallState; + readonly callState: CallState; } export declare enum CallState { IDLE = "IDLE", @@ -1015,26 +1015,26 @@ export declare enum CallState { } /** App presence detection data. */ export interface AppPresenceDetection { - remoteDesktopApps: [NamedApkItemInfo]; + 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; } export interface BiometryDetection { - biometricStatus: BiometricStatus; - androidxLibStatus: number; + readonly biometricStatus: BiometricStatus; + readonly androidxLibStatus: number; } export declare enum BiometricStatus { CONFIGURED = "CONFIGURED", @@ -1044,18 +1044,18 @@ export declare enum BiometricStatus { NONE_ENROLLED = "NONE_ENROLLED" } export interface DebuggerDetection { - isDebuggerAttached: boolean; - isWaitingForDebugger: boolean; - debuggerType: [DebuggerType]; + readonly isDebuggerAttached: boolean; + readonly isWaitingForDebugger: boolean; + readonly debuggerType: [DebuggerType]; } export declare enum DebuggerType { JAVA = "JAVA", NATIVE = "NATIVE" } export interface EmulatorDetection { - isEmulator: boolean; - detectedEmulatorType?: EmulatorType; - emulatorDetectionProofs: [EmulatorDetectionProof]; + readonly isEmulator: boolean; + readonly detectedEmulatorType?: EmulatorType; + readonly emulatorDetectionProofs: [EmulatorDetectionProof]; } export declare enum EmulatorType { AVD = "AVD", @@ -1079,16 +1079,16 @@ export declare enum EmulatorDetectionProof { */ export interface HttpProxyDetection { /** Whether the proxy data indicate that a proxy is enabled. */ - isHttpProxyEnabled: boolean; - isUsingAutoConfig: boolean; + readonly isHttpProxyEnabled: boolean; + 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", @@ -1110,11 +1110,11 @@ export declare enum RepackagingResult { INVALID_CONFIG = "INVALID_CONFIG" } export interface RootDetection { - isRooted: boolean; - isRootCloaked: boolean; - rootDetectionProofs: [RootDetectionProof]; - rootDetectionConfidence: number; - rootCloakDetectionConfidence: number; + readonly isRooted: boolean; + readonly isRootCloaked: boolean; + readonly rootDetectionProofs: [RootDetectionProof]; + readonly rootDetectionConfidence: number; + readonly rootCloakDetectionConfidence: number; } export declare enum RootDetectionProof { RDP_01 = "RDP_01", @@ -1133,35 +1133,35 @@ 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; } export interface TapjackingDetection { - isTapjackingBlocked: boolean; - tapjackingCapableApps: [string]; + readonly isTapjackingBlocked: boolean; + readonly tapjackingCapableApps: [string]; } From 4df270d27bc96c825c13e172744d4d50ae6d0053 Mon Sep 17 00:00:00 2001 From: Tomas Kypta Date: Wed, 20 Mar 2024 11:24:16 +0100 Subject: [PATCH 2/4] Update release notes --- docs/Release-Notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Release-Notes.md b/docs/Release-Notes.md index ebe0ce9..42fae2e 100644 --- a/docs/Release-Notes.md +++ b/docs/Release-Notes.md @@ -6,6 +6,7 @@ - Update Malwarelytics for Android to 1.1.0 (#87) - Update ApkThreat with flags (#89) +- Improve model classes with read-only properties (#94) ## Previous Releases From 7021793f27feb0abe987cf2810093ce7233e0729 Mon Sep 17 00:00:00 2001 From: Tomas Kypta Date: Wed, 20 Mar 2024 12:08:27 +0100 Subject: [PATCH 3/4] Improve JSDoc --- .../android/model/rasp/ActiveCallDetection.ts | 20 +++++ .../model/rasp/AppPresenceDetection.ts | 1 + .../android/model/rasp/BiometryDetection.ts | 23 ++++++ .../android/model/rasp/DebuggerDetection.ts | 5 +- .../android/model/rasp/EmulatorDetection.ts | 6 +- .../android/model/rasp/HttpProxyDetection.ts | 2 +- .../android/model/rasp/RepackagingResult.ts | 8 +- scripts/android/model/rasp/RootDetection.ts | 7 +- .../android/model/rasp/TapjackingDetection.ts | 8 +- www/MalwarelyticsPlugin.d.ts | 74 +++++++++++++++++++ www/MalwarelyticsPlugin.js | 43 +++++++++++ www/MalwarelyticsPlugin.module.d.ts | 74 +++++++++++++++++++ 12 files changed, 265 insertions(+), 6 deletions(-) diff --git a/scripts/android/model/rasp/ActiveCallDetection.ts b/scripts/android/model/rasp/ActiveCallDetection.ts index f3d056c..f44d18d 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 { + /** 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 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 in progress. + * 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 d8953b2..5b57f77 100644 --- a/scripts/android/model/rasp/AppPresenceDetection.ts +++ b/scripts/android/model/rasp/AppPresenceDetection.ts @@ -1,5 +1,6 @@ /** App presence detection data. */ interface AppPresenceDetection { + /** Detected remote desktop apps. */ readonly remoteDesktopApps: [NamedApkItemInfo]; } diff --git a/scripts/android/model/rasp/BiometryDetection.ts b/scripts/android/model/rasp/BiometryDetection.ts index a6bc2e5..308d68f 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 { + /** Status of the biometry config on the device. */ readonly biometricStatus: BiometricStatus; + /** + * Status of the biometry config on the device, 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 b932b5d..65fc3b5 100644 --- a/scripts/android/model/rasp/DebuggerDetection.ts +++ b/scripts/android/model/rasp/DebuggerDetection.ts @@ -1,7 +1,10 @@ - +/** Debugger detection data. */ interface DebuggerDetection { + /** 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]; } diff --git a/scripts/android/model/rasp/EmulatorDetection.ts b/scripts/android/model/rasp/EmulatorDetection.ts index 50a9612..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 { + /** 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 82f0e3d..38f1b77 100644 --- a/scripts/android/model/rasp/HttpProxyDetection.ts +++ b/scripts/android/model/rasp/HttpProxyDetection.ts @@ -5,7 +5,7 @@ interface HttpProxyDetection { /** Whether the proxy data indicate that a proxy is enabled. */ readonly isHttpProxyEnabled: boolean; - + /** Whether the HTTP proxy is using auto config with a PAC script. */ readonly isUsingAutoConfig: boolean; /** Host of the proxy server or null if proxy is not enabled. */ readonly host?: string; diff --git a/scripts/android/model/rasp/RepackagingResult.ts b/scripts/android/model/rasp/RepackagingResult.ts index fe78ece..5477c49 100644 --- a/scripts/android/model/rasp/RepackagingResult.ts +++ b/scripts/android/model/rasp/RepackagingResult.ts @@ -1,6 +1,12 @@ - +/** 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 6f653eb..dab0b28 100644 --- a/scripts/android/model/rasp/RootDetection.ts +++ b/scripts/android/model/rasp/RootDetection.ts @@ -1,9 +1,14 @@ - +/** Root detection data. */ interface RootDetection { + /** 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; } diff --git a/scripts/android/model/rasp/TapjackingDetection.ts b/scripts/android/model/rasp/TapjackingDetection.ts index 423558b..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 { + /** 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 6fc16a2..e077e8c 100644 --- a/www/MalwarelyticsPlugin.d.ts +++ b/www/MalwarelyticsPlugin.d.ts @@ -1000,21 +1000,42 @@ interface UpdateInfoFailure { /** Reason for the last update failure. */ readonly lastFailureReason?: string; } +/** Active call detection data. */ interface ActiveCallDetection { + /** 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 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 in progress. + * 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 { + /** Detected remote desktop apps. */ readonly remoteDesktopApps: [NamedApkItemInfo]; } /** Rasp detection app item. */ @@ -1032,31 +1053,63 @@ interface NamedApkItemInfo { /** Base64 encoded SHA-1 signature hash. */ readonly signatureHash: string; } +/** Biometry config detection data. */ interface BiometryDetection { + /** Status of the biometry config on the device. */ readonly biometricStatus: BiometricStatus; + /** + * Status of the biometry config on the device, 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 { + /** 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 { + /** 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", @@ -1080,6 +1133,7 @@ declare enum EmulatorDetectionProof { interface HttpProxyDetection { /** Whether the proxy data indicate that a proxy is enabled. */ readonly isHttpProxyEnabled: boolean; + /** Whether the HTTP proxy is using auto config with a PAC script. */ readonly isUsingAutoConfig: boolean; /** Host of the proxy server or null if proxy is not enabled. */ readonly host?: string; @@ -1104,16 +1158,29 @@ declare enum RaspCallbackType { ACTIVE_CALL = "ACTIVE_CALL", APP_PRESENCE = "APP_PRESENCE" } +/** 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 { + /** 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 { @@ -1161,7 +1228,14 @@ interface TransientScreenSharingData { /** Whether a removed display has just been detected. */ readonly displayRemoved: boolean; } +/** Tapjacking detection data. */ interface TapjackingDetection { + /** 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..d530c95 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 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 in progress. + * 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 = {})); +/** 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 326f162..951d438 100644 --- a/www/MalwarelyticsPlugin.module.d.ts +++ b/www/MalwarelyticsPlugin.module.d.ts @@ -1000,21 +1000,42 @@ export interface UpdateInfoFailure { /** Reason for the last update failure. */ readonly lastFailureReason?: string; } +/** Active call detection data. */ export interface ActiveCallDetection { + /** 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 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 in progress. + * 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 { + /** Detected remote desktop apps. */ readonly remoteDesktopApps: [NamedApkItemInfo]; } /** Rasp detection app item. */ @@ -1032,31 +1053,63 @@ export interface NamedApkItemInfo { /** Base64 encoded SHA-1 signature hash. */ readonly signatureHash: string; } +/** Biometry config detection data. */ export interface BiometryDetection { + /** Status of the biometry config on the device. */ readonly biometricStatus: BiometricStatus; + /** + * Status of the biometry config on the device, 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 { + /** 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 { + /** 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", @@ -1080,6 +1133,7 @@ export declare enum EmulatorDetectionProof { export interface HttpProxyDetection { /** Whether the proxy data indicate that a proxy is enabled. */ readonly isHttpProxyEnabled: boolean; + /** Whether the HTTP proxy is using auto config with a PAC script. */ readonly isUsingAutoConfig: boolean; /** Host of the proxy server or null if proxy is not enabled. */ readonly host?: string; @@ -1104,16 +1158,29 @@ export declare enum RaspCallbackType { ACTIVE_CALL = "ACTIVE_CALL", APP_PRESENCE = "APP_PRESENCE" } +/** 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 { + /** 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 { @@ -1161,7 +1228,14 @@ export interface TransientScreenSharingData { /** Whether a removed display has just been detected. */ readonly displayRemoved: boolean; } +/** Tapjacking detection data. */ export interface TapjackingDetection { + /** 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]; } From d1b779191ab341a19b8fca89cfcbaca4e69b9395 Mon Sep 17 00:00:00 2001 From: Tomas Kypta Date: Fri, 22 Mar 2024 09:58:35 +0100 Subject: [PATCH 4/4] Improve JSDoc grammar --- .../android/model/rasp/ActiveCallDetection.ts | 10 +++++----- scripts/android/model/rasp/BiometryDetection.ts | 2 +- scripts/android/model/rasp/HttpProxyDetection.ts | 2 +- scripts/android/model/rasp/RepackagingResult.ts | 2 +- www/MalwarelyticsPlugin.d.ts | 16 ++++++++-------- www/MalwarelyticsPlugin.js | 12 ++++++------ www/MalwarelyticsPlugin.module.d.ts | 16 ++++++++-------- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/scripts/android/model/rasp/ActiveCallDetection.ts b/scripts/android/model/rasp/ActiveCallDetection.ts index f44d18d..1dc7df7 100644 --- a/scripts/android/model/rasp/ActiveCallDetection.ts +++ b/scripts/android/model/rasp/ActiveCallDetection.ts @@ -8,24 +8,24 @@ interface ActiveCallDetection { enum CallState { /** Idle state: not ringing and no call established. */ IDLE = "IDLE", - /** Device is ringing. An incoming is being signaled. */ + /** 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 in progress. - * Call is connected and audio is accessible to call screening applications + * 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. + * 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 + * An audio/video chat or VoIP call is established, * and its audio is being redirected to another device. */ ACTIVE_COMMUNICATION_REDIRECT = "ACTIVE_COMMUNICATION_REDIRECT", diff --git a/scripts/android/model/rasp/BiometryDetection.ts b/scripts/android/model/rasp/BiometryDetection.ts index 308d68f..03177ca 100644 --- a/scripts/android/model/rasp/BiometryDetection.ts +++ b/scripts/android/model/rasp/BiometryDetection.ts @@ -3,7 +3,7 @@ interface BiometryDetection { /** Status of the biometry config on the device. */ readonly biometricStatus: BiometricStatus; /** - * Status of the biometry config on the device, raw value obtained + * Status of the biometry config on the device, the raw value obtained * from 'androidx.biometric.BiometricManager'. */ readonly androidxLibStatus: number; diff --git a/scripts/android/model/rasp/HttpProxyDetection.ts b/scripts/android/model/rasp/HttpProxyDetection.ts index 38f1b77..545ebec 100644 --- a/scripts/android/model/rasp/HttpProxyDetection.ts +++ b/scripts/android/model/rasp/HttpProxyDetection.ts @@ -5,7 +5,7 @@ interface HttpProxyDetection { /** Whether the proxy data indicate that a proxy is enabled. */ readonly isHttpProxyEnabled: boolean; - /** Whether the HTTP proxy is using auto config with a PAC script. */ + /** 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. */ readonly host?: string; diff --git a/scripts/android/model/rasp/RepackagingResult.ts b/scripts/android/model/rasp/RepackagingResult.ts index 5477c49..ee1b026 100644 --- a/scripts/android/model/rasp/RepackagingResult.ts +++ b/scripts/android/model/rasp/RepackagingResult.ts @@ -1,4 +1,4 @@ -/** Result type of repackaging detection. */ +/** The result type of repackaging detection. */ enum RepackagingResult { /** The app is repackaged. */ REPACKAGED_APP = "REPACKAGED_APP", diff --git a/www/MalwarelyticsPlugin.d.ts b/www/MalwarelyticsPlugin.d.ts index e077e8c..f1fbcd6 100644 --- a/www/MalwarelyticsPlugin.d.ts +++ b/www/MalwarelyticsPlugin.d.ts @@ -1009,24 +1009,24 @@ interface ActiveCallDetection { declare enum CallState { /** Idle state: not ringing and no call established. */ IDLE = "IDLE", - /** Device is ringing. An incoming is being signaled. */ + /** 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 in progress. - * Call is connected and audio is accessible to call screening applications + * 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. + * 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 + * An audio/video chat or VoIP call is established, * and its audio is being redirected to another device. */ ACTIVE_COMMUNICATION_REDIRECT = "ACTIVE_COMMUNICATION_REDIRECT", @@ -1058,7 +1058,7 @@ interface BiometryDetection { /** Status of the biometry config on the device. */ readonly biometricStatus: BiometricStatus; /** - * Status of the biometry config on the device, raw value obtained + * Status of the biometry config on the device, the raw value obtained * from 'androidx.biometric.BiometricManager'. */ readonly androidxLibStatus: number; @@ -1133,7 +1133,7 @@ declare enum EmulatorDetectionProof { interface HttpProxyDetection { /** Whether the proxy data indicate that a proxy is enabled. */ readonly isHttpProxyEnabled: boolean; - /** Whether the HTTP proxy is using auto config with a PAC script. */ + /** 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. */ readonly host?: string; @@ -1158,7 +1158,7 @@ declare enum RaspCallbackType { ACTIVE_CALL = "ACTIVE_CALL", APP_PRESENCE = "APP_PRESENCE" } -/** Result type of repackaging detection. */ +/** The result type of repackaging detection. */ declare enum RepackagingResult { /** The app is repackaged. */ REPACKAGED_APP = "REPACKAGED_APP", diff --git a/www/MalwarelyticsPlugin.js b/www/MalwarelyticsPlugin.js index d530c95..d41d801 100644 --- a/www/MalwarelyticsPlugin.js +++ b/www/MalwarelyticsPlugin.js @@ -1107,24 +1107,24 @@ var CallState; (function (CallState) { /** Idle state: not ringing and no call established. */ CallState["IDLE"] = "IDLE"; - /** Device is ringing. An incoming is being signaled. */ + /** 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 in progress. - * Call is connected and audio is accessible to call screening applications + * 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. + * 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 + * 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"; @@ -1196,7 +1196,7 @@ var RaspCallbackType; RaspCallbackType["ACTIVE_CALL"] = "ACTIVE_CALL"; RaspCallbackType["APP_PRESENCE"] = "APP_PRESENCE"; })(RaspCallbackType || (RaspCallbackType = {})); -/** Result type of repackaging detection. */ +/** The result type of repackaging detection. */ var RepackagingResult; (function (RepackagingResult) { /** The app is repackaged. */ diff --git a/www/MalwarelyticsPlugin.module.d.ts b/www/MalwarelyticsPlugin.module.d.ts index 951d438..92342ed 100644 --- a/www/MalwarelyticsPlugin.module.d.ts +++ b/www/MalwarelyticsPlugin.module.d.ts @@ -1009,24 +1009,24 @@ export interface ActiveCallDetection { export declare enum CallState { /** Idle state: not ringing and no call established. */ IDLE = "IDLE", - /** Device is ringing. An incoming is being signaled. */ + /** 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 in progress. - * Call is connected and audio is accessible to call screening applications + * 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. + * 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 + * An audio/video chat or VoIP call is established, * and its audio is being redirected to another device. */ ACTIVE_COMMUNICATION_REDIRECT = "ACTIVE_COMMUNICATION_REDIRECT", @@ -1058,7 +1058,7 @@ export interface BiometryDetection { /** Status of the biometry config on the device. */ readonly biometricStatus: BiometricStatus; /** - * Status of the biometry config on the device, raw value obtained + * Status of the biometry config on the device, the raw value obtained * from 'androidx.biometric.BiometricManager'. */ readonly androidxLibStatus: number; @@ -1133,7 +1133,7 @@ export declare enum EmulatorDetectionProof { export interface HttpProxyDetection { /** Whether the proxy data indicate that a proxy is enabled. */ readonly isHttpProxyEnabled: boolean; - /** Whether the HTTP proxy is using auto config with a PAC script. */ + /** 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. */ readonly host?: string; @@ -1158,7 +1158,7 @@ export declare enum RaspCallbackType { ACTIVE_CALL = "ACTIVE_CALL", APP_PRESENCE = "APP_PRESENCE" } -/** Result type of repackaging detection. */ +/** The result type of repackaging detection. */ export declare enum RepackagingResult { /** The app is repackaged. */ REPACKAGED_APP = "REPACKAGED_APP",