Commit bc0fad7d authored by Leon Tappe's avatar Leon Tappe 🔥
Browse files

add root detection

parent 502813d2
......@@ -106,6 +106,7 @@ enum VerificationErrorType {
expired,
oldseed,
server,
root,
other,
}
......
......@@ -2,7 +2,11 @@ PODS:
- connectivity (0.0.1):
- Flutter
- Reachability
- DTTJailbreakDetection (0.4.0)
- Flutter (1.0.0)
- flutter_jailbreak_detection (1.0.0):
- DTTJailbreakDetection
- Flutter
- MTBBarcodeScanner (5.0.11)
- package_info (0.0.1):
- Flutter
......@@ -20,6 +24,7 @@ PODS:
DEPENDENCIES:
- connectivity (from `.symlinks/plugins/connectivity/ios`)
- Flutter (from `Flutter`)
- flutter_jailbreak_detection (from `.symlinks/plugins/flutter_jailbreak_detection/ios`)
- package_info (from `.symlinks/plugins/package_info/ios`)
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
- qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`)
......@@ -28,6 +33,7 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- DTTJailbreakDetection
- MTBBarcodeScanner
- Reachability
......@@ -36,6 +42,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/connectivity/ios"
Flutter:
:path: Flutter
flutter_jailbreak_detection:
:path: ".symlinks/plugins/flutter_jailbreak_detection/ios"
package_info:
:path: ".symlinks/plugins/package_info/ios"
path_provider_ios:
......@@ -49,7 +57,9 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
DTTJailbreakDetection: 5e356c5badc17995f65a83ed9483f787a0057b71
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
flutter_jailbreak_detection: f6c01e4bc73641c6b69c5112e50301240601abb4
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
path_provider_ios: 7d7ce634493af4477d156294792024ec3485acd5
......
......@@ -269,6 +269,12 @@ class _HomePageState extends State<HomePage> {
),
],
)
else if (_bloc!.error == VerificationErrorType.root)
Text(
'Root/Jailbreak entdeckt. Bitte nutze ein unmodifiziertes Gerät für deinen 3G Nachweis',
style: Theme.of(context).textTheme.headline4,
textAlign: TextAlign.center,
)
else
Text(
'Ein unbekanntes Problem wurde festgestellt',
......
......@@ -4,6 +4,7 @@ import 'dart:io';
import 'package:bloc/bloc.dart';
import 'package:connectivity/connectivity.dart';
import 'package:digital_3g_common/verification_api.dart';
import 'package:flutter_jailbreak_detection/flutter_jailbreak_detection.dart';
import 'package:http/http.dart' as http;
import 'package:logging/logging.dart';
import 'package:path_provider/path_provider.dart';
......@@ -28,7 +29,15 @@ class VerificationBloc extends Bloc<VerificationEvent, VerificationState> {
VerificationBloc(String url) : super(VerificationState.busy) {
_api = VerificationApi(http.Client(), url);
_initVerificationStore().then((_) => _initTicketFile().then((value) => _loadTicket()));
FlutterJailbreakDetection.jailbroken.then((bool jailbroken) {
if (!jailbroken) {
_initVerificationStore().then((_) => _initTicketFile().then((value) => _loadTicket()));
} else {
_log.severe('jailbroken/rooted device detected, VerificationBloc halted');
_error = VerificationErrorType.root;
emit(VerificationState.error);
}
});
}
VerificationApi? get api => _api;
......
......@@ -111,6 +111,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "7.3.3"
flutter_jailbreak_detection:
dependency: "direct main"
description:
name: flutter_jailbreak_detection
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
flutter_lints:
dependency: "direct dev"
description:
......@@ -199,21 +206,21 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
path_provider:
dependency: "direct main"
description:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.7"
version: "2.0.8"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.9"
version: "2.0.11"
path_provider_ios:
dependency: transitive
description:
......@@ -227,28 +234,28 @@ packages:
name: path_provider_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
version: "2.1.5"
path_provider_macos:
dependency: transitive
description:
name: path_provider_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
version: "2.0.5"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
version: "2.0.3"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
version: "2.0.5"
platform:
dependency: transitive
description:
......@@ -262,7 +269,7 @@ packages:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
version: "2.1.2"
process:
dependency: transitive
description:
......@@ -276,7 +283,7 @@ packages:
name: provider
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.1"
version: "6.0.2"
qr_code_scanner:
dependency: "direct main"
description:
......@@ -290,28 +297,28 @@ packages:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.9"
version: "2.0.12"
shared_preferences_android:
dependency: transitive
description:
name: shared_preferences_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.9"
version: "2.0.10"
shared_preferences_ios:
dependency: transitive
description:
name: shared_preferences_ios
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.0.9"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
version: "2.0.4"
shared_preferences_macos:
dependency: transitive
description:
......@@ -332,14 +339,14 @@ packages:
name: shared_preferences_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
version: "2.0.3"
shared_preferences_windows:
dependency: transitive
description:
name: shared_preferences_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
version: "2.0.4"
sky_engine:
dependency: transitive
description: flutter
......@@ -351,7 +358,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.2"
string_scanner:
dependency: transitive
description:
......@@ -379,49 +386,49 @@ packages:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.17"
version: "6.0.18"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.13"
version: "6.0.14"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.13"
version: "6.0.14"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
version: "2.0.3"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
version: "2.0.3"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
version: "2.0.5"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
version: "2.0.6"
url_launcher_windows:
dependency: transitive
description:
......@@ -442,7 +449,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.1"
version: "2.3.8"
xdg_directories:
dependency: transitive
description:
......@@ -451,5 +458,5 @@ packages:
source: hosted
version: "0.2.0"
sdks:
dart: ">=2.14.0 <3.0.0"
dart: ">=2.15.0 <3.0.0"
flutter: ">=2.5.0"
......@@ -20,6 +20,7 @@ dependencies:
flutter_phoenix: ^1.0.0
shared_preferences: ^2.0.8
connectivity: ^3.0.6
flutter_jailbreak_detection: ^1.8.0
dev_dependencies:
flutter_lints: ^1.0.0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment