2026-02-19

This commit is contained in:
Hamza-Ayed
2026-02-19 00:33:43 +03:00
parent 38f7abcd59
commit 0b826f6e01
15 changed files with 57 additions and 52 deletions

View File

@@ -42,15 +42,17 @@ android {
// Merged the two defaultConfig sections into one. This is the correct way. // Merged the two defaultConfig sections into one. This is the correct way.
defaultConfig { defaultConfig {
applicationId = "com.intaleq_driver" applicationId = "com.intaleq_driver"
minSdkVersion = 23 minSdkVersion = flutter.minSdkVersion
targetSdk = 36 targetSdk = 36
versionCode = 57 versionCode = 59
versionName = '1.1.57' // I've used the higher version name versionName = '1.1.59' // I've used the higher version name
multiDexEnabled = true multiDexEnabled = true
ndk { ndk {
abiFilters "armeabi-v7a", "arm64-v8a" // Keep these! abiFilters "armeabi-v7a", "arm64-v8a" // Keep these!
} }
manifestPlaceholders += [mapsApiKey: keystoreProperties['mapsApiKey'] ?: ""]
} }
signingConfigs { signingConfigs {

View File

@@ -46,7 +46,9 @@
android:name="io.flutter.embedding.android.BackgroundExecutor.DART_LIBRARY_URI" android:name="io.flutter.embedding.android.BackgroundExecutor.DART_LIBRARY_URI"
android:value="main.dart" /> --> android:value="main.dart" /> -->
<!-- خرائط + إشعارات فFirebase (قناة افتراضية) --> <!-- خرائط + إشعارات فFirebase (قناة افتراضية) -->
<meta-data android:name="com.google.android.geo.API_KEY" android:value="@string/api_key" /> <meta-data
android:name="com.google.android.geo.API_KEY"
android:value="${mapsApiKey}" />
<meta-data android:name="com.google.firebase.messaging.default_notification_channel_id" <meta-data android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id" /> android:value="@string/default_notification_channel_id" />
<meta-data android:name="io.flutter.embedding.android.EnableImpeller" android:value="false" /> <meta-data android:name="io.flutter.embedding.android.EnableImpeller" android:value="false" />

View File

@@ -3,9 +3,9 @@
<!-- <string name="default_notification_channel_id">ride_channel</string> --> <!-- <string name="default_notification_channel_id">ride_channel</string> -->
<!-- <string name="default_notification_channel_id">default_channel</string> --> <!-- <string name="default_notification_channel_id">default_channel</string> -->
<string name="default_notification_channel_id">high_importance_channel</string> <string name="default_notification_channel_id">high_importance_channel</string>
<string name="api_key">AIzaSyACAeqD8qnNYwHKj1qRec6F3AKzdo__CiQ</string> <string name="api_key">e</string>
<string name="security_warning_title">Security Warning</string> <string name="security_warning_title">Security Warning</string>
<string name="api_key_safety">AIzaSyB04YNW3LbvmQ5lX1t2bOwEU18-KUoovzw</string> <string name="api_key_safety">AIzaSyB04YNW3LbvmQ5lX1t2bOwEU18-</string>
<string name="label">Intaleq Driver</string> <string name="label">Intaleq Driver</string>
<string name="security_warning_message">A security issue or modification has been detected on <string name="security_warning_message">A security issue or modification has been detected on

View File

@@ -1,24 +1,5 @@
// allprojects {
// repositories {
// google()
// mavenCentral()
// }
// }
// rootProject.buildDir = "../build"
// subprojects {
// project.buildDir = "${rootProject.buildDir}/${project.name}"
// }
// subprojects {
// project.evaluationDependsOn(":app")
// }
// tasks.register("clean", Delete) {
// delete rootProject.buildDir
// }
buildscript { buildscript {
ext.kotlin_version = '1.9.23' ext.kotlin_version = '2.1.0'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()

View File

@@ -13,6 +13,7 @@ class BoxName {
static const String FCM_PRIVATE_KEY = "FCM_PRIVATE_KEY"; static const String FCM_PRIVATE_KEY = "FCM_PRIVATE_KEY";
static const String hmac = "hmac"; static const String hmac = "hmac";
static const String ttsEnabled = "ttsEnabled"; static const String ttsEnabled = "ttsEnabled";
static const String security_check = "security_check";
static const String rideType = "rideType"; static const String rideType = "rideType";
static const String walletType = "walletType"; static const String walletType = "walletType";
static const String fingerPrint = "fingerPrint"; static const String fingerPrint = "fingerPrint";

View File

@@ -128,13 +128,11 @@ class LoginDriverController extends GetxController {
var dev = ''; var dev = '';
getJwtWallet() async { getJwtWallet() async {
final random = Random(); if (box.read(BoxName.security_check).toString() != 'passed') {
Log.print('Security check failed');
if (random.nextBool()) { return;
await SecurityHelper.performSecurityChecks();
} else {
await SecurityChecks.isDeviceRootedFromNative(Get.context!);
} }
Log.print('Security check passed');
String fingerPrint = await DeviceHelper.getDeviceFingerprint(); String fingerPrint = await DeviceHelper.getDeviceFingerprint();
// print('fingerPrint: ${fingerPrint}'); // print('fingerPrint: ${fingerPrint}');
dev = Platform.isAndroid ? 'android' : 'ios'; dev = Platform.isAndroid ? 'android' : 'ios';

View File

@@ -35,14 +35,14 @@ Future<void> showDriverGiftClaim(BuildContext context) async {
if (box.read(BoxName.is_claimed).toString() == '0' || if (box.read(BoxName.is_claimed).toString() == '0' ||
box.read(BoxName.is_claimed) == null) { box.read(BoxName.is_claimed) == null) {
MyDialog().getDialog( MyDialog().getDialog(
'You have gift 30000 SYP'.tr, 'This for new registration'.tr, () async { 'You have gift 300 SYP'.tr, 'This for new registration'.tr, () async {
Get.back(); Get.back();
var res = await CRUD().post(link: AppLink.updateDriverClaim, payload: { var res = await CRUD().post(link: AppLink.updateDriverClaim, payload: {
'driverId': box.read(BoxName.driverID), 'driverId': box.read(BoxName.driverID),
}); });
if (res != 'failure') { if (res != 'failure') {
Get.find<CaptainWalletController>() Get.find<CaptainWalletController>()
.addDriverWallet('new driver', '30000', '30000'); .addDriverWallet('new driver', '300', '300');
Confetti.launch( Confetti.launch(
context, context,
options: options:

View File

@@ -265,6 +265,8 @@ class SecurityHelper {
// print("security_warning".tr); //using easy_localization // print("security_warning".tr); //using easy_localization
// Use a more robust approach to show a warning, like a dialog: // Use a more robust approach to show a warning, like a dialog:
_showSecurityWarning(); _showSecurityWarning();
} else {
box.write(BoxName.security_check, 'passed');
} }
} }

View File

@@ -2,6 +2,9 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../constant/box_name.dart';
import '../../main.dart';
class SecurityChecks { class SecurityChecks {
static const platform = MethodChannel( static const platform = MethodChannel(
'com.intaleq_driver/security'); // Choose a unique channel name 'com.intaleq_driver/security'); // Choose a unique channel name
@@ -39,6 +42,8 @@ class SecurityChecks {
), ),
); );
} else { } else {
box.write(BoxName.security_check, 'passed');
// Continue with normal app flow // Continue with normal app flow
print("Device is secure."); print("Device is secure.");
} }

View File

@@ -1585,7 +1585,7 @@ class MapDriverController extends GetxController {
/// **جلب ورسم المسار (OSRM - New Standard System)** /// **جلب ورسم المسار (OSRM - New Standard System)**
/// ///
/// تستخدم السيرفر الجديد: https://routesjo.intaleq.xyz/route/v1/driving /// تستخدم السيرفر الجديد: https://routesy.intaleq.xyz/route/v1/driving
Future<void> getRoute({ Future<void> getRoute({
required LatLng origin, required LatLng origin,
required LatLng destination, required LatLng destination,
@@ -1596,7 +1596,7 @@ class MapDriverController extends GetxController {
'${origin.longitude},${origin.latitude};${destination.longitude},${destination.latitude}'; '${origin.longitude},${origin.latitude};${destination.longitude},${destination.latitude}';
// استخدام الرابط من الكلاس المرجعي لأنه أحدث // استخدام الرابط من الكلاس المرجعي لأنه أحدث
var url = var url =
"https://routesjo.intaleq.xyz/route/v1/driving/$coordinates?steps=true&overview=full"; "https://routesy.intaleq.xyz/route/v1/driving/$coordinates?steps=true&overview=full";
try { try {
var response = await http.get(Uri.parse(url)); var response = await http.get(Uri.parse(url));

View File

@@ -264,7 +264,7 @@ class OrderRequestController extends GetxController
// حماية من الإحداثيات الصفرية // حماية من الإحداثيات الصفرية
if (start.latitude == 0 || end.latitude == 0) return null; if (start.latitude == 0 || end.latitude == 0) return null;
String apiUrl = "https://routesjo.intaleq.xyz/route/v1/driving"; String apiUrl = "https://routesy.intaleq.xyz/route/v1/driving";
String coords = String coords =
"${start.longitude},${start.latitude};${end.longitude},${end.latitude}"; "${start.longitude},${start.latitude};${end.longitude},${end.latitude}";
String url = "$apiUrl/$coords?steps=false&overview=full"; String url = "$apiUrl/$coords?steps=false&overview=full";

View File

@@ -62,7 +62,7 @@ class NavigationController extends GetxController {
// الرابط الجديد // الرابط الجديد
static const String _routeApiBaseUrl = static const String _routeApiBaseUrl =
"https://routesjo.intaleq.xyz/route/v1/driving"; "https://routesy.intaleq.xyz/route/v1/driving";
@override @override
void onInit() { void onInit() {

View File

@@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:math';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@@ -12,7 +13,9 @@ import '../../main.dart';
import '../../onbording_page.dart'; import '../../onbording_page.dart';
import '../../print.dart'; import '../../print.dart';
import '../functions/encrypt_decrypt.dart'; import '../functions/encrypt_decrypt.dart';
import '../functions/package_info.dart';
import '../functions/secure_storage.dart'; import '../functions/secure_storage.dart';
import '../functions/security_checks.dart';
// Assuming you have a home page to navigate to after successful login. // Assuming you have a home page to navigate to after successful login.
// If not, you might need to adjust the navigation target. // If not, you might need to adjust the navigation target.
@@ -32,6 +35,17 @@ class SplashScreenController extends GetxController
super.onInit(); super.onInit();
_setupAnimations(); _setupAnimations();
_initializeAndNavigate(); _initializeAndNavigate();
checkSecurity();
}
checkSecurity() async {
final random = Random();
if (random.nextBool()) {
await SecurityHelper.performSecurityChecks();
} else {
await SecurityChecks.isDeviceRootedFromNative(Get.context!);
}
} }
void _setupAnimations() { void _setupAnimations() {

View File

@@ -4,10 +4,10 @@ class Log {
Log._(); Log._();
static void print(String value, {StackTrace? stackTrace}) { static void print(String value, {StackTrace? stackTrace}) {
developer.log(value, name: 'LOG', stackTrace: stackTrace); // developer.log(value, name: 'LOG', stackTrace: stackTrace);
} }
static Object? inspect(Object? object) { static Object? inspect(Object? object) {
return developer.inspect(object); // return developer.inspect(object);
} }
} }

View File

@@ -1490,26 +1490,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker name: leak_tracker
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "10.0.9" version: "11.0.2"
leak_tracker_flutter_testing: leak_tracker_flutter_testing:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker_flutter_testing name: leak_tracker_flutter_testing
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.9" version: "3.0.10"
leak_tracker_testing: leak_tracker_testing:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker_testing name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.1" version: "3.0.2"
lints: lints:
dependency: transitive dependency: transitive
description: description:
@@ -1642,10 +1642,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.16.0" version: "1.17.0"
mgrs_dart: mgrs_dart:
dependency: transitive dependency: transitive
description: description:
@@ -2278,10 +2278,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.4" version: "0.7.7"
timezone: timezone:
dependency: transitive dependency: transitive
description: description:
@@ -2422,10 +2422,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.4" version: "2.2.0"
vibration: vibration:
dependency: "direct main" dependency: "direct main"
description: description: