-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathFreeraspThreatHandler.kt
More file actions
79 lines (58 loc) · 2.06 KB
/
FreeraspThreatHandler.kt
File metadata and controls
79 lines (58 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package com.freeraspreactnative
import com.aheaditec.talsec_security.security.api.SuspiciousAppInfo
import com.aheaditec.talsec_security.security.api.ThreatListener
internal object FreeraspThreatHandler : ThreatListener.ThreatDetected, ThreatListener.DeviceState {
internal var listener: TalsecReactNative? = null
override fun onRootDetected() {
listener?.threatDetected(Threat.PrivilegedAccess)
}
override fun onDebuggerDetected() {
listener?.threatDetected(Threat.Debug)
}
override fun onEmulatorDetected() {
listener?.threatDetected(Threat.Simulator)
}
override fun onTamperDetected() {
listener?.threatDetected(Threat.AppIntegrity)
}
override fun onUntrustedInstallationSourceDetected() {
listener?.threatDetected(Threat.UnofficialStore)
}
override fun onHookDetected() {
listener?.threatDetected(Threat.Hooks)
}
override fun onDeviceBindingDetected() {
listener?.threatDetected(Threat.DeviceBinding)
}
override fun onObfuscationIssuesDetected() {
listener?.threatDetected(Threat.ObfuscationIssues)
}
override fun onMalwareDetected(suspiciousAppInfos: MutableList<SuspiciousAppInfo>?) {
listener?.malwareDetected(suspiciousAppInfos ?: mutableListOf())
}
override fun onUnlockedDeviceDetected() {
listener?.threatDetected(Threat.Passcode)
}
override fun onHardwareBackedKeystoreNotAvailableDetected() {
listener?.threatDetected(Threat.SecureHardwareNotAvailable)
}
override fun onDeveloperModeDetected() {
listener?.threatDetected(Threat.DevMode)
}
override fun onADBEnabledDetected() {
listener?.threatDetected(Threat.ADBEnabled)
}
override fun onSystemVPNDetected() {
listener?.threatDetected(Threat.SystemVPN)
}
override fun onScreenshotDetected() {
listener?.threatDetected(Threat.Screenshot)
}
override fun onScreenRecordingDetected() {
listener?.threatDetected(Threat.ScreenRecording)
}
internal interface TalsecReactNative {
fun threatDetected(threatType: Threat)
fun malwareDetected(suspiciousApps: MutableList<SuspiciousAppInfo>)
}
}