Skip to content

Commit

Permalink
Improve JSDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasKypta committed Mar 20, 2024
1 parent 4df270d commit 7021793
Show file tree
Hide file tree
Showing 12 changed files with 265 additions and 6 deletions.
20 changes: 20 additions & 0 deletions scripts/android/model/rasp/ActiveCallDetection.ts
Original file line number Diff line number Diff line change
@@ -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"
}
1 change: 1 addition & 0 deletions scripts/android/model/rasp/AppPresenceDetection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** App presence detection data. */
interface AppPresenceDetection {
/** Detected remote desktop apps. */
readonly remoteDesktopApps: [NamedApkItemInfo];
}

Expand Down
23 changes: 23 additions & 0 deletions scripts/android/model/rasp/BiometryDetection.ts
Original file line number Diff line number Diff line change
@@ -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"
}
5 changes: 4 additions & 1 deletion scripts/android/model/rasp/DebuggerDetection.ts
Original file line number Diff line number Diff line change
@@ -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];
}

Expand Down
6 changes: 5 additions & 1 deletion scripts/android/model/rasp/EmulatorDetection.ts
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion scripts/android/model/rasp/HttpProxyDetection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion scripts/android/model/rasp/RepackagingResult.ts
Original file line number Diff line number Diff line change
@@ -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"
}
7 changes: 6 additions & 1 deletion scripts/android/model/rasp/RootDetection.ts
Original file line number Diff line number Diff line change
@@ -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;
}

Expand Down
8 changes: 7 additions & 1 deletion scripts/android/model/rasp/TapjackingDetection.ts
Original file line number Diff line number Diff line change
@@ -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];
}
74 changes: 74 additions & 0 deletions www/MalwarelyticsPlugin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand All @@ -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",
Expand All @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -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];
}
Loading

0 comments on commit 7021793

Please sign in to comment.