Skip to content

Commit da17f8a

Browse files
committed
feat: improved hooks detection
Signed-off-by: Denis Dobanda <[email protected]>
1 parent 0cb22bd commit da17f8a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/src/threat_detection_center.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'dart:io';
2+
13
import 'package:flutter_security_toolkit/src/threat_center_api.g.dart';
24

35
/// Use this class to access the methods of detecting security threats
@@ -16,8 +18,10 @@ class ThreatDetectionCenter {
1618
/// libraries.
1719
///
1820
/// Returns true, if any hooks are detected
19-
static Future<bool?> areHooksDetected() {
20-
return _api.areHooksDetected();
21+
static Future<bool?> areHooksDetected() async {
22+
return Socket.connect("127.0.0.1", 27042)
23+
.then((_) => true)
24+
.catchError((_) => _api.areHooksDetected());
2125
}
2226

2327
/// Will check for an environment and return true, if running in simulated /

0 commit comments

Comments
 (0)