|
1 | 1 | package com.aheaditec.talsec.cordova |
2 | 2 |
|
3 | 3 | import android.content.Context |
| 4 | +import app.talsec.rasp.security.api.SuspiciousAppInfo |
| 5 | +import app.talsec.rasp.security.api.ThreatListener |
4 | 6 | import com.aheaditec.talsec.cordova.dispatchers.ExecutionStateDispatcher |
5 | 7 | import com.aheaditec.talsec.cordova.dispatchers.ThreatDispatcher |
6 | 8 | import com.aheaditec.talsec.cordova.events.RaspExecutionStateEvent |
7 | 9 | import com.aheaditec.talsec.cordova.events.ThreatEvent |
8 | | -import com.aheaditec.talsec_security.security.api.SuspiciousAppInfo |
9 | | -import com.aheaditec.talsec_security.security.api.ThreatListener |
10 | 10 |
|
11 | 11 | internal object TalsecThreatHandler { |
12 | 12 |
|
13 | 13 | private val threatDetected = object : ThreatListener.ThreatDetected() { |
14 | | - override fun onRootDetected() { |
| 14 | + override fun onPrivilegedAccess() { |
15 | 15 | ThreatDispatcher.dispatchThreat(ThreatEvent.PrivilegedAccess) |
16 | 16 | } |
17 | 17 |
|
18 | | - override fun onDebuggerDetected() { |
| 18 | + override fun onDebug() { |
19 | 19 | ThreatDispatcher.dispatchThreat(ThreatEvent.Debug) |
20 | 20 | } |
21 | 21 |
|
22 | | - override fun onEmulatorDetected() { |
| 22 | + override fun onSimulator() { |
23 | 23 | ThreatDispatcher.dispatchThreat(ThreatEvent.Simulator) |
24 | 24 | } |
25 | 25 |
|
26 | | - override fun onTamperDetected() { |
| 26 | + override fun onAppIntegrity() { |
27 | 27 | ThreatDispatcher.dispatchThreat(ThreatEvent.AppIntegrity) |
28 | 28 | } |
29 | 29 |
|
30 | | - override fun onUntrustedInstallationSourceDetected() { |
| 30 | + override fun onUnofficialStore() { |
31 | 31 | ThreatDispatcher.dispatchThreat(ThreatEvent.UnofficialStore) |
32 | 32 | } |
33 | 33 |
|
34 | | - override fun onHookDetected() { |
| 34 | + override fun onHooks() { |
35 | 35 | ThreatDispatcher.dispatchThreat(ThreatEvent.Hooks) |
36 | 36 | } |
37 | 37 |
|
38 | | - override fun onDeviceBindingDetected() { |
| 38 | + override fun onDeviceBinding() { |
39 | 39 | ThreatDispatcher.dispatchThreat(ThreatEvent.DeviceBinding) |
40 | 40 | } |
41 | 41 |
|
42 | | - override fun onObfuscationIssuesDetected() { |
| 42 | + override fun onObfuscationIssues() { |
43 | 43 | ThreatDispatcher.dispatchThreat(ThreatEvent.ObfuscationIssues) |
44 | 44 | } |
45 | 45 |
|
46 | | - override fun onMalwareDetected(suspiciousAppInfos: MutableList<SuspiciousAppInfo>) { |
| 46 | + override fun onMalware(suspiciousAppInfos: MutableList<SuspiciousAppInfo>) { |
47 | 47 | ThreatDispatcher.dispatchMalware(suspiciousAppInfos) |
48 | 48 | } |
49 | 49 |
|
50 | | - override fun onScreenshotDetected() { |
| 50 | + override fun onScreenshot() { |
51 | 51 | ThreatDispatcher.dispatchThreat(ThreatEvent.Screenshot) |
52 | 52 | } |
53 | 53 |
|
54 | | - override fun onScreenRecordingDetected() { |
| 54 | + override fun onScreenRecording() { |
55 | 55 | ThreatDispatcher.dispatchThreat(ThreatEvent.ScreenRecording) |
56 | 56 | } |
57 | 57 |
|
58 | | - override fun onMultiInstanceDetected() { |
| 58 | + override fun onMultiInstance() { |
59 | 59 | ThreatDispatcher.dispatchThreat(ThreatEvent.MultiInstance) |
60 | 60 | } |
61 | 61 |
|
62 | | - override fun onUnsecureWifiDetected() { |
| 62 | + override fun onUnsecureWifi() { |
63 | 63 | ThreatDispatcher.dispatchThreat(ThreatEvent.UnsecureWifi) |
64 | 64 | } |
65 | 65 |
|
66 | | - override fun onTimeSpoofingDetected() { |
| 66 | + override fun onTimeSpoofing() { |
67 | 67 | ThreatDispatcher.dispatchThreat(ThreatEvent.TimeSpoofing) |
68 | 68 | } |
69 | 69 |
|
70 | | - override fun onLocationSpoofingDetected() { |
| 70 | + override fun onLocationSpoofing() { |
71 | 71 | ThreatDispatcher.dispatchThreat(ThreatEvent.LocationSpoofing) |
72 | 72 | } |
73 | 73 |
|
74 | | - override fun onAutomationDetected() { |
| 74 | + override fun onAutomation() { |
75 | 75 | ThreatDispatcher.dispatchThreat(ThreatEvent.Automation) |
76 | 76 | } |
| 77 | + |
| 78 | + override fun onBootloader() { |
| 79 | + ThreatDispatcher.dispatchThreat(ThreatEvent.Bootloader) |
| 80 | + } |
77 | 81 | } |
78 | 82 |
|
79 | 83 | private val deviceState = object : ThreatListener.DeviceState() { |
80 | | - override fun onUnlockedDeviceDetected() { |
| 84 | + override fun onPasscode() { |
81 | 85 | ThreatDispatcher.dispatchThreat(ThreatEvent.Passcode) |
82 | 86 | } |
83 | 87 |
|
84 | | - override fun onHardwareBackedKeystoreNotAvailableDetected() { |
| 88 | + override fun onSecureHardwareNotAvailable() { |
85 | 89 | ThreatDispatcher.dispatchThreat(ThreatEvent.SecureHardwareNotAvailable) |
86 | 90 | } |
87 | 91 |
|
88 | | - override fun onDeveloperModeDetected() { |
| 92 | + override fun onDevMode() { |
89 | 93 | ThreatDispatcher.dispatchThreat(ThreatEvent.DevMode) |
90 | 94 | } |
91 | 95 |
|
92 | | - override fun onADBEnabledDetected() { |
| 96 | + override fun onAdbEnabled() { |
93 | 97 | ThreatDispatcher.dispatchThreat(ThreatEvent.ADBEnabled) |
94 | 98 | } |
95 | 99 |
|
96 | | - override fun onSystemVPNDetected() { |
| 100 | + override fun onSystemVpn() { |
97 | 101 | ThreatDispatcher.dispatchThreat(ThreatEvent.SystemVPN) |
98 | 102 | } |
99 | 103 | } |
|
0 commit comments