2026-02-19
This commit is contained in:
@@ -128,13 +128,11 @@ class LoginDriverController extends GetxController {
|
||||
|
||||
var dev = '';
|
||||
getJwtWallet() async {
|
||||
final random = Random();
|
||||
|
||||
if (random.nextBool()) {
|
||||
await SecurityHelper.performSecurityChecks();
|
||||
} else {
|
||||
await SecurityChecks.isDeviceRootedFromNative(Get.context!);
|
||||
if (box.read(BoxName.security_check).toString() != 'passed') {
|
||||
Log.print('Security check failed');
|
||||
return;
|
||||
}
|
||||
Log.print('Security check passed');
|
||||
String fingerPrint = await DeviceHelper.getDeviceFingerprint();
|
||||
// print('fingerPrint: ${fingerPrint}');
|
||||
dev = Platform.isAndroid ? 'android' : 'ios';
|
||||
|
||||
@@ -35,14 +35,14 @@ Future<void> showDriverGiftClaim(BuildContext context) async {
|
||||
if (box.read(BoxName.is_claimed).toString() == '0' ||
|
||||
box.read(BoxName.is_claimed) == null) {
|
||||
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();
|
||||
var res = await CRUD().post(link: AppLink.updateDriverClaim, payload: {
|
||||
'driverId': box.read(BoxName.driverID),
|
||||
});
|
||||
if (res != 'failure') {
|
||||
Get.find<CaptainWalletController>()
|
||||
.addDriverWallet('new driver', '30000', '30000');
|
||||
.addDriverWallet('new driver', '300', '300');
|
||||
Confetti.launch(
|
||||
context,
|
||||
options:
|
||||
|
||||
@@ -265,6 +265,8 @@ class SecurityHelper {
|
||||
// print("security_warning".tr); //using easy_localization
|
||||
// Use a more robust approach to show a warning, like a dialog:
|
||||
_showSecurityWarning();
|
||||
} else {
|
||||
box.write(BoxName.security_check, 'passed');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../main.dart';
|
||||
|
||||
class SecurityChecks {
|
||||
static const platform = MethodChannel(
|
||||
'com.intaleq_driver/security'); // Choose a unique channel name
|
||||
@@ -39,6 +42,8 @@ class SecurityChecks {
|
||||
),
|
||||
);
|
||||
} else {
|
||||
box.write(BoxName.security_check, 'passed');
|
||||
|
||||
// Continue with normal app flow
|
||||
print("Device is secure.");
|
||||
}
|
||||
|
||||
@@ -1585,7 +1585,7 @@ class MapDriverController extends GetxController {
|
||||
|
||||
/// **جلب ورسم المسار (OSRM - New Standard System)**
|
||||
///
|
||||
/// تستخدم السيرفر الجديد: https://routesjo.intaleq.xyz/route/v1/driving
|
||||
/// تستخدم السيرفر الجديد: https://routesy.intaleq.xyz/route/v1/driving
|
||||
Future<void> getRoute({
|
||||
required LatLng origin,
|
||||
required LatLng destination,
|
||||
@@ -1596,7 +1596,7 @@ class MapDriverController extends GetxController {
|
||||
'${origin.longitude},${origin.latitude};${destination.longitude},${destination.latitude}';
|
||||
// استخدام الرابط من الكلاس المرجعي لأنه أحدث
|
||||
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 {
|
||||
var response = await http.get(Uri.parse(url));
|
||||
|
||||
@@ -264,7 +264,7 @@ class OrderRequestController extends GetxController
|
||||
// حماية من الإحداثيات الصفرية
|
||||
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 =
|
||||
"${start.longitude},${start.latitude};${end.longitude},${end.latitude}";
|
||||
String url = "$apiUrl/$coords?steps=false&overview=full";
|
||||
|
||||
@@ -62,7 +62,7 @@ class NavigationController extends GetxController {
|
||||
|
||||
// الرابط الجديد
|
||||
static const String _routeApiBaseUrl =
|
||||
"https://routesjo.intaleq.xyz/route/v1/driving";
|
||||
"https://routesy.intaleq.xyz/route/v1/driving";
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -12,7 +13,9 @@ import '../../main.dart';
|
||||
import '../../onbording_page.dart';
|
||||
import '../../print.dart';
|
||||
import '../functions/encrypt_decrypt.dart';
|
||||
import '../functions/package_info.dart';
|
||||
import '../functions/secure_storage.dart';
|
||||
import '../functions/security_checks.dart';
|
||||
|
||||
// Assuming you have a home page to navigate to after successful login.
|
||||
// If not, you might need to adjust the navigation target.
|
||||
@@ -32,6 +35,17 @@ class SplashScreenController extends GetxController
|
||||
super.onInit();
|
||||
_setupAnimations();
|
||||
_initializeAndNavigate();
|
||||
checkSecurity();
|
||||
}
|
||||
|
||||
checkSecurity() async {
|
||||
final random = Random();
|
||||
|
||||
if (random.nextBool()) {
|
||||
await SecurityHelper.performSecurityChecks();
|
||||
} else {
|
||||
await SecurityChecks.isDeviceRootedFromNative(Get.context!);
|
||||
}
|
||||
}
|
||||
|
||||
void _setupAnimations() {
|
||||
|
||||
Reference in New Issue
Block a user