Skip to content

Commit cbd4363

Browse files
authored
Merge pull request #1899 from EnsembleUI/tempering-detection
added correctlyInstalled property in deviceSecurity action
2 parents a0bd413 + a93b62b commit cbd4363

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

modules/ensemble/lib/action/device_security.dart

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'package:flutter/foundation.dart';
55
import 'package:flutter/material.dart';
66
import 'package:root_jailbreak_sniffer/rjsniffer.dart';
77
import 'package:ensemble_ts_interpreter/invokables/invokable.dart';
8+
import 'package:flutter_security_checker/flutter_security_checker.dart';
89
import 'package:ensemble/framework/event.dart';
910

1011
class DeviceSecurity extends EnsembleAction with Invokable {
@@ -19,7 +20,7 @@ class DeviceSecurity extends EnsembleAction with Invokable {
1920
@override
2021
Future<void> execute(BuildContext context, ScopeManager scopeManager) async {
2122
if (kIsWeb) {
22-
_handleSuccess(context, false, false, false,
23+
_handleSuccess(context, false, false, false,false,
2324
'This information is not available on the web');
2425
return;
2526
}
@@ -29,15 +30,16 @@ class DeviceSecurity extends EnsembleAction with Invokable {
2930
bool isRooted = await Rjsniffer.amICompromised() ?? false;
3031
bool isDebugged = await Rjsniffer.amIDebugged() ?? false;
3132
bool isEmulator = await Rjsniffer.amIEmulator() ?? false;
33+
bool hasCorrectlyInstalled = await FlutterSecurityChecker.hasCorrectlyInstalled;
3234

33-
_handleSuccess(context, isRooted, isDebugged, isEmulator, 'success');
35+
_handleSuccess(context, isRooted, isDebugged, isEmulator, hasCorrectlyInstalled, 'success');
3436
} catch (e) {
3537
_handleError(context, e);
3638
}
3739
}
3840

3941
void _handleSuccess(BuildContext context, bool isRooted, bool isDebugged,
40-
bool isEmulator, String message) {
42+
bool isEmulator, bool hasCorrectlyInstalled, String message) {
4143
if (onSuccess != null) {
4244
ScreenController().executeAction(
4345
context,
@@ -48,6 +50,7 @@ class DeviceSecurity extends EnsembleAction with Invokable {
4850
'debugged': isDebugged,
4951
'rooted': isRooted,
5052
'emulator': isEmulator,
53+
'correctlyInstalled': hasCorrectlyInstalled,
5154
'message': message,
5255
},
5356
),

modules/ensemble/pubspec.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ dependencies:
148148
accordion: ^2.6.0
149149
session_storage: ^0.0.1
150150
connectivity_plus: ^6.1.3
151+
flutter_security_checker: ^3.2.1
151152

152153
dependency_overrides:
153154
http: ^0.13.5

0 commit comments

Comments
 (0)