capacitor-freerasp 2.2.2 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/CapacitorFreerasp.podspec +5 -1
  3. package/README.md +8 -8
  4. package/android/build.gradle +3 -3
  5. package/android/src/main/java/com/aheaditec/freerasp/FreeraspPlugin.kt +106 -33
  6. package/android/src/main/java/com/aheaditec/freerasp/PluginThreatHandler.kt +121 -0
  7. package/android/src/main/java/com/aheaditec/freerasp/ScreenProtector.kt +24 -2
  8. package/android/src/main/java/com/aheaditec/freerasp/dispatchers/ExecutionStateDispatcher.kt +38 -0
  9. package/android/src/main/java/com/aheaditec/freerasp/dispatchers/ThreatDispatcher.kt +62 -0
  10. package/android/src/main/java/com/aheaditec/freerasp/events/BaseRaspEvent.kt +7 -0
  11. package/android/src/main/java/com/aheaditec/freerasp/events/RaspExecutionStateEvent.kt +22 -0
  12. package/android/src/main/java/com/aheaditec/freerasp/events/ThreatEvent.kt +71 -0
  13. package/android/src/main/java/com/aheaditec/freerasp/interfaces/PluginExecutionStateListener.kt +7 -0
  14. package/android/src/main/java/com/aheaditec/freerasp/interfaces/PluginThreatListener.kt +9 -0
  15. package/android/src/main/java/com/aheaditec/freerasp/models/CapSuspiciousAppInfo.kt +1 -0
  16. package/android/src/main/java/com/aheaditec/freerasp/utils/Extensions.kt +1 -0
  17. package/android/src/main/java/com/aheaditec/freerasp/utils/RandomGenerator.kt +24 -0
  18. package/android/src/main/java/com/aheaditec/freerasp/utils/Utils.kt +3 -5
  19. package/dist/esm/api/listeners/raspExecutionState.d.ts +3 -0
  20. package/dist/esm/api/listeners/raspExecutionState.js +40 -0
  21. package/dist/esm/api/listeners/raspExecutionState.js.map +1 -0
  22. package/dist/esm/api/listeners/threat.d.ts +3 -0
  23. package/dist/esm/api/listeners/threat.js +104 -0
  24. package/dist/esm/api/listeners/threat.js.map +1 -0
  25. package/dist/esm/api/methods/capacitor.d.ts +4 -0
  26. package/dist/esm/api/methods/capacitor.js +11 -0
  27. package/dist/esm/api/methods/capacitor.js.map +1 -0
  28. package/dist/esm/api/methods/native.d.ts +7 -0
  29. package/dist/esm/api/methods/native.js +36 -0
  30. package/dist/esm/api/methods/native.js.map +1 -0
  31. package/dist/esm/api/nativeModules.d.ts +2 -0
  32. package/dist/esm/api/nativeModules.js +3 -0
  33. package/dist/esm/api/nativeModules.js.map +1 -0
  34. package/dist/esm/channels/raspExecutionState.d.ts +3 -0
  35. package/dist/esm/channels/raspExecutionState.js +27 -0
  36. package/dist/esm/channels/raspExecutionState.js.map +1 -0
  37. package/dist/esm/channels/threat.d.ts +3 -0
  38. package/dist/esm/channels/threat.js +34 -0
  39. package/dist/esm/channels/threat.js.map +1 -0
  40. package/dist/esm/index.d.ts +7 -12
  41. package/dist/esm/index.js +7 -158
  42. package/dist/esm/index.js.map +1 -1
  43. package/dist/esm/models/raspExecutionState.d.ts +6 -0
  44. package/dist/esm/models/raspExecutionState.js +10 -0
  45. package/dist/esm/models/raspExecutionState.js.map +1 -0
  46. package/dist/esm/models/threat.d.ts +27 -0
  47. package/dist/esm/{definitions.js → models/threat.js} +9 -3
  48. package/dist/esm/models/threat.js.map +1 -0
  49. package/dist/esm/{definitions.d.ts → types/types.d.ts} +41 -44
  50. package/dist/esm/types/types.js +2 -0
  51. package/dist/esm/types/types.js.map +1 -0
  52. package/dist/esm/utils/malware.d.ts +3 -0
  53. package/dist/esm/utils/malware.js +22 -0
  54. package/dist/esm/utils/malware.js.map +1 -0
  55. package/dist/esm/utils/utils.d.ts +3 -0
  56. package/dist/esm/utils/utils.js +12 -0
  57. package/dist/esm/utils/utils.js.map +1 -0
  58. package/dist/plugin.cjs.js +197 -76
  59. package/dist/plugin.cjs.js.map +1 -1
  60. package/dist/plugin.js +197 -76
  61. package/dist/plugin.js.map +1 -1
  62. package/ios/Plugin/FreeraspPlugin.m +3 -0
  63. package/ios/Plugin/FreeraspPlugin.swift +36 -77
  64. package/ios/Plugin/Info.plist +1 -1
  65. package/ios/Plugin/TalsecRuntime.xcframework/_CodeSignature/CodeDirectory +0 -0
  66. package/ios/Plugin/TalsecRuntime.xcframework/_CodeSignature/CodeResources +100 -298
  67. package/ios/Plugin/TalsecRuntime.xcframework/_CodeSignature/CodeSignature +0 -0
  68. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
  69. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +7 -2
  70. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +380 -281
  71. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +5 -6
  72. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +4 -4
  73. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/header.h +1 -1
  74. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +11 -4
  75. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +62 -22
  76. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +2 -2
  77. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +76 -164
  78. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/typecheck-gcc.h +947 -0
  79. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +5 -4
  80. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/websockets.h +17 -3
  81. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
  82. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.abi.json +233 -528
  83. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.private.swiftinterface +7 -3
  84. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  85. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +7 -3
  86. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
  87. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
  88. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +14 -4
  89. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +380 -281
  90. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +5 -6
  91. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +4 -4
  92. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/header.h +1 -1
  93. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +11 -4
  94. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +62 -22
  95. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +2 -2
  96. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +76 -164
  97. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/typecheck-gcc.h +947 -0
  98. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +5 -4
  99. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/websockets.h +17 -3
  100. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
  101. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.abi.json +233 -528
  102. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +7 -3
  103. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  104. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +7 -3
  105. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.abi.json +233 -528
  106. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +7 -3
  107. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  108. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +7 -3
  109. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
  110. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +56 -45
  111. package/ios/Plugin/dispatchers/ExecutionStateDispatcher.swift +35 -0
  112. package/ios/Plugin/dispatchers/ThreatDispatcher.swift +36 -0
  113. package/ios/Plugin/models/RaspExecutionStates.swift +15 -0
  114. package/ios/Plugin/models/SecurityThreat.swift +40 -0
  115. package/ios/Plugin/utils/EventIdentifiers.swift +17 -0
  116. package/ios/Plugin/utils/RandomGenerator.swift +23 -0
  117. package/ios/Plugin/utils/Utils.swift +32 -0
  118. package/package.json +15 -10
  119. package/android/src/main/java/com/aheaditec/freerasp/Threat.kt +0 -58
  120. package/android/src/main/java/com/aheaditec/freerasp/ThreatHandler.kt +0 -76
  121. package/dist/esm/definitions.js.map +0 -1
  122. package/dist/esm/utils.d.ts +0 -2
  123. package/dist/esm/utils.js +0 -8
  124. package/dist/esm/utils.js.map +0 -1
  125. package/ios/Plugin/TalsecRuntime.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
@@ -1,58 +0,0 @@
1
- package com.aheaditec.freerasp
2
-
3
- import org.json.JSONArray
4
-
5
- /**
6
- * Sealed class to represent the error codes.
7
- *
8
- * Sealed classes are used because of obfuscation - enums classes are not obfuscated well enough.
9
- *
10
- * @property value integer value of the error code.
11
- */
12
- internal sealed class Threat(val value: Int) {
13
- object AppIntegrity : Threat((10000..999999999).random())
14
- object PrivilegedAccess : Threat((10000..999999999).random())
15
- object Debug : Threat((10000..999999999).random())
16
- object Hooks : Threat((10000..999999999).random())
17
- object Passcode : Threat((10000..999999999).random())
18
- object Simulator : Threat((10000..999999999).random())
19
- object SecureHardwareNotAvailable : Threat((10000..999999999).random())
20
- object DeviceBinding : Threat((10000..999999999).random())
21
- object UnofficialStore : Threat((10000..999999999).random())
22
- object Overlay : Threat((10000..999999999).random())
23
- object ObfuscationIssues : Threat((10000..999999999).random())
24
- object SystemVPN : Threat((10000..999999999).random())
25
- object DevMode : Threat((10000..999999999).random())
26
- object Malware : Threat((10000..999999999).random())
27
- object ADBEnabled : Threat((10000..999999999).random())
28
- object Screenshot : Threat((10000..999999999).random())
29
- object ScreenRecording : Threat((10000..999999999).random())
30
- object MultiInstance : Threat((10000..999999999).random())
31
-
32
- companion object {
33
- internal fun getThreatValues(): JSONArray {
34
- return JSONArray(
35
- (listOf(
36
- AppIntegrity.value,
37
- PrivilegedAccess.value,
38
- Debug.value,
39
- Hooks.value,
40
- Passcode.value,
41
- Simulator.value,
42
- SecureHardwareNotAvailable.value,
43
- SystemVPN.value,
44
- DeviceBinding.value,
45
- UnofficialStore.value,
46
- Overlay.value,
47
- ObfuscationIssues.value,
48
- DevMode.value,
49
- Malware.value,
50
- ADBEnabled.value,
51
- Screenshot.value,
52
- ScreenRecording.value,
53
- MultiInstance.value
54
- ))
55
- )
56
- }
57
- }
58
- }
@@ -1,76 +0,0 @@
1
- package com.aheaditec.freerasp
2
-
3
- import com.aheaditec.talsec_security.security.api.SuspiciousAppInfo
4
- import com.aheaditec.talsec_security.security.api.ThreatListener
5
-
6
- internal class TalsecThreatHandler(private val instance: FreeraspPlugin) :
7
- ThreatListener.ThreatDetected, ThreatListener.DeviceState {
8
-
9
- override fun onRootDetected() {
10
- instance.notifyListeners(Threat.PrivilegedAccess)
11
- }
12
-
13
- override fun onDebuggerDetected() {
14
- instance.notifyListeners(Threat.Debug)
15
- }
16
-
17
- override fun onEmulatorDetected() {
18
- instance.notifyListeners(Threat.Simulator)
19
- }
20
-
21
- override fun onTamperDetected() {
22
- instance.notifyListeners(Threat.AppIntegrity)
23
- }
24
-
25
- override fun onUntrustedInstallationSourceDetected() {
26
- instance.notifyListeners(Threat.UnofficialStore)
27
- }
28
-
29
- override fun onHookDetected() {
30
- instance.notifyListeners(Threat.Hooks)
31
- }
32
-
33
- override fun onDeviceBindingDetected() {
34
- instance.notifyListeners(Threat.DeviceBinding)
35
- }
36
-
37
- override fun onObfuscationIssuesDetected() {
38
- instance.notifyListeners(Threat.ObfuscationIssues)
39
- }
40
-
41
- override fun onMalwareDetected(suspiciousAppInfos: MutableList<SuspiciousAppInfo>?) {
42
- instance.notifyMalware(suspiciousAppInfos ?: mutableListOf())
43
- }
44
-
45
- override fun onUnlockedDeviceDetected() {
46
- instance.notifyListeners(Threat.Passcode)
47
- }
48
-
49
- override fun onHardwareBackedKeystoreNotAvailableDetected() {
50
- instance.notifyListeners(Threat.SecureHardwareNotAvailable)
51
- }
52
-
53
- override fun onDeveloperModeDetected() {
54
- instance.notifyListeners(Threat.DevMode)
55
- }
56
-
57
- override fun onADBEnabledDetected() {
58
- instance.notifyListeners(Threat.ADBEnabled)
59
- }
60
-
61
- override fun onSystemVPNDetected() {
62
- instance.notifyListeners(Threat.SystemVPN)
63
- }
64
-
65
- override fun onScreenshotDetected() {
66
- instance.notifyListeners(Threat.Screenshot)
67
- }
68
-
69
- override fun onScreenRecordingDetected() {
70
- instance.notifyListeners(Threat.ScreenRecording)
71
- }
72
-
73
- override fun onMultiInstanceDetected() {
74
- instance.notifyListeners(Threat.MultiInstance)
75
- }
76
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAiF5C,MAAM,OAAO,MAAM;IAuBjB,YAAY,KAAa;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,MAAM,CAAC,SAAS;QACd,OAAO,SAAS,CAAC,WAAW,EAAE,KAAK,SAAS;YAC1C,CAAC,CAAC;gBACE,IAAI,CAAC,YAAY;gBACjB,IAAI,CAAC,gBAAgB;gBACrB,IAAI,CAAC,KAAK;gBACV,IAAI,CAAC,KAAK;gBACV,IAAI,CAAC,QAAQ;gBACb,IAAI,CAAC,SAAS;gBACd,IAAI,CAAC,0BAA0B;gBAC/B,IAAI,CAAC,SAAS;gBACd,IAAI,CAAC,aAAa;gBAClB,IAAI,CAAC,eAAe;gBACpB,IAAI,CAAC,OAAO;gBACZ,IAAI,CAAC,iBAAiB;gBACtB,IAAI,CAAC,OAAO;gBACZ,IAAI,CAAC,OAAO;gBACZ,IAAI,CAAC,UAAU;gBACf,IAAI,CAAC,UAAU;gBACf,IAAI,CAAC,eAAe;gBACpB,IAAI,CAAC,aAAa;aACnB;YACH,CAAC,CAAC;gBACE,IAAI,CAAC,YAAY;gBACjB,IAAI,CAAC,gBAAgB;gBACrB,IAAI,CAAC,KAAK;gBACV,IAAI,CAAC,KAAK;gBACV,IAAI,CAAC,QAAQ;gBACb,IAAI,CAAC,SAAS;gBACd,IAAI,CAAC,0BAA0B;gBAC/B,IAAI,CAAC,SAAS;gBACd,IAAI,CAAC,aAAa;gBAClB,IAAI,CAAC,QAAQ;gBACb,IAAI,CAAC,eAAe;gBACpB,IAAI,CAAC,UAAU;gBACf,IAAI,CAAC,eAAe;aACrB,CAAC;IACR,CAAC;;AA7DM,mBAAY,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AAC7B,uBAAgB,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AACjC,YAAK,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,YAAK,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,eAAQ,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AACzB,gBAAS,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AAC1B,iCAA0B,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AAC3C,gBAAS,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AAC1B,oBAAa,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AAC9B,eAAQ,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AACzB,sBAAe,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AAChC,cAAO,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AACxB,wBAAiB,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AAClC,cAAO,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AACxB,cAAO,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AACxB,iBAAU,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AAC3B,iBAAU,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AAC3B,sBAAe,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AAChC,oBAAa,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC","sourcesContent":["import { Capacitor } from '@capacitor/core';\n\nexport interface FreeraspPlugin {\n addListener(listener: string, callback: (event: any) => void): any;\n talsecStart(options: {\n config: FreeraspConfig;\n }): Promise<{ started: boolean }>;\n onInvalidCallback(): void;\n getThreatIdentifiers(): Promise<{ ids: number[] }>;\n getThreatChannelData(): Promise<{ ids: [string, string, string] }>;\n addToWhitelist(options: {\n packageName: string;\n }): Promise<{ result: boolean }>;\n getAppIcon(options: { packageName: string }): Promise<{ result: string }>;\n blockScreenCapture(options: {\n enable: boolean;\n }): Promise<{ result: boolean }>;\n isScreenCaptureBlocked(): Promise<{ result: boolean }>;\n storeExternalId(options: { data: string }): Promise<{ result: boolean }>;\n}\n\nexport type FreeraspConfig = {\n androidConfig?: AndroidConfig;\n iosConfig?: IOSConfig;\n watcherMail: string;\n isProd?: boolean;\n};\n\nexport type AndroidConfig = {\n packageName: string;\n certificateHashes: string[];\n supportedAlternativeStores?: string[];\n malwareConfig?: MalwareConfig;\n};\n\nexport type IOSConfig = {\n appBundleId: string;\n appTeamId: string;\n};\n\nexport type MalwareConfig = {\n blacklistedHashes?: string[];\n blacklistedPackageNames?: string[];\n suspiciousPermissions?: string[][];\n whitelistedInstallationSources?: string[];\n};\n\nexport type SuspiciousAppInfo = {\n packageInfo: PackageInfo;\n reason: string;\n};\n\nexport type PackageInfo = {\n packageName: string;\n appName?: string;\n version?: string;\n appIcon?: string;\n installerStore?: string;\n};\n\nexport type NativeEventEmitterActions = {\n privilegedAccess?: () => any;\n debug?: () => any;\n simulator?: () => any;\n appIntegrity?: () => any;\n unofficialStore?: () => any;\n hooks?: () => any;\n deviceBinding?: () => any;\n deviceID?: () => any;\n passcode?: () => any;\n secureHardwareNotAvailable?: () => any;\n obfuscationIssues?: () => any;\n devMode?: () => any;\n systemVPN?: () => any;\n malware?: (suspiciousApps: SuspiciousAppInfo[]) => any;\n adbEnabled?: () => any;\n screenshot?: () => any;\n screenRecording?: () => any;\n multiInstance?: () => any;\n};\n\nexport class Threat {\n value: number;\n\n static AppIntegrity = new Threat(0);\n static PrivilegedAccess = new Threat(0);\n static Debug = new Threat(0);\n static Hooks = new Threat(0);\n static Passcode = new Threat(0);\n static Simulator = new Threat(0);\n static SecureHardwareNotAvailable = new Threat(0);\n static SystemVPN = new Threat(0);\n static DeviceBinding = new Threat(0);\n static DeviceID = new Threat(0);\n static UnofficialStore = new Threat(0);\n static Overlay = new Threat(0);\n static ObfuscationIssues = new Threat(0);\n static DevMode = new Threat(0);\n static Malware = new Threat(0);\n static ADBEnabled = new Threat(0);\n static Screenshot = new Threat(0);\n static ScreenRecording = new Threat(0);\n static MultiInstance = new Threat(0);\n\n constructor(value: number) {\n this.value = value;\n }\n\n static getValues(): Threat[] {\n return Capacitor.getPlatform() === 'android'\n ? [\n this.AppIntegrity,\n this.PrivilegedAccess,\n this.Debug,\n this.Hooks,\n this.Passcode,\n this.Simulator,\n this.SecureHardwareNotAvailable,\n this.SystemVPN,\n this.DeviceBinding,\n this.UnofficialStore,\n this.Overlay,\n this.ObfuscationIssues,\n this.DevMode,\n this.Malware,\n this.ADBEnabled,\n this.Screenshot,\n this.ScreenRecording,\n this.MultiInstance,\n ]\n : [\n this.AppIntegrity,\n this.PrivilegedAccess,\n this.Debug,\n this.Hooks,\n this.Passcode,\n this.Simulator,\n this.SecureHardwareNotAvailable,\n this.SystemVPN,\n this.DeviceBinding,\n this.DeviceID,\n this.UnofficialStore,\n this.Screenshot,\n this.ScreenRecording,\n ];\n }\n}\n"]}
@@ -1,2 +0,0 @@
1
- export declare const getThreatCount: () => number;
2
- export declare const itemsHaveType: (data: any[], desiredType: string) => boolean;
package/dist/esm/utils.js DELETED
@@ -1,8 +0,0 @@
1
- import { Threat } from './definitions';
2
- export const getThreatCount = () => {
3
- return Threat.getValues().length;
4
- };
5
- export const itemsHaveType = (data, desiredType) => {
6
- return data.every(item => typeof item === desiredType);
7
- };
8
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAW,EAAE;IACzC,OAAO,MAAM,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAW,EAAE,WAAmB,EAAW,EAAE;IACzE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC;AACzD,CAAC,CAAC","sourcesContent":["import { Threat } from './definitions';\n\nexport const getThreatCount = (): number => {\n return Threat.getValues().length;\n};\n\nexport const itemsHaveType = (data: any[], desiredType: string): boolean => {\n return data.every(item => typeof item === desiredType);\n};\n"]}