Fix: SSL pinning, root detection, network resilience, and compile errors
SSL pinning (all 4 apps): IOClient import, subdomain-safe domain matching Root detection (all 4 apps): modern Magisk/KernelSU/APatch paths Security checks (rider/driver/admin): PlatformException -> false Rider crud: 60s timeout, 3 retries, exponential backoff, JWT pre-validation Driver crud: exponential backoff for TimeoutException RxInt compile (rider/driver): 10.obs -> RxInt(10) Admin device_info: add missing imports, fix RxInt, add package_info_plus
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
|
||||
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
|
||||
|
||||
// Function to check for common root binaries
|
||||
// Function to check for common root binaries (including Magisk, KernelSU, APatch)
|
||||
bool isRooted()
|
||||
{
|
||||
std::string paths[] = {
|
||||
@@ -29,7 +29,13 @@ bool isRooted()
|
||||
"/system/bin/su",
|
||||
"/system/bin/magisk",
|
||||
"/system/xbin/magisk",
|
||||
"/sbin/magisk"};
|
||||
"/sbin/magisk",
|
||||
"/data/adb/magisk/magiskinit",
|
||||
"/data/adb/magisk/magisk",
|
||||
"/data/adb/magisk.db",
|
||||
"/data/adb/ksu",
|
||||
"/data/adb/apatch",
|
||||
"/data/adb/ap/single"};
|
||||
|
||||
for (const auto &path : paths)
|
||||
{
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
// import 'dart:io';
|
||||
|
||||
// import 'package:device_info_plus/device_info_plus.dart';
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:jailbreak_root_detection/jailbreak_root_detection.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import '../../main.dart';
|
||||
import '../../print.dart';
|
||||
|
||||
class DeviceHelper {
|
||||
static Future<String> getDeviceFingerprint() async {
|
||||
@@ -80,7 +83,7 @@ class SecurityHelper {
|
||||
isTampered = await JailbreakRootDetection.instance.isTampered(bundleId);
|
||||
}
|
||||
} catch (e) {
|
||||
debugPrint("Error during security checks: $e");
|
||||
Log.print("Error during security checks: $e");
|
||||
}
|
||||
|
||||
await box.write('isNotTrust', isNotTrust);
|
||||
@@ -98,7 +101,7 @@ class SecurityHelper {
|
||||
}
|
||||
|
||||
static void _showSecurityWarning() {
|
||||
RxInt secondsRemaining = 10.obs;
|
||||
final secondsRemaining = RxInt(10);
|
||||
|
||||
Get.dialog(
|
||||
CupertinoAlertDialog(
|
||||
@@ -150,90 +153,3 @@ class SecurityHelper {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
// class DeviceInfoPlus {
|
||||
// static List<Map<String, dynamic>> deviceDataList = [];
|
||||
|
||||
// static Future<List<Map<String, dynamic>>> getDeviceInfo() async {
|
||||
// final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
|
||||
|
||||
// try {
|
||||
// if (Platform.isAndroid) {
|
||||
// AndroidDeviceInfo androidInfo = await deviceInfoPlugin.androidInfo;
|
||||
// Map<String, dynamic> deviceData = {
|
||||
// 'platform': 'Android',
|
||||
// 'brand': androidInfo.brand,
|
||||
// 'model': androidInfo.model,
|
||||
// 'androidId': androidInfo.device,
|
||||
// 'versionRelease': androidInfo.version.release,
|
||||
// 'sdkVersion': androidInfo.version.sdkInt,
|
||||
// 'manufacturer': androidInfo.manufacturer,
|
||||
// 'isPhysicalDevice': androidInfo.isPhysicalDevice,
|
||||
// 'serialNumber': androidInfo.serialNumber,
|
||||
// 'fingerprint': androidInfo.fingerprint,
|
||||
// 'type': androidInfo.type,
|
||||
// 'data': androidInfo.data,
|
||||
// 'version': androidInfo.version,
|
||||
// 'tags': androidInfo.tags,
|
||||
// 'display': androidInfo.display,
|
||||
// };
|
||||
// deviceDataList.add(deviceData);
|
||||
// } else if (Platform.isIOS) {
|
||||
// IosDeviceInfo iosInfo = await deviceInfoPlugin.iosInfo;
|
||||
// Map<String, dynamic> deviceData = {
|
||||
// 'brand': 'Apple',
|
||||
// 'model': iosInfo.model,
|
||||
// 'systemName': iosInfo.systemName,
|
||||
// 'systemVersion': iosInfo.systemVersion,
|
||||
// 'utsname': iosInfo.utsname,
|
||||
// 'isPhysicalDevice': iosInfo.isPhysicalDevice,
|
||||
// 'identifierForVendor': iosInfo.identifierForVendor,
|
||||
// 'name': iosInfo.name,
|
||||
// 'localizedModel': iosInfo.localizedModel,
|
||||
// };
|
||||
// deviceDataList.add(deviceData);
|
||||
// } else if (Platform.isMacOS) {
|
||||
// MacOsDeviceInfo macInfo = await deviceInfoPlugin.macOsInfo;
|
||||
// Map<String, dynamic> deviceData = {
|
||||
// 'platform': 'macOS',
|
||||
// 'model': macInfo.model,
|
||||
// 'version': macInfo.systemGUID,
|
||||
// };
|
||||
// deviceDataList.add(deviceData);
|
||||
// } else if (Platform.isWindows) {
|
||||
// WindowsDeviceInfo windowsInfo = await deviceInfoPlugin.windowsInfo;
|
||||
// Map<String, dynamic> deviceData = {
|
||||
// 'platform': 'Windows',
|
||||
// 'manufacturer': windowsInfo.computerName,
|
||||
// 'version': windowsInfo.majorVersion,
|
||||
// 'deviceId': windowsInfo.deviceId,
|
||||
// 'userName': windowsInfo.userName,
|
||||
// 'productName': windowsInfo.productName,
|
||||
// 'installDate': windowsInfo.installDate,
|
||||
// 'productId': windowsInfo.productId,
|
||||
// 'numberOfCores': windowsInfo.numberOfCores,
|
||||
// 'systemMemoryInMegabytes': windowsInfo.systemMemoryInMegabytes,
|
||||
// };
|
||||
// deviceDataList.add(deviceData);
|
||||
// } else if (Platform.isLinux) {
|
||||
// LinuxDeviceInfo linuxInfo = await deviceInfoPlugin.linuxInfo;
|
||||
// Map<String, dynamic> deviceData = {
|
||||
// 'platform': 'Linux',
|
||||
// 'manufacturer': linuxInfo.name,
|
||||
// 'version': linuxInfo.version,
|
||||
// };
|
||||
// deviceDataList.add(deviceData);
|
||||
// }
|
||||
// } catch (e) {
|
||||
// }
|
||||
|
||||
// return deviceDataList;
|
||||
// }
|
||||
|
||||
// // Method to print all device data
|
||||
// static void printDeviceInfo() {
|
||||
// for (Map<String, dynamic> deviceData in deviceDataList) {
|
||||
// 'Version: ${deviceData['version'] ?? deviceData['versionRelease'] ?? 'N/A'}');
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -17,7 +17,10 @@ class SecurityChecks {
|
||||
return result;
|
||||
} on PlatformException catch (e) {
|
||||
print("Failed to check security status: ${e.message}");
|
||||
return true; // Treat platform errors as a compromised device (for safety)
|
||||
return false; // Platform not supported → treat as secure
|
||||
} catch (e) {
|
||||
print("Security check error: $e");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:crypto/crypto.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:http/io_client.dart' as http_io;
|
||||
|
||||
class SslPinning {
|
||||
SslPinning._();
|
||||
@@ -29,13 +30,13 @@ class SslPinning {
|
||||
(X509Certificate cert, String host, int port) {
|
||||
final derHash = base64.encode(sha256.convert(cert.der).bytes);
|
||||
for (final entry in _pins.entries) {
|
||||
if (host.endsWith(entry.key)) {
|
||||
if (host == entry.key || host.endsWith('.${entry.key}')) {
|
||||
if (entry.value.contains(derHash)) return true;
|
||||
}
|
||||
}
|
||||
if (_globalPins.contains(derHash)) return true;
|
||||
return false;
|
||||
};
|
||||
return http.IOClient(httpClient);
|
||||
return http_io.IOClient(httpClient);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import firebase_messaging
|
||||
import flutter_image_compress_macos
|
||||
import flutter_secure_storage_macos
|
||||
import local_auth_darwin
|
||||
import package_info_plus
|
||||
import path_provider_foundation
|
||||
import sqflite_darwin
|
||||
import url_launcher_macos
|
||||
@@ -26,6 +27,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin"))
|
||||
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
|
||||
LocalAuthPlugin.register(with: registry.registrar(forPlugin: "LocalAuthPlugin"))
|
||||
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
|
||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
||||
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||
|
||||
@@ -1,14 +1,4 @@
|
||||
PODS:
|
||||
- AppAuth (1.7.6):
|
||||
- AppAuth/Core (= 1.7.6)
|
||||
- AppAuth/ExternalUserAgent (= 1.7.6)
|
||||
- AppAuth/Core (1.7.6)
|
||||
- AppAuth/ExternalUserAgent (1.7.6):
|
||||
- AppAuth/Core
|
||||
- AppCheckCore (11.2.0):
|
||||
- GoogleUtilities/Environment (~> 8.0)
|
||||
- GoogleUtilities/UserDefaults (~> 8.0)
|
||||
- PromisesObjC (~> 2.4)
|
||||
- device_info_plus (0.0.1):
|
||||
- FlutterMacOS
|
||||
- file_selector_macos (0.0.1):
|
||||
@@ -80,20 +70,9 @@ PODS:
|
||||
- flutter_secure_storage_macos (6.1.3):
|
||||
- FlutterMacOS
|
||||
- FlutterMacOS (1.0.0)
|
||||
- google_sign_in_ios (0.0.1):
|
||||
- AppAuth (>= 1.7.4)
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- GoogleSignIn (~> 8.0)
|
||||
- GTMSessionFetcher (>= 3.4.0)
|
||||
- GoogleDataTransport (10.1.0):
|
||||
- nanopb (~> 3.30910.0)
|
||||
- PromisesObjC (~> 2.4)
|
||||
- GoogleSignIn (8.0.0):
|
||||
- AppAuth (< 2.0, >= 1.7.3)
|
||||
- AppCheckCore (~> 11.0)
|
||||
- GTMAppAuth (< 5.0, >= 4.1.1)
|
||||
- GTMSessionFetcher/Core (~> 3.3)
|
||||
- GoogleUtilities/AppDelegateSwizzler (8.1.0):
|
||||
- GoogleUtilities/Environment
|
||||
- GoogleUtilities/Logger
|
||||
@@ -118,14 +97,6 @@ PODS:
|
||||
- GoogleUtilities/UserDefaults (8.1.0):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Privacy
|
||||
- GTMAppAuth (4.1.1):
|
||||
- AppAuth/Core (~> 1.7)
|
||||
- GTMSessionFetcher/Core (< 4.0, >= 3.3)
|
||||
- GTMSessionFetcher (3.5.0):
|
||||
- GTMSessionFetcher/Full (= 3.5.0)
|
||||
- GTMSessionFetcher/Core (3.5.0)
|
||||
- GTMSessionFetcher/Full (3.5.0):
|
||||
- GTMSessionFetcher/Core
|
||||
- local_auth_darwin (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
@@ -134,6 +105,9 @@ PODS:
|
||||
- nanopb/encode (= 3.30910.0)
|
||||
- nanopb/decode (3.30910.0)
|
||||
- nanopb/encode (3.30910.0)
|
||||
- path_provider_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- PromisesObjC (2.4.0)
|
||||
- PromisesSwift (2.4.0):
|
||||
- PromisesObjC (= 2.4.0)
|
||||
@@ -152,15 +126,13 @@ DEPENDENCIES:
|
||||
- flutter_image_compress_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_image_compress_macos/macos`)
|
||||
- flutter_secure_storage_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos`)
|
||||
- FlutterMacOS (from `Flutter/ephemeral`)
|
||||
- google_sign_in_ios (from `Flutter/ephemeral/.symlinks/plugins/google_sign_in_ios/darwin`)
|
||||
- local_auth_darwin (from `Flutter/ephemeral/.symlinks/plugins/local_auth_darwin/darwin`)
|
||||
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
|
||||
- sqflite_darwin (from `Flutter/ephemeral/.symlinks/plugins/sqflite_darwin/darwin`)
|
||||
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- AppAuth
|
||||
- AppCheckCore
|
||||
- Firebase
|
||||
- FirebaseCore
|
||||
- FirebaseCoreExtension
|
||||
@@ -171,10 +143,7 @@ SPEC REPOS:
|
||||
- FirebaseRemoteConfigInterop
|
||||
- FirebaseSessions
|
||||
- GoogleDataTransport
|
||||
- GoogleSignIn
|
||||
- GoogleUtilities
|
||||
- GTMAppAuth
|
||||
- GTMSessionFetcher
|
||||
- nanopb
|
||||
- PromisesObjC
|
||||
- PromisesSwift
|
||||
@@ -196,20 +165,18 @@ EXTERNAL SOURCES:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos
|
||||
FlutterMacOS:
|
||||
:path: Flutter/ephemeral
|
||||
google_sign_in_ios:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/google_sign_in_ios/darwin
|
||||
local_auth_darwin:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/local_auth_darwin/darwin
|
||||
path_provider_foundation:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
|
||||
sqflite_darwin:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/sqflite_darwin/darwin
|
||||
url_launcher_macos:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
AppAuth: d4f13a8fe0baf391b2108511793e4b479691fb73
|
||||
AppCheckCore: cc8fd0a3a230ddd401f326489c99990b013f0c4f
|
||||
device_info_plus: 4fb280989f669696856f8b129e4a5e3cd6c48f76
|
||||
file_selector_macos: 9e9e068e90ebee155097d00e89ae91edb2374db7
|
||||
file_selector_macos: 6280b52b459ae6c590af5d78fc35c7267a3c4b31
|
||||
Firebase: d99ac19b909cd2c548339c2241ecd0d1599ab02e
|
||||
firebase_core: 7667f880631ae8ad10e3d6567ab7582fe0682326
|
||||
firebase_crashlytics: af8dce4a4f3b2b1556bf51043623060a5fc7eca7
|
||||
@@ -224,19 +191,16 @@ SPEC CHECKSUMS:
|
||||
FirebaseSessions: b9a92c1c51bbb81e78fc3142cda6d925d700f8e7
|
||||
flutter_image_compress_macos: e68daf54bb4bf2144c580fd4d151c949cbf492f0
|
||||
flutter_secure_storage_macos: 7f45e30f838cf2659862a4e4e3ee1c347c2b3b54
|
||||
FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1
|
||||
google_sign_in_ios: b48bb9af78576358a168361173155596c845f0b9
|
||||
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
|
||||
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
|
||||
GoogleSignIn: ce8c89bb9b37fb624b92e7514cc67335d1e277e4
|
||||
GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1
|
||||
GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de
|
||||
GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
|
||||
local_auth_darwin: c3ee6cce0a8d56be34c8ccb66ba31f7f180aaebb
|
||||
local_auth_darwin: d2e8c53ef0c4f43c646462e3415432c4dab3ae19
|
||||
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
|
||||
path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
|
||||
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
||||
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
|
||||
sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
|
||||
url_launcher_macos: f87a979182d112f911de6820aefddaf56ee9fbfd
|
||||
url_launcher_macos: 0fba8ddabfc33ce0a9afe7c5fef5aab3d8d2d673
|
||||
|
||||
PODFILE CHECKSUM: 54d867c82ac51cbd61b565781b9fada492027009
|
||||
|
||||
|
||||
@@ -912,6 +912,22 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
package_info_plus:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: package_info_plus
|
||||
sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.2.0"
|
||||
package_info_plus_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_info_plus_platform_interface
|
||||
sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
path:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
||||
@@ -67,6 +67,7 @@ dependencies:
|
||||
device_info_plus: ^11.5.0
|
||||
flutter_staggered_animations: ^1.1.1
|
||||
jailbreak_root_detection: ^1.1.5
|
||||
package_info_plus: ^4.0.2
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
Reference in New Issue
Block a user