25-2/24/1

This commit is contained in:
Hamza-Ayed
2025-02-24 23:38:01 +03:00
parent 5f53461b34
commit d41314cfed
64 changed files with 1180 additions and 494 deletions

25
.env
View File

@@ -21,23 +21,7 @@ seferPaymentServer=https://seferpw.shop/sefer
seferCairoServer=https://server.sefer.live/sefer.click/sefer seferCairoServer=https://server.sefer.live/sefer.click/sefer
seferGizaServer=https://gizasefer.online/sefer seferGizaServer=https://gizasefer.online/sefer
anthropicAIkeySeferNewHamzaayedpython=zg-qbc-qvo39-vCB-WnzEwFNArO0YlTapvfhtmguKWsXJSKqg_NZSjHBYVXMZK1yUK88SobdckV0KuPaBh0c_WHtGsRO_439PBk-e2QqgkQQXrXlBl anthropicAIkeySeferNewHamzaayedpython=zg-qbc-qvo39-vCB-WnzEwFNArO0YlTapvfhtmguKWsXJSKqg_NZSjHBYVXMZK1yUK88SobdckV0KuPaBh0c_WHtGsRO_439PBk-e2QqgkQQXrXlBl
getapiKey=https://server.sefer.live/sefer.click/sefer/ride/apiKey/get.php
privateKeyFCM='''
{
"type": "service_account",
"project_id": "ride-b1bd8",
"private_key_id": "75e817c0b902db2ef35edf2c2bd159dec1f13249",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD0zH9TQGDQHUv3\\na3/JAD1UKPwAp3wNKT0a6fxiIzjI3JxQWI30QvZCcfl6CdMhIcydX1ncSaYTcEeC\\n/AdPVCPkqyJx1YIGGg6P/mRzCWeaN8fsp6z250m5vcObDCZc3dbJEkepbep+6FPY\\n21m3KO+AHh1glgsTGZOTm5xiU8NGXpdk2QEh8wpiIIlR/HuKwVw9g8urNe3Sno+U\\nDm3z37iFqvZdmpqO8aWTJu6beb3hsREK9XK2I9JqC2JUwiGQRo3idOvPP6hkqrWx\\nKSX96vglQFYfakvJdDp2ZATOlpBYPMtS/IWhJ985u58TSS+Kl8qpnpaZBSxgJirf\\nhWzhnKLfAgMBAAECggEAJP785SePGhS7ZN6ltspm+l+hSjYFrPWFCxq+rlQ1YkHZ\\nC9l+RqKSFhOkiPmQI2s4wbXl3kFxLHHlFNoi/q2wKQBmGb8TQfnRJpjjNHGA61Ev\\n0Ue7/6qPvVb9B2MsLw/FxKiTFPuMG3bgKR9pbSFuJLYoaW7zqITOhVnYphGTqwAY\\nBVVcvISSLvELDmH9VZcv/9DVqVlqbbESHWh1Z4W6XGPoEqeDH/upNTyQQ/46Msgm\\nTGE6VqLHpWuSf6SqHp+r0Y0lI3vIPM1vz5FAJDJbOE/enHa0fSup0OHSMxl0HVMn\\nnO1yrGF3vsIPOej5HKr5d71bEIckzk73/yjNC1/mDQKBgQD7RtUvc9omsSsFMJ6e\\nBASAn6Dktx/QY/XNJjFzHQj69cywLDe5t5AL2gUi3phQ2oqB5XJdwnd5bTIEPEPZ\\nDOuOai2802p6FJk6kjmZAMVGx5JtXBH+vs6jrmQQSMiKbjwN1TT6xIWakvLOonUi\\nX6ZvjYYjU/E0YJU3jSiXWEr76wKBgQD5Zn4SouJ6BCDZMbausJVMBkk3qxsYooip\\np89WakC6e7AZinpkRcqjGGV9GOvc8crJs6fyXAA9ORepGP47Mc0ZrDssOkstznsM\\npr8R0S6MKwEZaT9ixOHdOcLZ47ps+JzA2Wr4KN2OvFHksUkB/46ATD1j9WZVgB8M\\namsYp/Y73QKBgHOo+PvsoZ9psVmkNX6abtAdqdtdB0HOoRea2uwXk0ig12TIFaZg\\nfedWpUKVnxqoXVTJHklV99RmlL0qWDiSH+LfsMnXro0e6iDxqZ1po2Se/CFmXcoa\\nXdctsFVmixhdATuExewfhTfPKABA+xWlXWC/jdy5CK+JPWXijaqMM4edAoGAE5Bj\\nsWiPpYyvWvpYX0nA3G7dzX0hqgQN/mkIjbnWDArp3IcNZNJIvBSM2Yxb7EAXbU0n\\njo6DAkp5Pa2VO+WDNlFZbvW/sf8xjeOCt44WPa6d7nVgIIpbQXRngZoopKW3/jTP\\n/FmQT8McFXmGxZ5belsAsdetSGW9icbLUerTGQ0CgYEAmf/G8Ag3XxmqTXvvHuv2\\n14OP7WnrVqkEMnydrftEwn4peXd/Lz+/GYX5Zc4ZoNgbN8IvZ5z0+OmRsallsbiW\\nBw0/tc68CjzxXOvReWxDluUopqWVGj5tlGqE5xUDku9SWJSxbkiQ3rqutzBdPXpr\\noqHwPyDrmK/Zgqn+uiIm4Ck=\\n-----END PRIVATE KEY-----\n"
,
"client_email": "firebase-adminsdk-o2wqi@ride-b1bd8.iam.gserviceaccount.com",
"client_id": "111210077025005706623",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-o2wqi%40ride-b1bd8.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
'''
cohere=Aulwd8y5SPWos0hJhG0toUf8gOhUUrpf5Q2TPmVGXrXlBl cohere=Aulwd8y5SPWos0hJhG0toUf8gOhUUrpf5Q2TPmVGXrXlBl
claudeAiAPI=zg-qbc-qvo39-xWOxIGwWTOzCFBnIYSKKhfyz_KVAvrH-6_4ZEJL68G_QBH26oeTOMMoQug9KuOjjKSP_A4S3SUDlbxR9duVzoQ-MkX_UQQQXrXlBl claudeAiAPI=zg-qbc-qvo39-xWOxIGwWTOzCFBnIYSKKhfyz_KVAvrH-6_4ZEJL68G_QBH26oeTOMMoQug9KuOjjKSP_A4S3SUDlbxR9duVzoQ-MkX_UQQQXrXlBl
payPalClientId=QALymfNI5Tzt4s-ysoz6vD4_nqX0SUtkC_qYV-Ugk5gaM_8Z-kg4L53k8Uux_4jEWXDkNpXGSWPpIzDFXrXlBl payPalClientId=QALymfNI5Tzt4s-ysoz6vD4_nqX0SUtkC_qYV-Ugk5gaM_8Z-kg4L53k8Uux_4jEWXDkNpXGSWPpIzDFXrXlBl
@@ -62,7 +46,12 @@ payMobOutPassword='D2zJFxkE#LN3vz38z2dYxpNfWXrXlBl'
payMobOutUserName='zjujl_qvo_fwjfgjlXrXlBl' payMobOutUserName='zjujl_qvo_fwjfgjlXrXlBl'
keyOfApp=nqryjp@1737wqnmqqsjyzjujljksvceiXrXlBl keyOfApp=nqryjp@1737wqnmqqsjyzjujljksvceiXrXlBl
initializationVector=abcdefghijklmnop initializationVector=abcdefghijklmnop
sss_pass=wqnmqqsjyvwv:nqrYJP@17378XrXlBl
sss_encryptionSalt=zg-vlie-2l1ZlpxiLJ6wQOvbb4TnC9XrxgUEyVQIu6TID4qP4FUUqoS5XrXlBl
addd=BlBlNl
allowed=TripzDriver:
passnpassenger=hbgbitbXrXrBr
newId=new
a=q a=q

View File

@@ -55,8 +55,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdk = 23 minSdk = 23
targetSdk = flutter.targetSdkVersion targetSdk = flutter.targetSdkVersion
versionCode = 135 versionCode = 136
versionName = '2.0.135' versionName = '2.0.136'
multiDexEnabled =true multiDexEnabled =true
} }
@@ -89,7 +89,7 @@ flutter {
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.scottyab:rootbeer-lib:0.1.0'
implementation 'com.stripe:paymentsheet:20.52.2' implementation 'com.stripe:paymentsheet:20.52.2'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4' coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4'

View File

@@ -1,21 +1,95 @@
package com.sefer_driver package com.sefer_driver
import android.content.Intent // import android.content.Intent
// import io.flutter.embedding.android.FlutterFragmentActivity
// import io.flutter.embedding.engine.FlutterEngine
// class MainActivity : FlutterFragmentActivity() {
// override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
// try {
// super.configureFlutterEngine(MyApplication.flutterEngine)
// } catch (e: UninitializedPropertyAccessException) {
// super.configureFlutterEngine(flutterEngine)
// }
// }
// private fun bringAppToForeground() {
// val intent = Intent(this, MainActivity::class.java)
// intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
// startActivity(intent)
// }
// }
import android.app.AlertDialog
import android.os.Bundle
import android.util.Log
import io.flutter.embedding.android.FlutterFragmentActivity import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine import java.util.*
class MainActivity : FlutterFragmentActivity() { class MainActivity : FlutterFragmentActivity() {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) { override fun onCreate(savedInstanceState: Bundle?) {
try { super.onCreate(savedInstanceState)
super.configureFlutterEngine(MyApplication.flutterEngine)
} catch (e: UninitializedPropertyAccessException) { Log.d("DEBUG", "onCreate executed - Checking root status...")
super.configureFlutterEngine(flutterEngine)
// بدء فحص الأمان
performSecurityChecks()
}
private fun performSecurityChecks() {
val rootDetection = RootDetection
val isRooted = rootDetection.isRooted()
val isDevMode = rootDetection.isDevMode(this)
val isTampered = rootDetection.isTampered(this)
val isRealDevice = rootDetection.isRealDevice()
val isOnExternalStorage = rootDetection.isOnExternalStorage()
val isNotTrust = rootDetection.isNotTrust()
val checkForIssues = rootDetection.checkForIssues()
// Log.d("DEBUG", "Security Check Results:")
// Log.d("DEBUG", "isRooted: $isRooted")
// Log.d("DEBUG", "isDevMode: $isDevMode")
// Log.d("DEBUG", "isTampered: $isTampered")
// Log.d("DEBUG", "isRealDevice: $isRealDevice")
// Log.d("DEBUG", "isOnExternalStorage: $isOnExternalStorage")
// Log.d("DEBUG", "isNotTrust: $isNotTrust")
// Log.d("DEBUG", "checkForIssues: $checkForIssues")
if (isRooted || isTampered || !isRealDevice || isOnExternalStorage || isNotTrust) {
// Log.e("DEBUG", "Security issue detected! Showing dialog.")
showSecurityWarningDialog()
} else {
// Log.d(
// "DEBUG",
// getString(R.string.device_secure)
// ) // Using dynamic string based on the device language
} }
} }
private fun bringAppToForeground() { private fun showSecurityWarningDialog() {
val intent = Intent(this, MainActivity::class.java) val builder = AlertDialog.Builder(this)
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT) builder.setTitle(getString(R.string.security_warning_title)) // Title based on language
startActivity(intent) builder.setMessage(
getString(R.string.security_warning_message)
) // Message based on language
builder.setPositiveButton(getString(R.string.exit_button)) { _, _ ->
Log.e("DEBUG", "User clicked exit. Closing app.")
clearAppDataAndExit()
}
builder.setCancelable(false)
val alertDialog = builder.create()
alertDialog.show()
}
private fun clearAppDataAndExit() {
// حذف جميع البيانات هنا، مثل ملفات التخزين وبيانات التطبيق
// يمكنك استخدام SharedPreferences أو قاعدة بيانات
Log.d("DEBUG", "Clearing app data...")
// يمكنك استخدام كود لحذف جميع البيانات (SharedPreferences, DB, ملفات)
// ثم إغلاق التطبيق:
finishAffinity() // يغلق جميع الأنشطة ويفتح نافذة جديدة
} }
} }

View File

@@ -0,0 +1,61 @@
package com.sefer_driver
import android.content.Context
import android.os.Build
import android.os.Environment
import android.provider.Settings
import com.scottyab.rootbeer.RootBeer
import java.io.File
object RootDetection {
fun isRooted(): Boolean {
val paths =
arrayOf(
"/system/app/Superuser.apk",
"/system/xbin/su",
"/system/bin/su",
"/system/bin/magisk",
"/system/xbin/magisk",
"/sbin/magisk"
)
for (path in paths) {
if (File(path).exists()) {
return true
}
}
return false
}
fun isDevMode(context: Context): Boolean {
return Settings.Global.getInt(
context.contentResolver,
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED,
0
) == 1
}
fun isTampered(context: Context): Boolean {
val rootBeer = RootBeer(context)
return rootBeer.isRooted
}
fun checkForIssues(): Boolean {
// يمكنك إضافة المزيد من الفحوصات حسب حاجتك
return false // نفترض أنه لا توجد مشاكل للأجهزة غير المتجذرة
}
fun isRealDevice(): Boolean {
return !Build.FINGERPRINT.contains("generic") && !Build.MODEL.contains("google_sdk")
}
fun isOnExternalStorage(): Boolean {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT &&
Environment.getExternalStorageState() == Environment.MEDIA_MOUNTED
}
fun isNotTrust(): Boolean {
// مثال تحقق من الثقة (قد تحتاج لتطوير هذا حسب متطلباتك)
return false // نفترض أن الجهاز موثوق
}
}

View File

@@ -0,0 +1,6 @@
<resources>
<string name="security_warning_title">تحذير أمني</string>
<string name="security_warning_message">تم اكتشاف مشكلة أمنية أو تعديل على هذا الجهاز. لا يمكن تشغيل التطبيق على هذا الجهاز.</string>
<string name="exit_button">إغلاق التطبيق</string>
<string name="device_secure">الجهاز آمن. الاستمرار بشكل طبيعي.</string>
</resources>

View File

@@ -4,6 +4,11 @@
<string name="api_key">AIzaSyCyfwRXTwSTLOFQSQgN5p7QZgGJVZnEKq0</string> <string name="api_key">AIzaSyCyfwRXTwSTLOFQSQgN5p7QZgGJVZnEKq0</string>
<string name="channel_name">FCM Notifications</string> <string name="channel_name">FCM Notifications</string>
<string name="channel_description">Notifications from Firebase Cloud Messaging</string> <string name="channel_description">Notifications from Firebase Cloud Messaging</string>
<string name="security_warning_title">Security Warning</string>
<string name="security_warning_message">A security issue or modification has been detected on
this device. The app cannot run on this device.</string>
<string name="exit_button">Exit App</string>
<string name="device_secure">Device is secure. Proceeding normally.</string>
</resources> </resources>

View File

@@ -1,8 +1,8 @@
# org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx4096M
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
org.gradle.jvmargs=-Xmx4096m
android.defaults.buildfeatures.buildconfig=true android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false android.nonTransitiveRClass=true
android.nonFinalResIds=false android.nonFinalResIds=true
dart.obfuscation=true
android.enableR8.fullMode=true android.enableR8.fullMode=true

View File

@@ -89,6 +89,8 @@ PODS:
- GoogleUtilities/UserDefaults (~> 8.0) - GoogleUtilities/UserDefaults (~> 8.0)
- nanopb (~> 3.30910.0) - nanopb (~> 3.30910.0)
- Flutter (1.0.0) - Flutter (1.0.0)
- flutter_app_group_directory (0.0.1):
- Flutter
- flutter_contacts (0.0.1): - flutter_contacts (0.0.1):
- Flutter - Flutter
- flutter_image_compress_common (1.0.0): - flutter_image_compress_common (1.0.0):
@@ -195,6 +197,10 @@ PODS:
- TOCropViewController (~> 2.7.4) - TOCropViewController (~> 2.7.4)
- image_picker_ios (0.0.1): - image_picker_ios (0.0.1):
- Flutter - Flutter
- IOSSecuritySuite (1.9.11)
- jailbreak_root_detection (1.0.1):
- Flutter
- IOSSecuritySuite (~> 1.9.10)
- just_audio (0.0.1): - just_audio (0.0.1):
- Flutter - Flutter
- libwebp (1.3.2): - libwebp (1.3.2):
@@ -209,6 +215,8 @@ PODS:
- libwebp/sharpyuv (1.3.2) - libwebp/sharpyuv (1.3.2)
- libwebp/webp (1.3.2): - libwebp/webp (1.3.2):
- libwebp/sharpyuv - libwebp/sharpyuv
- live_activities (0.0.1):
- Flutter
- local_auth_darwin (0.0.1): - local_auth_darwin (0.0.1):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
@@ -231,6 +239,8 @@ PODS:
- permission_handler_apple (9.3.0): - permission_handler_apple (9.3.0):
- Flutter - Flutter
- PromisesObjC (2.4.0) - PromisesObjC (2.4.0)
- quick_actions_ios (0.0.1):
- Flutter
- RecaptchaInterop (100.0.0) - RecaptchaInterop (100.0.0)
- record_darwin (1.0.0): - record_darwin (1.0.0):
- Flutter - Flutter
@@ -310,6 +320,7 @@ DEPENDENCIES:
- FirebaseCore - FirebaseCore
- FirebaseMessaging - FirebaseMessaging
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- flutter_app_group_directory (from `.symlinks/plugins/flutter_app_group_directory/ios`)
- flutter_contacts (from `.symlinks/plugins/flutter_contacts/ios`) - flutter_contacts (from `.symlinks/plugins/flutter_contacts/ios`)
- flutter_image_compress_common (from `.symlinks/plugins/flutter_image_compress_common/ios`) - flutter_image_compress_common (from `.symlinks/plugins/flutter_image_compress_common/ios`)
- flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`) - flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
@@ -321,12 +332,15 @@ DEPENDENCIES:
- google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`) - google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`) - image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- jailbreak_root_detection (from `.symlinks/plugins/jailbreak_root_detection/ios`)
- just_audio (from `.symlinks/plugins/just_audio/ios`) - just_audio (from `.symlinks/plugins/just_audio/ios`)
- live_activities (from `.symlinks/plugins/live_activities/ios`)
- local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`) - local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`)
- location (from `.symlinks/plugins/location/ios`) - location (from `.symlinks/plugins/location/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- quick_actions_ios (from `.symlinks/plugins/quick_actions_ios/ios`)
- record_darwin (from `.symlinks/plugins/record_darwin/ios`) - record_darwin (from `.symlinks/plugins/record_darwin/ios`)
- share (from `.symlinks/plugins/share/ios`) - share (from `.symlinks/plugins/share/ios`)
- sign_in_with_apple (from `.symlinks/plugins/sign_in_with_apple/ios`) - sign_in_with_apple (from `.symlinks/plugins/sign_in_with_apple/ios`)
@@ -359,6 +373,7 @@ SPEC REPOS:
- GoogleUtilities - GoogleUtilities
- GTMAppAuth - GTMAppAuth
- GTMSessionFetcher - GTMSessionFetcher
- IOSSecuritySuite
- libwebp - libwebp
- Mantle - Mantle
- nanopb - nanopb
@@ -394,6 +409,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/firebase_messaging/ios" :path: ".symlinks/plugins/firebase_messaging/ios"
Flutter: Flutter:
:path: Flutter :path: Flutter
flutter_app_group_directory:
:path: ".symlinks/plugins/flutter_app_group_directory/ios"
flutter_contacts: flutter_contacts:
:path: ".symlinks/plugins/flutter_contacts/ios" :path: ".symlinks/plugins/flutter_contacts/ios"
flutter_image_compress_common: flutter_image_compress_common:
@@ -416,8 +433,12 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/image_cropper/ios" :path: ".symlinks/plugins/image_cropper/ios"
image_picker_ios: image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios" :path: ".symlinks/plugins/image_picker_ios/ios"
jailbreak_root_detection:
:path: ".symlinks/plugins/jailbreak_root_detection/ios"
just_audio: just_audio:
:path: ".symlinks/plugins/just_audio/ios" :path: ".symlinks/plugins/just_audio/ios"
live_activities:
:path: ".symlinks/plugins/live_activities/ios"
local_auth_darwin: local_auth_darwin:
:path: ".symlinks/plugins/local_auth_darwin/darwin" :path: ".symlinks/plugins/local_auth_darwin/darwin"
location: location:
@@ -428,6 +449,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/path_provider_foundation/darwin" :path: ".symlinks/plugins/path_provider_foundation/darwin"
permission_handler_apple: permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios" :path: ".symlinks/plugins/permission_handler_apple/ios"
quick_actions_ios:
:path: ".symlinks/plugins/quick_actions_ios/ios"
record_darwin: record_darwin:
:path: ".symlinks/plugins/record_darwin/ios" :path: ".symlinks/plugins/record_darwin/ios"
share: share:
@@ -469,6 +492,7 @@ SPEC CHECKSUMS:
FirebaseInstallations: 6ef4a1c7eb2a61ee1f74727d7f6ce2e72acf1414 FirebaseInstallations: 6ef4a1c7eb2a61ee1f74727d7f6ce2e72acf1414
FirebaseMessaging: f8a160d99c2c2e5babbbcc90c4a3e15db036aee2 FirebaseMessaging: f8a160d99c2c2e5babbbcc90c4a3e15db036aee2
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_app_group_directory: d2c3337f424828558953172f9378d00df9b7756d
flutter_contacts: edb1c5ce76aa433e20e6cb14c615f4c0b66e0983 flutter_contacts: edb1c5ce76aa433e20e6cb14c615f4c0b66e0983
flutter_image_compress_common: ec1d45c362c9d30a3f6a0426c297f47c52007e3e flutter_image_compress_common: ec1d45c362c9d30a3f6a0426c297f47c52007e3e
flutter_inappwebview_ios: 6f63631e2c62a7c350263b13fa5427aedefe81d4 flutter_inappwebview_ios: 6f63631e2c62a7c350263b13fa5427aedefe81d4
@@ -488,8 +512,11 @@ SPEC CHECKSUMS:
GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
image_cropper: 37d40f62177c101ff4c164906d259ea2c3aa70cf image_cropper: 37d40f62177c101ff4c164906d259ea2c3aa70cf
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1 image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
IOSSecuritySuite: b51056d5411aee567153ca86ce7f6edfdc5d2654
jailbreak_root_detection: b95de80c3e51eec1fc7d0225784d2fc038fa95ed
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009 libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
live_activities: 5a5ddcfe2bd2cbbe7555a5da9c35b07d1a4ff2e8
local_auth_darwin: 66e40372f1c29f383a314c738c7446e2f7fdadc3 local_auth_darwin: 66e40372f1c29f383a314c738c7446e2f7fdadc3
location: d5cf8598915965547c3f36761ae9cc4f4e87d22e location: d5cf8598915965547c3f36761ae9cc4f4e87d22e
Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
@@ -499,6 +526,7 @@ SPEC CHECKSUMS:
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2 permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
quick_actions_ios: 56f3cbaa71e94f212838d1f9fe354bd0734779bf
RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21 RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21
record_darwin: 3b1a8e7d5c0cbf45ad6165b4d83a6ca643d929c3 record_darwin: 3b1a8e7d5c0cbf45ad6165b4d83a6ca643d929c3
SDWebImage: 73c6079366fea25fa4bb9640d5fb58f0893facd8 SDWebImage: 73c6079366fea25fa4bb9640d5fb58f0893facd8

View File

@@ -16,6 +16,9 @@
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
C604FDB02D6C8D6A00CF8873 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = C604FDAF2D6C8D6000CF8873 /* Constants.swift */; };
C604FDB22D6C953400CF8873 /* JailbreakDetection.swift in Sources */ = {isa = PBXBuildFile; fileRef = C604FDB12D6C953100CF8873 /* JailbreakDetection.swift */; };
C604FDB52D6C96D000CF8873 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C604FDB32D6C96D000CF8873 /* Localizable.strings */; };
C624C4642BD56D34002834AF /* tone1.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = C624C45C2BD56D34002834AF /* tone1.mp3 */; }; C624C4642BD56D34002834AF /* tone1.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = C624C45C2BD56D34002834AF /* tone1.mp3 */; };
C624C4652BD56D34002834AF /* start.wav in Resources */ = {isa = PBXBuildFile; fileRef = C624C45D2BD56D34002834AF /* start.wav */; }; C624C4652BD56D34002834AF /* start.wav in Resources */ = {isa = PBXBuildFile; fileRef = C624C45D2BD56D34002834AF /* start.wav */; };
C624C4672BD56D34002834AF /* promo.wav in Resources */ = {isa = PBXBuildFile; fileRef = C624C45F2BD56D34002834AF /* promo.wav */; }; C624C4672BD56D34002834AF /* promo.wav in Resources */ = {isa = PBXBuildFile; fileRef = C624C45F2BD56D34002834AF /* promo.wav */; };
@@ -73,6 +76,9 @@
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A1987A597103D3E58DD06571 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A1987A597103D3E58DD06571 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
C604FDAF2D6C8D6000CF8873 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
C604FDB12D6C953100CF8873 /* JailbreakDetection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JailbreakDetection.swift; sourceTree = "<group>"; };
C604FDB42D6C96D000CF8873 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
C624C45C2BD56D34002834AF /* tone1.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = tone1.mp3; path = ../../android/app/src/main/res/raw/tone1.mp3; sourceTree = "<group>"; }; C624C45C2BD56D34002834AF /* tone1.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = tone1.mp3; path = ../../android/app/src/main/res/raw/tone1.mp3; sourceTree = "<group>"; };
C624C45D2BD56D34002834AF /* start.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = start.wav; path = ../../android/app/src/main/res/raw/start.wav; sourceTree = "<group>"; }; C624C45D2BD56D34002834AF /* start.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = start.wav; path = ../../android/app/src/main/res/raw/start.wav; sourceTree = "<group>"; };
C624C45F2BD56D34002834AF /* promo.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = promo.wav; path = ../../android/app/src/main/res/raw/promo.wav; sourceTree = "<group>"; }; C624C45F2BD56D34002834AF /* promo.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = promo.wav; path = ../../android/app/src/main/res/raw/promo.wav; sourceTree = "<group>"; };
@@ -182,6 +188,9 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
C604FDB12D6C953100CF8873 /* JailbreakDetection.swift */,
C604FDB32D6C96D000CF8873 /* Localizable.strings */,
C604FDAF2D6C8D6000CF8873 /* Constants.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
); );
path = Runner; path = Runner;
@@ -302,6 +311,7 @@
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
C628BC3F2C31427000E4D33B /* ding.wav in Resources */, C628BC3F2C31427000E4D33B /* ding.wav in Resources */,
C690B4752A80554500E1D66E /* GoogleService-Info.plist in Resources */, C690B4752A80554500E1D66E /* GoogleService-Info.plist in Resources */,
C604FDB52D6C96D000CF8873 /* Localizable.strings in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
C624C4692BD56D34002834AF /* iphone_ringtone.wav in Resources */, C624C4692BD56D34002834AF /* iphone_ringtone.wav in Resources */,
C624C4642BD56D34002834AF /* tone1.mp3 in Resources */, C624C4642BD56D34002834AF /* tone1.mp3 in Resources */,
@@ -438,6 +448,8 @@
files = ( files = (
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
C604FDB02D6C8D6A00CF8873 /* Constants.swift in Sources */,
C604FDB22D6C953400CF8873 /* JailbreakDetection.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@@ -468,6 +480,14 @@
name = LaunchScreen.storyboard; name = LaunchScreen.storyboard;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
C604FDB32D6C96D000CF8873 /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (
C604FDB42D6C96D000CF8873 /* en */,
);
name = Localizable.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */ /* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */ /* Begin XCBuildConfiguration section */

View File

@@ -2,19 +2,39 @@ import UIKit
import Flutter import Flutter
import FirebaseCore import FirebaseCore
import GoogleMaps import GoogleMaps
// import Constants
@main @main
@objc class AppDelegate: FlutterAppDelegate { @objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GMSServices.provideAPIKey(Constants.googleMapsAPIKey)
FirebaseApp.configure()
GeneratedPluginRegistrant.register(with: self)
override func application( if JailbreakDetection.isJailbroken() {
_ application: UIApplication, DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? self.showJailbreakAlert()
) -> Bool { }
GMSServices.provideAPIKey("AIzaSyCyfwRXTwSTLOFQSQgN5p7QZgGJVZnEKq0") }
FirebaseApp.configure()
GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions)
return true }
}
func showJailbreakAlert() {
guard let rootVC = UIApplication.shared.keyWindow?.rootViewController else { return }
let alert = UIAlertController(
title: "تحذير أمني",
message: "تم اكتشاف أن جهازك يحتوي على جيلبريك. لا يمكن تشغيل التطبيق على هذا الجهاز.",
preferredStyle: .alert
)
alert.addAction(UIAlertAction(title: "إنهاء التطبيق", style: .destructive) { _ in
exit(0)
})
rootVC.present(alert, animated: true, completion: nil)
}
} }

View File

@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--Flutter View Controller--> <!--Flutter View Controller-->
@@ -14,13 +16,14 @@
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view> </view>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="-26" y="-77"/>
</scene> </scene>
</scenes> </scenes>
</document> </document>

View File

@@ -2,7 +2,11 @@
// Constants.swift // Constants.swift
// Runner // Runner
// //
// Created by Hamza Aleghwairyeen on 15/01/2024. // Created by Hamza Aleghwairyeen on 24/02/2025.
// //
import Foundation import Foundation
struct Constants {
static let googleMapsAPIKey = "AIzaSyCyfwRXTwSTLOFQSQgN5p7QZgGJVZnEKq0"
}

View File

@@ -35,7 +35,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>93</string> <string>94</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
@@ -50,7 +50,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>5.0.93</string> <string>5.0.94</string>
<key>FirebaseAppDelegateProxyEnabled</key> <key>FirebaseAppDelegateProxyEnabled</key>
<string>NO</string> <string>NO</string>
<key>GMSApiKey</key> <key>GMSApiKey</key>

View File

@@ -0,0 +1,26 @@
//
// JailbreakDetection.swift
// Runner
//
// Created by Hamza Aleghwairyeen on 24/02/2025.
//
import Foundation
class JailbreakDetection {
static func isJailbroken() -> Bool {
let paths = [
"/Applications/Cydia.app",
"/Library/MobileSubstrate/MobileSubstrate.dylib",
"/usr/sbin/sshd",
"/etc/apt"
]
for path in paths {
if FileManager.default.fileExists(atPath: path) {
return true
}
}
return false
}
}

View File

@@ -0,0 +1,7 @@
/*
Localizable.strings
Runner
Created by Hamza Aleghwairyeen on 24/02/2025.
*/

View File

@@ -4,6 +4,16 @@ import '../env/env.dart';
import 'char_map.dart'; import 'char_map.dart';
class AK { class AK {
static final String sss_pass = X.r(X.r(X.r(Env.sss_pass, cn), cC), cs);
static final String allowed = Env.allowed;
static final String passnpassenger = X
.r(X.r(X.r(Env.passnpassenger, cn), cC), cs)
.toString()
.split(Env.addd)[0];
static final String newId = Env.newId;
static final String sss_encryptionSalt =
X.r(X.r(X.r(Env.sss_encryptionSalt, cn), cC), cs);
static final String publishableKeyStripe = static final String publishableKeyStripe =
X.r(X.r(X.r(Env.stripePublishableKe, cn), cC), cs); X.r(X.r(X.r(Env.stripePublishableKe, cn), cC), cs);
static final String secretKeyStripe = static final String secretKeyStripe =
@@ -65,7 +75,7 @@ class AK {
static final String payMobOutPassword = static final String payMobOutPassword =
X.r(X.r(X.r(Env.payMobOutPassword, cn), cC), cs); X.r(X.r(X.r(Env.payMobOutPassword, cn), cC), cs);
static final String privateKeyFCM = Env.privateKeyFCM; // static final String privateKeyFCM = Env.privateKeyFCM;
static final String payMobOutUserName = static final String payMobOutUserName =
X.r(X.r(X.r(Env.payMobOutUserName, cn), cC), cs); X.r(X.r(X.r(Env.payMobOutUserName, cn), cC), cs);

View File

@@ -2,7 +2,13 @@ class BoxName {
static const String driverID = "driverID"; static const String driverID = "driverID";
static const String countryCode = "countryCode"; static const String countryCode = "countryCode";
static const String googlaMapApp = "googlaMapApp"; static const String googlaMapApp = "googlaMapApp";
static const String keyOfApp = 'keyOfApp';
static const String initializationVector = 'initializationVector';
static const String firstTimeLoadKey = 'firstTimeLoadKey';
static const String jwt = "jwt";
static const String fingerPrint = "fingerPrint";
static const String payMobApikey = "payMobApikey";
static const String refreshToken = "refreshToken";
static const String lang = "lang"; static const String lang = "lang";
static const String isvibrate = "isvibrate"; static const String isvibrate = "isvibrate";
static const String myListString = "myListString"; static const String myListString = "myListString";

View File

@@ -9,7 +9,7 @@ class AppInformation {
static const String email = 'hamzaayed@Sefer.live'; static const String email = 'hamzaayed@Sefer.live';
static const String complaintPrompt = static const String complaintPrompt =
'for this data for complaint from driver or passenger i collect all data i want you analyze this complaint and show what is reason and what is solution .this data collected from many table to find solution if payment in visa not complete and if ride status is finished it will be paymnet in payment table if ride status is not finished there is no need to pay and payment table is null for this ride and if paymentFromPaymentTable not null and visa type not cash the payment sucssessed . if ratingpassenger is low or passengr rating drivers low grade then dont mine of this passenger ,look at driver too like passengerratingdriver with rating or ratingtopassenger .in json add status of complaint and message to passenger and message to driver and message to call center write in arabic in json output with key in english .for output please just json i want'; 'for this data for complaint from driver or passenger i collect all data i want you analyze this complaint and show what is reason and what is solution .this data collected from many table to find solution if payment in visa not complete and if ride status is finished it will be paymnet in payment table if ride status is not finished there is no need to pay and payment table is null for this ride and if paymentFromPaymentTable not null and visa type not cash the payment sucssessed . if ratingpassenger is low or passengr rating drivers low grade then dont mine of this passenger ,look at driver too like passengerratingdriver with rating or ratingtopassenger .in json add status of complaint and message to passenger and message to driver and message to call center write in arabic in json output with key in english .for output please just json i want';
static const String addd = 'BlBlNl';
static const String privacyPolicy = ''' static const String privacyPolicy = '''
<body monica-version="2.4.0" monica-id="ofpnmcalabcbjgholdjcjblkibolbppb"> <body monica-version="2.4.0" monica-id="ofpnmcalabcbjgholdjcjblkibolbppb">

View File

@@ -1,5 +1,7 @@
// import 'package:sefer_driver/env/env.dart'; // import 'package:sefer_driver/env/env.dart';
import 'package:sefer_driver/env/env.dart';
import '../main.dart'; import '../main.dart';
import 'box_name.dart'; import 'box_name.dart';
@@ -29,6 +31,12 @@ class AppLink {
static String seferAlexandriaServer = box.read('Alexandria'); static String seferAlexandriaServer = box.read('Alexandria');
// static final String server = Env.serverPHP; // static final String server = Env.serverPHP;
static String loginJwtDriver = "$server/loginJwtDriver.php";
static String loginJwtWalletDriver =
"$seferPaymentServer/loginJwtWalletDriver.php";
static String loginFirstTimeDriver =
"https://server.sefer.live/sefer.click/sefer/loginFirstTimeDriver.php";
static String googleMapsLink = 'https://maps.googleapis.com/maps/api/'; static String googleMapsLink = 'https://maps.googleapis.com/maps/api/';
static String llama = 'https://api.llama-api.com/chat/completions'; static String llama = 'https://api.llama-api.com/chat/completions';
static String gemini = static String gemini =
@@ -93,7 +101,8 @@ class AppLink {
static String getTripCountByCaptain = "$ride/rides/getTripCountByCaptain.php"; static String getTripCountByCaptain = "$ride/rides/getTripCountByCaptain.php";
static String getRideOrderID = "$ride/rides/getRideOrderID.php"; static String getRideOrderID = "$ride/rides/getRideOrderID.php";
static String getRideStatus = "$ride/rides/getRideStatus.php"; static String getRideStatus = "$ride/rides/getRideStatus.php";
static String getapiKey = "$ride/apiKey/get.php"; static String getapiKey = Env.getapiKey;
static String getapiKeySefer = static String getapiKeySefer =
"https://api.sefer.live/sefer/ride/apiKey/get.php"; "https://api.sefer.live/sefer/ride/apiKey/get.php";
static String getRideStatusBegin = "$ride/rides/getRideStatusBegin.php"; static String getRideStatusBegin = "$ride/rides/getRideStatusBegin.php";

View File

@@ -8,3 +8,11 @@ class TableName {
static const String captainNotification = "captainNotification"; static const String captainNotification = "captainNotification";
static const String applyRideFromOverLay = "applyRideFromOverLay"; static const String applyRideFromOverLay = "applyRideFromOverLay";
} }
class Driver {
static const String driverPass = 'MG6DEJZSczBT6Rx0jOlehQ==';
static const String payMobApikey = 'payMobApikey';
static const String initializationVector = 'initializationVector';
static const String keyOfApp = 'keyOfApp';
static const String FCM_PRIVATE_KEY = 'FCM_PRIVATE_KEY';
}

View File

@@ -47,7 +47,7 @@ class HistoryCaptainController extends GetxController {
isloading = true; isloading = true;
var res = await CRUD().get( var res = await CRUD().get(
link: AppLink.getRideOrderID, link: AppLink.getRideOrderID,
payload: {'id': encryptionHelper.encryptData(orderId)}); payload: {'id': EncryptionHelper.instance.encryptData(orderId)});
historyDetailsData = jsonDecode(res); historyDetailsData = jsonDecode(res);
isloading = false; isloading = false;
update(); update();

View File

@@ -149,9 +149,9 @@ Download the Tripz app now and enjoy your ride!
void onSelectDriverInvitation(int index) async { void onSelectDriverInvitation(int index) async {
MyDialog().getDialog( MyDialog().getDialog(
int.parse((driverInvitationData[index]['countOfInvitDriver'])) < 100 int.parse((driverInvitationData[index]['countOfInvitDriver'])) < 100
? '${'When'.tr} ${encryptionHelper.decryptData(driverInvitationData[index]['invitorName'])} ${"complete, you can claim your gift".tr} ' ? '${'When'.tr} ${EncryptionHelper.instance.decryptData(driverInvitationData[index]['invitorName'])} ${"complete, you can claim your gift".tr} '
: 'You deserve the gift'.tr, : 'You deserve the gift'.tr,
'${encryptionHelper.decryptData(driverInvitationData[index]['invitorName'])} ${(driverInvitationData[index]['countOfInvitDriver'])} / 100 ${'Trip'.tr}', '${EncryptionHelper.instance.decryptData(driverInvitationData[index]['invitorName'])} ${(driverInvitationData[index]['countOfInvitDriver'])} / 100 ${'Trip'.tr}',
() async { () async {
if (int.parse((driverInvitationData[index]['countOfInvitDriver'])) < if (int.parse((driverInvitationData[index]['countOfInvitDriver'])) <
100) { 100) {
@@ -161,23 +161,24 @@ Download the Tripz app now and enjoy your ride!
if ((driverInvitationData[index]['isGiftToken']).toString() == '0') { if ((driverInvitationData[index]['isGiftToken']).toString() == '0') {
Get.back(); Get.back();
await CRUD().post(link: AppLink.updateInviteDriver, payload: { await CRUD().post(link: AppLink.updateInviteDriver, payload: {
'id': encryptionHelper 'id': EncryptionHelper.instance
.encryptData(driverInvitationData[index]['id']) .encryptData(driverInvitationData[index]['id'])
}); });
await Get.find<CaptainWalletController>().addDriverPayment( await Get.find<CaptainWalletController>().addDriverPayment(
'paymentMethod', 'paymentMethod',
encryptionHelper.encryptData('500'), EncryptionHelper.instance.encryptData('500'),
'', '',
); );
// add for invitor too // add for invitor too
await Get.find<CaptainWalletController>().addDriverWalletToInvitor( await Get.find<CaptainWalletController>().addDriverWalletToInvitor(
'paymentMethod', 'paymentMethod',
encryptionHelper EncryptionHelper.instance
.encryptData(driverInvitationData[index]['driverInviterId']), .encryptData(driverInvitationData[index]['driverInviterId']),
encryptionHelper.encryptData('500'), EncryptionHelper.instance.encryptData('500'),
); );
await Get.find<CaptainWalletController>().addSeferWallet( await Get.find<CaptainWalletController>().addSeferWallet(
'giftInvitation', encryptionHelper.encryptData('-1000')); 'giftInvitation',
EncryptionHelper.instance.encryptData('-1000'));
NotificationCaptainController().addNotificationCaptain( NotificationCaptainController().addNotificationCaptain(
driverInvitationData[index]['driverInviterId'].toString(), driverInvitationData[index]['driverInviterId'].toString(),
"You have got a gift for invitation".tr, "You have got a gift for invitation".tr,
@@ -205,9 +206,9 @@ Download the Tripz app now and enjoy your ride!
int.parse(driverInvitationDataToPassengers[index]['countOfInvitDriver'] int.parse(driverInvitationDataToPassengers[index]['countOfInvitDriver']
.toString()) < .toString()) <
3 3
? '${'When'.tr} ${encryptionHelper.decryptData(driverInvitationDataToPassengers[index]['passengerName'].toString())} ${"complete, you can claim your gift".tr} ' ? '${'When'.tr} ${EncryptionHelper.instance.decryptData(driverInvitationDataToPassengers[index]['passengerName'].toString())} ${"complete, you can claim your gift".tr} '
: 'You deserve the gift'.tr, : 'You deserve the gift'.tr,
'${encryptionHelper.decryptData(driverInvitationDataToPassengers[index]['passengerName'].toString())} ${driverInvitationDataToPassengers[index]['countOfInvitDriver']} / 3 ${'Trip'.tr}', '${EncryptionHelper.instance.decryptData(driverInvitationDataToPassengers[index]['passengerName'].toString())} ${driverInvitationDataToPassengers[index]['countOfInvitDriver']} / 3 ${'Trip'.tr}',
() async { () async {
if (int.parse(driverInvitationDataToPassengers[index] if (int.parse(driverInvitationDataToPassengers[index]
['countOfInvitDriver'] ['countOfInvitDriver']

View File

@@ -1,6 +1,8 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io';
import 'dart:math'; import 'dart:math';
import 'package:http/http.dart' as http;
import 'package:secure_string_operations/secure_string_operations.dart';
import 'package:sefer_driver/controller/functions/location_background_controller.dart'; import 'package:sefer_driver/controller/functions/location_background_controller.dart';
import 'package:sefer_driver/views/auth/captin/cards/sms_signup.dart'; import 'package:sefer_driver/views/auth/captin/cards/sms_signup.dart';
import 'package:sefer_driver/views/widgets/elevated_btn.dart'; import 'package:sefer_driver/views/widgets/elevated_btn.dart';
@@ -15,10 +17,16 @@ import 'package:sefer_driver/main.dart';
import 'package:sefer_driver/views/home/Captin/home_captain/home_captin.dart'; import 'package:sefer_driver/views/home/Captin/home_captain/home_captin.dart';
import 'package:location/location.dart'; import 'package:location/location.dart';
import '../../../constant/api_key.dart';
import '../../../constant/char_map.dart';
import '../../../constant/info.dart'; import '../../../constant/info.dart';
import '../../../constant/table_names.dart';
import '../../../print.dart';
import '../../../views/auth/captin/cards/egypt_card_a_i.dart'; import '../../../views/auth/captin/cards/egypt_card_a_i.dart';
import '../../firebase/firbase_messge.dart'; import '../../firebase/firbase_messge.dart';
import '../../functions/encrypt_decrypt.dart'; import '../../functions/encrypt_decrypt.dart';
import '../../functions/package_info.dart';
import '../../functions/secure_storage.dart';
class LoginDriverController extends GetxController { class LoginDriverController extends GetxController {
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
@@ -82,6 +90,77 @@ class LoginDriverController extends GetxController {
update(); update();
} }
var dev = '';
getJwtWallet() async {
await SecurityHelper.performSecurityChecks();
String fingerPrint = await getDeviceFingerprint();
dev = Platform.isAndroid ? 'android' : 'ios';
var payload = {
'id': box.read(BoxName.passengerID),
'password': AK.passnpassenger,
'aud': '${AK.allowed}$dev',
'fingerPrint': fingerPrint
};
var response1 = await http.post(
Uri.parse(AppLink.loginJwtWalletDriver),
body: payload,
);
return jsonDecode(response1.body)['jwt'].toString();
}
getJWT() async {
// await SecurityHelper.performSecurityChecks();
dev = Platform.isAndroid ? 'android' : 'ios';
if (box.read(BoxName.firstTimeLoadKey).toString() != 'false') {
var response0 = await http.post(
Uri.parse(AppLink.loginFirstTimeDriver),
body: {
'id': box.read(BoxName.passengerID) ?? AK.newId,
'password': AK.passnpassenger,
'aud': '${AK.allowed}$dev',
},
);
if (response0.statusCode == 200) {
final decodedResponse1 = jsonDecode(response0.body);
final jwt = decodedResponse1['jwt'];
box.write(BoxName.jwt, X.c(X.c(X.c(jwt, cn), cC), cs));
await AppInitializer().getAIKey(Driver.keyOfApp);
await AppInitializer().getAIKey(Driver.initializationVector);
await Future.delayed(Duration.zero);
await EncryptionHelper.initialize();
await AppInitializer().getAIKey(Driver.payMobApikey);
await AppInitializer().getAIKey(Driver.FCM_PRIVATE_KEY);
await AppInitializer().getKey();
} else {}
} else {
await EncryptionHelper.initialize();
var payload = {
'id': box.read(BoxName.passengerID),
'password': AK.passnpassenger,
'aud': '${AK.allowed}$dev',
};
var response1 = await http.post(
Uri.parse(AppLink.loginJwtDriver),
body: payload,
);
if (response1.statusCode == 200) {
final decodedResponse1 = jsonDecode(response1.body);
Log.print('decodedResponse1: ${decodedResponse1}');
final jwt = decodedResponse1['jwt'];
await box.write(BoxName.jwt, X.c(X.c(X.c(jwt, cn), cC), cs));
await AppInitializer().getKey();
}
}
}
Future<void> getLocationPermission() async { Future<void> getLocationPermission() async {
Get.put(LocationBackgroundController()).requestLocationPermission(); Get.put(LocationBackgroundController()).requestLocationPermission();
@@ -119,7 +198,7 @@ class LoginDriverController extends GetxController {
update(); update();
var res = await CRUD().get(link: AppLink.loginFromGoogleCaptin, payload: { var res = await CRUD().get(link: AppLink.loginFromGoogleCaptin, payload: {
'email': email.toString().contains('@') 'email': email.toString().contains('@')
? encryptionHelper.encryptData(email) ? EncryptionHelper.instance.encryptData(email)
: email, : email,
'id': driverID, 'id': driverID,
}); });
@@ -161,13 +240,13 @@ class LoginDriverController extends GetxController {
(jsonDecoeded['data'][0]['accountBank'])); (jsonDecoeded['data'][0]['accountBank']));
box.write( box.write(
BoxName.nameDriver, BoxName.nameDriver,
'${encryptionHelper.decryptData(jsonDecoeded['data'][0]['first_name'])}' '${EncryptionHelper.instance.decryptData(jsonDecoeded['data'][0]['first_name'])}'
' ${encryptionHelper.decryptData(jsonDecoeded['data'][0]['last_name'])}'); ' ${EncryptionHelper.instance.decryptData(jsonDecoeded['data'][0]['last_name'])}');
if (((jsonDecoeded['data'][0]['model']) if (((jsonDecoeded['data'][0]['model'])
.toString() .toString()
.contains('دراجه') || .contains('دراجه') ||
jsonDecoeded['data'][0]['make'].toString().contains('دراجه '))) { jsonDecoeded['data'][0]['make'].toString().contains('دراجه '))) {
if (encryptionHelper if (EncryptionHelper.instance
.decryptData(jsonDecoeded['data'][0]['gender']) .decryptData(jsonDecoeded['data'][0]['gender'])
.toString() == .toString() ==
'Male') { 'Male') {
@@ -197,13 +276,14 @@ class LoginDriverController extends GetxController {
payload: {'captain_id': (box.read(BoxName.driverID)).toString()}); payload: {'captain_id': (box.read(BoxName.driverID)).toString()});
if (token != 'failure') { if (token != 'failure') {
if (encryptionHelper if (EncryptionHelper.instance
.decryptData(jsonDecode(token)['data'][0]['token']) != .decryptData(jsonDecode(token)['data'][0]['token']) !=
encryptionHelper.decryptData(box.read(BoxName.tokenDriver))) { EncryptionHelper.instance
.decryptData(box.read(BoxName.tokenDriver))) {
Get.put(FirebaseMessagesController()).sendNotificationToDriverMAP( Get.put(FirebaseMessagesController()).sendNotificationToDriverMAP(
'token change'.tr, 'token change'.tr,
'change device'.tr, 'change device'.tr,
encryptionHelper EncryptionHelper.instance
.decryptData(jsonDecode(token)['data'][0]['token']) .decryptData(jsonDecode(token)['data'][0]['token'])
.toString(), .toString(),
[], [],
@@ -262,11 +342,11 @@ class LoginDriverController extends GetxController {
update(); update();
var res = await CRUD() var res = await CRUD()
.get(link: AppLink.loginUsingCredentialsWithoutGoogle, payload: { .get(link: AppLink.loginUsingCredentialsWithoutGoogle, payload: {
'email': encryptionHelper.encryptData(email), 'email': EncryptionHelper.instance.encryptData(email),
'password': password, 'password': password,
}); });
box.write( box.write(BoxName.emailDriver,
BoxName.emailDriver, encryptionHelper.encryptData(email).toString()); EncryptionHelper.instance.encryptData(email).toString());
print(res); print(res);
if (res == 'failure') { if (res == 'failure') {
//Failure //Failure
@@ -292,7 +372,7 @@ class LoginDriverController extends GetxController {
box.write(BoxName.phoneDriver, (jsonDecoeded['data'][0]['phone'])); box.write(BoxName.phoneDriver, (jsonDecoeded['data'][0]['phone']));
box.write( box.write(
BoxName.nameArabic, BoxName.nameArabic,
encryptionHelper EncryptionHelper.instance
.decryptData(jsonDecoeded['data'][0]['name_arabic'])); .decryptData(jsonDecoeded['data'][0]['name_arabic']));
box.write( box.write(
BoxName.bankCodeDriver, (jsonDecoeded['data'][0]['bankCode'])); BoxName.bankCodeDriver, (jsonDecoeded['data'][0]['bankCode']));
@@ -300,11 +380,11 @@ class LoginDriverController extends GetxController {
jsonDecoeded['data'][0]['accountBank']); jsonDecoeded['data'][0]['accountBank']);
box.write( box.write(
BoxName.nameDriver, BoxName.nameDriver,
'${encryptionHelper.decryptData(jsonDecoeded['data'][0]['first_name'])}' '${EncryptionHelper.instance.decryptData(jsonDecoeded['data'][0]['first_name'])}'
' ${encryptionHelper.decryptData(jsonDecoeded['data'][0]['last_name'])}'); ' ${EncryptionHelper.instance.decryptData(jsonDecoeded['data'][0]['last_name'])}');
if ((jsonDecoeded['data'][0]['model'].toString().contains('دراجه') || if ((jsonDecoeded['data'][0]['model'].toString().contains('دراجه') ||
jsonDecoeded['data'][0]['make'].toString().contains('دراجه '))) { jsonDecoeded['data'][0]['make'].toString().contains('دراجه '))) {
if (encryptionHelper if (EncryptionHelper.instance
.decryptData(jsonDecoeded['data'][0]['gender']) .decryptData(jsonDecoeded['data'][0]['gender'])
.toString() == .toString() ==
'Male') { 'Male') {
@@ -314,7 +394,7 @@ class LoginDriverController extends GetxController {
} }
} else if (int.parse(jsonDecoeded['data'][0]['year'].toString()) > } else if (int.parse(jsonDecoeded['data'][0]['year'].toString()) >
2017) { 2017) {
if (encryptionHelper if (EncryptionHelper.instance
.decryptData(jsonDecoeded['data'][0]['gender']) .decryptData(jsonDecoeded['data'][0]['gender'])
.toString() != .toString() !=
'Male') { 'Male') {
@@ -337,13 +417,14 @@ class LoginDriverController extends GetxController {
payload: {'captain_id': box.read(BoxName.driverID).toString()}); payload: {'captain_id': box.read(BoxName.driverID).toString()});
if (token != 'failure') { if (token != 'failure') {
if (encryptionHelper if (EncryptionHelper.instance
.decryptData(jsonDecode(token)['data'][0]['token']) != .decryptData(jsonDecode(token)['data'][0]['token']) !=
encryptionHelper.decryptData(box.read(BoxName.tokenDriver))) { EncryptionHelper.instance
.decryptData(box.read(BoxName.tokenDriver))) {
Get.put(FirebaseMessagesController()).sendNotificationToDriverMAP( Get.put(FirebaseMessagesController()).sendNotificationToDriverMAP(
'token change'.tr, 'token change'.tr,
'change device'.tr, 'change device'.tr,
encryptionHelper EncryptionHelper.instance
.decryptData(jsonDecode(token)['data'][0]['token']) .decryptData(jsonDecode(token)['data'][0]['token'])
.toString(), .toString(),
[], [],

View File

@@ -108,8 +108,8 @@ class RegisterCaptainController extends GetxController {
if (isValidEgyptianPhoneNumber(phoneController.text)) { if (isValidEgyptianPhoneNumber(phoneController.text)) {
var responseCheker = await CRUD() var responseCheker = await CRUD()
.post(link: AppLink.checkPhoneNumberISVerfiedDriver, payload: { .post(link: AppLink.checkPhoneNumberISVerfiedDriver, payload: {
'phone_number': 'phone_number': EncryptionHelper.instance
encryptionHelper.encryptData('+2${phoneController.text}'), .encryptData('+2${phoneController.text}'),
}); });
if (responseCheker != 'failure') { if (responseCheker != 'failure') {
var d = jsonDecode(responseCheker); var d = jsonDecode(responseCheker);
@@ -117,18 +117,20 @@ class RegisterCaptainController extends GetxController {
Get.snackbar('Phone number is verified before'.tr, '', Get.snackbar('Phone number is verified before'.tr, '',
backgroundColor: AppColor.greenColor); backgroundColor: AppColor.greenColor);
box.write(BoxName.phoneVerified, '1'); box.write(BoxName.phoneVerified, '1');
box.write(BoxName.phone, box.write(
encryptionHelper.encryptData('+2${phoneController.text}')); BoxName.phone,
EncryptionHelper.instance
.encryptData('+2${phoneController.text}'));
await Get.put(LoginDriverController()).loginWithGoogleCredential( await Get.put(LoginDriverController()).loginWithGoogleCredential(
box.read(BoxName.driverID).toString(), box.read(BoxName.driverID).toString(),
box.read(BoxName.emailDriver).toString(), box.read(BoxName.emailDriver).toString(),
); );
} else { } else {
await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: { await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: {
'phone_number': 'phone_number': EncryptionHelper.instance
encryptionHelper.encryptData('+2${phoneController.text}'), .encryptData('+2${phoneController.text}'),
'token_code': 'token_code': EncryptionHelper.instance
encryptionHelper.encryptData(randomNumber.toString()), .encryptData(randomNumber.toString()),
"driverId": box.read(BoxName.driverID), "driverId": box.read(BoxName.driverID),
"email": box.read(BoxName.emailDriver), "email": box.read(BoxName.emailDriver),
}); });
@@ -143,10 +145,10 @@ class RegisterCaptainController extends GetxController {
} }
} else { } else {
await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: { await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: {
'phone_number': 'phone_number': EncryptionHelper.instance
encryptionHelper.encryptData('+2${phoneController.text}'), .encryptData('+2${phoneController.text}'),
'token_code': 'token_code': EncryptionHelper.instance
encryptionHelper.encryptData(randomNumber.toString()), .encryptData(randomNumber.toString()),
"driverId": box.read(BoxName.driverID), "driverId": box.read(BoxName.driverID),
"email": box.read(BoxName.emailDriver), "email": box.read(BoxName.emailDriver),
}); });
@@ -247,7 +249,7 @@ class RegisterCaptainController extends GetxController {
mySnackbarSuccess('Phone number is already verified'.tr); mySnackbarSuccess('Phone number is already verified'.tr);
box.write(BoxName.phoneVerified, '1'); box.write(BoxName.phoneVerified, '1');
box.write(BoxName.phone, box.write(BoxName.phone,
encryptionHelper.encryptData('+2${phoneController.text}')); EncryptionHelper.instance.encryptData('+2${phoneController.text}'));
Get.put(LoginDriverController()).loginWithGoogleCredential( Get.put(LoginDriverController()).loginWithGoogleCredential(
box.read(BoxName.driverID).toString(), box.read(BoxName.driverID).toString(),
box.read(BoxName.emailDriver).toString(), box.read(BoxName.emailDriver).toString(),
@@ -262,8 +264,9 @@ class RegisterCaptainController extends GetxController {
await CRUD().post( await CRUD().post(
link: AppLink.sendVerifyOtpMessage, link: AppLink.sendVerifyOtpMessage,
payload: { payload: {
'phone_number': encryptionHelper.encryptData('+2$phoneNumber'), 'phone_number': EncryptionHelper.instance.encryptData('+2$phoneNumber'),
'token_code': encryptionHelper.encryptData(randomNumber.toString()), 'token_code':
EncryptionHelper.instance.encryptData(randomNumber.toString()),
'driverId': box.read(BoxName.driverID), 'driverId': box.read(BoxName.driverID),
'email': box.read(BoxName.emailDriver), 'email': box.read(BoxName.emailDriver),
}, },
@@ -282,13 +285,14 @@ class RegisterCaptainController extends GetxController {
if (formKey3.currentState!.validate()) { if (formKey3.currentState!.validate()) {
var res = await CRUD().post(link: AppLink.verifyOtpDriver, payload: { var res = await CRUD().post(link: AppLink.verifyOtpDriver, payload: {
'phone_number': 'phone_number':
encryptionHelper.encryptData('+2${phoneController.text}'), EncryptionHelper.instance.encryptData('+2${phoneController.text}'),
'token_code': encryptionHelper.encryptData(verifyCode.text.toString()), 'token_code':
EncryptionHelper.instance.encryptData(verifyCode.text.toString()),
}); });
if (res != 'failure') { if (res != 'failure') {
// var dec = jsonDecode(res); // var dec = jsonDecode(res);
box.write(BoxName.phoneDriver, box.write(BoxName.phoneDriver,
encryptionHelper.encryptData('+2${phoneController.text}')); EncryptionHelper.instance.encryptData('+2${phoneController.text}'));
box.write(BoxName.phoneVerified, '1'); box.write(BoxName.phoneVerified, '1');
// loginDriverController.isGoogleLogin == true // loginDriverController.isGoogleLogin == true
@@ -313,10 +317,10 @@ class RegisterCaptainController extends GetxController {
sendVerifications() async { sendVerifications() async {
var res = await CRUD().post(link: AppLink.verifyEmail, payload: { var res = await CRUD().post(link: AppLink.verifyEmail, payload: {
'email': emailController.text.isEmpty 'email': emailController.text.isEmpty
? encryptionHelper.encryptData( ? EncryptionHelper.instance.encryptData(
Get.find<LoginDriverController>().emailController.text.toString()) Get.find<LoginDriverController>().emailController.text.toString())
: encryptionHelper.encryptData(emailController.text), : EncryptionHelper.instance.encryptData(emailController.text),
'token': encryptionHelper.encryptData(verifyCode.text), 'token': EncryptionHelper.instance.encryptData(verifyCode.text),
}); });
if (res != 'failure') { if (res != 'failure') {

View File

@@ -126,7 +126,7 @@ class GoogleSignInHelper {
box.write(BoxName.driverID, box.write(BoxName.driverID,
(user.id) ?? 'Unknown ID'); // Ensure there's a fallback value (user.id) ?? 'Unknown ID'); // Ensure there's a fallback value
box.write(BoxName.emailDriver, box.write(BoxName.emailDriver,
encryptionHelper.encryptData(user.email) ?? 'Unknown Email'); EncryptionHelper.instance.encryptData(user.email) ?? 'Unknown Email');
} }
// Method to handle Google Sign-Out // Method to handle Google Sign-Out

View File

@@ -71,7 +71,8 @@ class FirebaseMessagesController extends GetxController {
Future getToken() async { Future getToken() async {
fcmToken.getToken().then((token) { fcmToken.getToken().then((token) {
// Log.print('token: ${token}'); // Log.print('token: ${token}');
box.write(BoxName.tokenDriver, encryptionHelper.encryptData(token!)); box.write(
BoxName.tokenDriver, EncryptionHelper.instance.encryptData(token!));
}); });
FirebaseMessaging.onMessage.listen((RemoteMessage message) { FirebaseMessaging.onMessage.listen((RemoteMessage message) {
@@ -400,6 +401,25 @@ class FirebaseMessagesController extends GetxController {
})); }));
} }
late String serviceAccountKeyJson;
@override
Future<void> onInit() async {
super.onInit();
try {
var encryptedKey = await storage.read(key: 'FCM_PRIVATE_KEY');
// Log.print('encryptedKey: ${encryptedKey}');
if (encryptedKey != null) {
serviceAccountKeyJson =
EncryptionHelper.instance.decryptData(encryptedKey);
// Log.print('serviceAccountKeyJson: ${serviceAccountKeyJson}');
} else {
print('🔴 Error: FCM_PRIVATE_KEY not found in Secure Storage');
}
} catch (e) {
print('🔴 Error decrypting FCM key: $e');
}
}
void sendNotificationAll(String title, body, tone) async { void sendNotificationAll(String title, body, tone) async {
// Get the token you want to subtract. // Get the token you want to subtract.
String token = box.read(BoxName.tokenFCM); String token = box.read(BoxName.tokenFCM);
@@ -411,26 +431,16 @@ class FirebaseMessagesController extends GetxController {
// box.write(BoxName.tokens, tokens); // box.write(BoxName.tokens, tokens);
tokens = box.read(BoxName.tokens); tokens = box.read(BoxName.tokens);
for (var i = 0; i < tokens.length; i++) { for (var i = 0; i < tokens.length; i++) {
String serviceAccountKeyJson = '''{ if (serviceAccountKeyJson.isEmpty) {
"type": "service_account", print("🔴 Error: Service Account Key is empty");
"project_id": "ride-b1bd8", return;
"private_key_id": "75e817c0b902db2ef35edf2c2bd159dec1f13249", }
"private_key": "-----BEGIN PRIVATE KEY-----\\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD0zH9TQGDQHUv3\\na3/JAD1UKPwAp3wNKT0a6fxiIzjI3JxQWI30QvZCcfl6CdMhIcydX1ncSaYTcEeC\\n/AdPVCPkqyJx1YIGGg6P/mRzCWeaN8fsp6z250m5vcObDCZc3dbJEkepbep+6FPY\\n21m3KO+AHh1glgsTGZOTm5xiU8NGXpdk2QEh8wpiIIlR/HuKwVw9g8urNe3Sno+U\\nDm3z37iFqvZdmpqO8aWTJu6beb3hsREK9XK2I9JqC2JUwiGQRo3idOvPP6hkqrWx\\nKSX96vglQFYfakvJdDp2ZATOlpBYPMtS/IWhJ985u58TSS+Kl8qpnpaZBSxgJirf\\nhWzhnKLfAgMBAAECggEAJP785SePGhS7ZN6ltspm+l+hSjYFrPWFCxq+rlQ1YkHZ\\nC9l+RqKSFhOkiPmQI2s4wbXl3kFxLHHlFNoi/q2wKQBmGb8TQfnRJpjjNHGA61Ev\\n0Ue7/6qPvVb9B2MsLw/FxKiTFPuMG3bgKR9pbSFuJLYoaW7zqITOhVnYphGTqwAY\\nBVVcvISSLvELDmH9VZcv/9DVqVlqbbESHWh1Z4W6XGPoEqeDH/upNTyQQ/46Msgm\\nTGE6VqLHpWuSf6SqHp+r0Y0lI3vIPM1vz5FAJDJbOE/enHa0fSup0OHSMxl0HVMn\\nnO1yrGF3vsIPOej5HKr5d71bEIckzk73/yjNC1/mDQKBgQD7RtUvc9omsSsFMJ6e\\nBASAn6Dktx/QY/XNJjFzHQj69cywLDe5t5AL2gUi3phQ2oqB5XJdwnd5bTIEPEPZ\\nDOuOai2802p6FJk6kjmZAMVGx5JtXBH+vs6jrmQQSMiKbjwN1TT6xIWakvLOonUi\\nX6ZvjYYjU/E0YJU3jSiXWEr76wKBgQD5Zn4SouJ6BCDZMbausJVMBkk3qxsYooip\\np89WakC6e7AZinpkRcqjGGV9GOvc8crJs6fyXAA9ORepGP47Mc0ZrDssOkstznsM\\npr8R0S6MKwEZaT9ixOHdOcLZ47ps+JzA2Wr4KN2OvFHksUkB/46ATD1j9WZVgB8M\\namsYp/Y73QKBgHOo+PvsoZ9psVmkNX6abtAdqdtdB0HOoRea2uwXk0ig12TIFaZg\\nfedWpUKVnxqoXVTJHklV99RmlL0qWDiSH+LfsMnXro0e6iDxqZ1po2Se/CFmXcoa\\nXdctsFVmixhdATuExewfhTfPKABA+xWlXWC/jdy5CK+JPWXijaqMM4edAoGAE5Bj\\nsWiPpYyvWvpYX0nA3G7dzX0hqgQN/mkIjbnWDArp3IcNZNJIvBSM2Yxb7EAXbU0n\\njo6DAkp5Pa2VO+WDNlFZbvW/sf8xjeOCt44WPa6d7nVgIIpbQXRngZoopKW3/jTP\\n/FmQT8McFXmGxZ5belsAsdetSGW9icbLUerTGQ0CgYEAmf/G8Ag3XxmqTXvvHuv2\\n14OP7WnrVqkEMnydrftEwn4peXd/Lz+/GYX5Zc4ZoNgbN8IvZ5z0+OmRsallsbiW\\nBw0/tc68CjzxXOvReWxDluUopqWVGj5tlGqE5xUDku9SWJSxbkiQ3rqutzBdPXpr\\noqHwPyDrmK/Zgqn+uiIm4Ck=\\n-----END PRIVATE KEY-----\\n",
"client_email": "firebase-adminsdk-o2wqi@ride-b1bd8.iam.gserviceaccount.com",
"client_id": "111210077025005706623",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-o2wqi%40ride-b1bd8.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
'''; // As defined above
// Initialize AccessTokenManager // Initialize AccessTokenManager
final accessTokenManager = AccessTokenManager(serviceAccountKeyJson); final accessTokenManager = AccessTokenManager(serviceAccountKeyJson);
// Obtain an OAuth 2.0 access token // Obtain an OAuth 2.0 access token
final accessToken = await accessTokenManager.getAccessToken(); final accessToken = await accessTokenManager.getAccessToken();
// Log.print('accessToken: ${accessToken}');
// Send the notification // Send the notification
final response = await http final response = await http
@@ -479,26 +489,16 @@ class FirebaseMessagesController extends GetxController {
String title, body, token, List<String> map, String tone, String title, body, token, List<String> map, String tone,
{int retryCount = 2}) async { {int retryCount = 2}) async {
try { try {
String serviceAccountKeyJson = '''{ if (serviceAccountKeyJson.isEmpty) {
"type": "service_account", print("🔴 Error: Service Account Key is empty");
"project_id": "ride-b1bd8", return;
"private_key_id": "75e817c0b902db2ef35edf2c2bd159dec1f13249", }
"private_key": "-----BEGIN PRIVATE KEY-----\\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD0zH9TQGDQHUv3\\na3/JAD1UKPwAp3wNKT0a6fxiIzjI3JxQWI30QvZCcfl6CdMhIcydX1ncSaYTcEeC\\n/AdPVCPkqyJx1YIGGg6P/mRzCWeaN8fsp6z250m5vcObDCZc3dbJEkepbep+6FPY\\n21m3KO+AHh1glgsTGZOTm5xiU8NGXpdk2QEh8wpiIIlR/HuKwVw9g8urNe3Sno+U\\nDm3z37iFqvZdmpqO8aWTJu6beb3hsREK9XK2I9JqC2JUwiGQRo3idOvPP6hkqrWx\\nKSX96vglQFYfakvJdDp2ZATOlpBYPMtS/IWhJ985u58TSS+Kl8qpnpaZBSxgJirf\\nhWzhnKLfAgMBAAECggEAJP785SePGhS7ZN6ltspm+l+hSjYFrPWFCxq+rlQ1YkHZ\\nC9l+RqKSFhOkiPmQI2s4wbXl3kFxLHHlFNoi/q2wKQBmGb8TQfnRJpjjNHGA61Ev\\n0Ue7/6qPvVb9B2MsLw/FxKiTFPuMG3bgKR9pbSFuJLYoaW7zqITOhVnYphGTqwAY\\nBVVcvISSLvELDmH9VZcv/9DVqVlqbbESHWh1Z4W6XGPoEqeDH/upNTyQQ/46Msgm\\nTGE6VqLHpWuSf6SqHp+r0Y0lI3vIPM1vz5FAJDJbOE/enHa0fSup0OHSMxl0HVMn\\nnO1yrGF3vsIPOej5HKr5d71bEIckzk73/yjNC1/mDQKBgQD7RtUvc9omsSsFMJ6e\\nBASAn6Dktx/QY/XNJjFzHQj69cywLDe5t5AL2gUi3phQ2oqB5XJdwnd5bTIEPEPZ\\nDOuOai2802p6FJk6kjmZAMVGx5JtXBH+vs6jrmQQSMiKbjwN1TT6xIWakvLOonUi\\nX6ZvjYYjU/E0YJU3jSiXWEr76wKBgQD5Zn4SouJ6BCDZMbausJVMBkk3qxsYooip\\np89WakC6e7AZinpkRcqjGGV9GOvc8crJs6fyXAA9ORepGP47Mc0ZrDssOkstznsM\\npr8R0S6MKwEZaT9ixOHdOcLZ47ps+JzA2Wr4KN2OvFHksUkB/46ATD1j9WZVgB8M\\namsYp/Y73QKBgHOo+PvsoZ9psVmkNX6abtAdqdtdB0HOoRea2uwXk0ig12TIFaZg\\nfedWpUKVnxqoXVTJHklV99RmlL0qWDiSH+LfsMnXro0e6iDxqZ1po2Se/CFmXcoa\\nXdctsFVmixhdATuExewfhTfPKABA+xWlXWC/jdy5CK+JPWXijaqMM4edAoGAE5Bj\\nsWiPpYyvWvpYX0nA3G7dzX0hqgQN/mkIjbnWDArp3IcNZNJIvBSM2Yxb7EAXbU0n\\njo6DAkp5Pa2VO+WDNlFZbvW/sf8xjeOCt44WPa6d7nVgIIpbQXRngZoopKW3/jTP\\n/FmQT8McFXmGxZ5belsAsdetSGW9icbLUerTGQ0CgYEAmf/G8Ag3XxmqTXvvHuv2\\n14OP7WnrVqkEMnydrftEwn4peXd/Lz+/GYX5Zc4ZoNgbN8IvZ5z0+OmRsallsbiW\\nBw0/tc68CjzxXOvReWxDluUopqWVGj5tlGqE5xUDku9SWJSxbkiQ3rqutzBdPXpr\\noqHwPyDrmK/Zgqn+uiIm4Ck=\\n-----END PRIVATE KEY-----\\n",
"client_email": "firebase-adminsdk-o2wqi@ride-b1bd8.iam.gserviceaccount.com",
"client_id": "111210077025005706623",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-o2wqi%40ride-b1bd8.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
'''; // As defined above
// Initialize AccessTokenManager // Initialize AccessTokenManager
final accessTokenManager = AccessTokenManager(serviceAccountKeyJson); final accessTokenManager = AccessTokenManager(serviceAccountKeyJson);
// Obtain an OAuth 2.0 access token // Obtain an OAuth 2.0 access token
final accessToken = await accessTokenManager.getAccessToken(); final accessToken = await accessTokenManager.getAccessToken();
// Log.print('accessToken: ${accessToken}');
// Send the notification // Send the notification
final response = await http.post( final response = await http.post(
@@ -571,26 +571,16 @@ class FirebaseMessagesController extends GetxController {
String title, body, token, List<String> map, String tone, String title, body, token, List<String> map, String tone,
{int retryCount = 2}) async { {int retryCount = 2}) async {
try { try {
String serviceAccountKeyJson = '''{ if (serviceAccountKeyJson.isEmpty) {
"type": "service_account", print("🔴 Error: Service Account Key is empty");
"project_id": "ride-b1bd8", return;
"private_key_id": "75e817c0b902db2ef35edf2c2bd159dec1f13249", }
"private_key": "-----BEGIN PRIVATE KEY-----\\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD0zH9TQGDQHUv3\\na3/JAD1UKPwAp3wNKT0a6fxiIzjI3JxQWI30QvZCcfl6CdMhIcydX1ncSaYTcEeC\\n/AdPVCPkqyJx1YIGGg6P/mRzCWeaN8fsp6z250m5vcObDCZc3dbJEkepbep+6FPY\\n21m3KO+AHh1glgsTGZOTm5xiU8NGXpdk2QEh8wpiIIlR/HuKwVw9g8urNe3Sno+U\\nDm3z37iFqvZdmpqO8aWTJu6beb3hsREK9XK2I9JqC2JUwiGQRo3idOvPP6hkqrWx\\nKSX96vglQFYfakvJdDp2ZATOlpBYPMtS/IWhJ985u58TSS+Kl8qpnpaZBSxgJirf\\nhWzhnKLfAgMBAAECggEAJP785SePGhS7ZN6ltspm+l+hSjYFrPWFCxq+rlQ1YkHZ\\nC9l+RqKSFhOkiPmQI2s4wbXl3kFxLHHlFNoi/q2wKQBmGb8TQfnRJpjjNHGA61Ev\\n0Ue7/6qPvVb9B2MsLw/FxKiTFPuMG3bgKR9pbSFuJLYoaW7zqITOhVnYphGTqwAY\\nBVVcvISSLvELDmH9VZcv/9DVqVlqbbESHWh1Z4W6XGPoEqeDH/upNTyQQ/46Msgm\\nTGE6VqLHpWuSf6SqHp+r0Y0lI3vIPM1vz5FAJDJbOE/enHa0fSup0OHSMxl0HVMn\\nnO1yrGF3vsIPOej5HKr5d71bEIckzk73/yjNC1/mDQKBgQD7RtUvc9omsSsFMJ6e\\nBASAn6Dktx/QY/XNJjFzHQj69cywLDe5t5AL2gUi3phQ2oqB5XJdwnd5bTIEPEPZ\\nDOuOai2802p6FJk6kjmZAMVGx5JtXBH+vs6jrmQQSMiKbjwN1TT6xIWakvLOonUi\\nX6ZvjYYjU/E0YJU3jSiXWEr76wKBgQD5Zn4SouJ6BCDZMbausJVMBkk3qxsYooip\\np89WakC6e7AZinpkRcqjGGV9GOvc8crJs6fyXAA9ORepGP47Mc0ZrDssOkstznsM\\npr8R0S6MKwEZaT9ixOHdOcLZ47ps+JzA2Wr4KN2OvFHksUkB/46ATD1j9WZVgB8M\\namsYp/Y73QKBgHOo+PvsoZ9psVmkNX6abtAdqdtdB0HOoRea2uwXk0ig12TIFaZg\\nfedWpUKVnxqoXVTJHklV99RmlL0qWDiSH+LfsMnXro0e6iDxqZ1po2Se/CFmXcoa\\nXdctsFVmixhdATuExewfhTfPKABA+xWlXWC/jdy5CK+JPWXijaqMM4edAoGAE5Bj\\nsWiPpYyvWvpYX0nA3G7dzX0hqgQN/mkIjbnWDArp3IcNZNJIvBSM2Yxb7EAXbU0n\\njo6DAkp5Pa2VO+WDNlFZbvW/sf8xjeOCt44WPa6d7nVgIIpbQXRngZoopKW3/jTP\\n/FmQT8McFXmGxZ5belsAsdetSGW9icbLUerTGQ0CgYEAmf/G8Ag3XxmqTXvvHuv2\\n14OP7WnrVqkEMnydrftEwn4peXd/Lz+/GYX5Zc4ZoNgbN8IvZ5z0+OmRsallsbiW\\nBw0/tc68CjzxXOvReWxDluUopqWVGj5tlGqE5xUDku9SWJSxbkiQ3rqutzBdPXpr\\noqHwPyDrmK/Zgqn+uiIm4Ck=\\n-----END PRIVATE KEY-----\\n",
"client_email": "firebase-adminsdk-o2wqi@ride-b1bd8.iam.gserviceaccount.com",
"client_id": "111210077025005706623",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-o2wqi%40ride-b1bd8.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
'''; // As defined above
// Initialize AccessTokenManager // Initialize AccessTokenManager
final accessTokenManager = AccessTokenManager(serviceAccountKeyJson); final accessTokenManager = AccessTokenManager(serviceAccountKeyJson);
// Obtain an OAuth 2.0 access token // Obtain an OAuth 2.0 access token
final accessToken = await accessTokenManager.getAccessToken(); final accessToken = await accessTokenManager.getAccessToken();
// Log.print('accessToken: ${accessToken}');
// Send the notification // Send the notification
final response = await http.post( final response = await http.post(
@@ -666,26 +656,16 @@ class FirebaseMessagesController extends GetxController {
{int retryCount = 2}) async { {int retryCount = 2}) async {
try { try {
final privateKey = await storage.read(key: 'FCM_PRIVATE_KEY'); final privateKey = await storage.read(key: 'FCM_PRIVATE_KEY');
String serviceAccountKeyJson = '''{ if (serviceAccountKeyJson.isEmpty) {
"type": "service_account", print("🔴 Error: Service Account Key is empty");
"project_id": "ride-b1bd8", return;
"private_key_id": "75e817c0b902db2ef35edf2c2bd159dec1f13249", }
"private_key": "-----BEGIN PRIVATE KEY-----\\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD0zH9TQGDQHUv3\\na3/JAD1UKPwAp3wNKT0a6fxiIzjI3JxQWI30QvZCcfl6CdMhIcydX1ncSaYTcEeC\\n/AdPVCPkqyJx1YIGGg6P/mRzCWeaN8fsp6z250m5vcObDCZc3dbJEkepbep+6FPY\\n21m3KO+AHh1glgsTGZOTm5xiU8NGXpdk2QEh8wpiIIlR/HuKwVw9g8urNe3Sno+U\\nDm3z37iFqvZdmpqO8aWTJu6beb3hsREK9XK2I9JqC2JUwiGQRo3idOvPP6hkqrWx\\nKSX96vglQFYfakvJdDp2ZATOlpBYPMtS/IWhJ985u58TSS+Kl8qpnpaZBSxgJirf\\nhWzhnKLfAgMBAAECggEAJP785SePGhS7ZN6ltspm+l+hSjYFrPWFCxq+rlQ1YkHZ\\nC9l+RqKSFhOkiPmQI2s4wbXl3kFxLHHlFNoi/q2wKQBmGb8TQfnRJpjjNHGA61Ev\\n0Ue7/6qPvVb9B2MsLw/FxKiTFPuMG3bgKR9pbSFuJLYoaW7zqITOhVnYphGTqwAY\\nBVVcvISSLvELDmH9VZcv/9DVqVlqbbESHWh1Z4W6XGPoEqeDH/upNTyQQ/46Msgm\\nTGE6VqLHpWuSf6SqHp+r0Y0lI3vIPM1vz5FAJDJbOE/enHa0fSup0OHSMxl0HVMn\\nnO1yrGF3vsIPOej5HKr5d71bEIckzk73/yjNC1/mDQKBgQD7RtUvc9omsSsFMJ6e\\nBASAn6Dktx/QY/XNJjFzHQj69cywLDe5t5AL2gUi3phQ2oqB5XJdwnd5bTIEPEPZ\\nDOuOai2802p6FJk6kjmZAMVGx5JtXBH+vs6jrmQQSMiKbjwN1TT6xIWakvLOonUi\\nX6ZvjYYjU/E0YJU3jSiXWEr76wKBgQD5Zn4SouJ6BCDZMbausJVMBkk3qxsYooip\\np89WakC6e7AZinpkRcqjGGV9GOvc8crJs6fyXAA9ORepGP47Mc0ZrDssOkstznsM\\npr8R0S6MKwEZaT9ixOHdOcLZ47ps+JzA2Wr4KN2OvFHksUkB/46ATD1j9WZVgB8M\\namsYp/Y73QKBgHOo+PvsoZ9psVmkNX6abtAdqdtdB0HOoRea2uwXk0ig12TIFaZg\\nfedWpUKVnxqoXVTJHklV99RmlL0qWDiSH+LfsMnXro0e6iDxqZ1po2Se/CFmXcoa\\nXdctsFVmixhdATuExewfhTfPKABA+xWlXWC/jdy5CK+JPWXijaqMM4edAoGAE5Bj\\nsWiPpYyvWvpYX0nA3G7dzX0hqgQN/mkIjbnWDArp3IcNZNJIvBSM2Yxb7EAXbU0n\\njo6DAkp5Pa2VO+WDNlFZbvW/sf8xjeOCt44WPa6d7nVgIIpbQXRngZoopKW3/jTP\\n/FmQT8McFXmGxZ5belsAsdetSGW9icbLUerTGQ0CgYEAmf/G8Ag3XxmqTXvvHuv2\\n14OP7WnrVqkEMnydrftEwn4peXd/Lz+/GYX5Zc4ZoNgbN8IvZ5z0+OmRsallsbiW\\nBw0/tc68CjzxXOvReWxDluUopqWVGj5tlGqE5xUDku9SWJSxbkiQ3rqutzBdPXpr\\noqHwPyDrmK/Zgqn+uiIm4Ck=\\n-----END PRIVATE KEY-----\\n",
"client_email": "firebase-adminsdk-o2wqi@ride-b1bd8.iam.gserviceaccount.com",
"client_id": "111210077025005706623",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-o2wqi%40ride-b1bd8.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
'''; // As defined above
// Initialize AccessTokenManager // Initialize AccessTokenManager
final accessTokenManager = AccessTokenManager(serviceAccountKeyJson); final accessTokenManager = AccessTokenManager(serviceAccountKeyJson);
// Obtain an OAuth 2.0 access token // Obtain an OAuth 2.0 access token
final accessToken = await accessTokenManager.getAccessToken(); final accessToken = await accessTokenManager.getAccessToken();
// Log.print('accessToken: ${accessToken}');
// Send the notification // Send the notification
final response = await http.post( final response = await http.post(

View File

@@ -1,12 +1,18 @@
import 'dart:convert'; import 'dart:convert';
import 'package:secure_string_operations/secure_string_operations.dart';
import 'package:sefer_driver/constant/box_name.dart'; import 'package:sefer_driver/constant/box_name.dart';
import 'package:sefer_driver/constant/links.dart'; import 'package:sefer_driver/constant/links.dart';
import 'package:sefer_driver/controller/auth/captin/login_captin_controller.dart';
import 'package:sefer_driver/controller/functions/add_error.dart';
import 'package:sefer_driver/main.dart'; import 'package:sefer_driver/main.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:sefer_driver/env/env.dart'; import 'package:sefer_driver/env/env.dart';
import 'package:sefer_driver/views/widgets/error_snakbar.dart';
import '../../constant/api_key.dart'; import '../../constant/api_key.dart';
import '../../constant/char_map.dart';
import '../../constant/info.dart';
import '../../print.dart'; import '../../print.dart';
import 'gemeni.dart'; import 'gemeni.dart';
import 'upload_image.dart'; import 'upload_image.dart';
@@ -25,28 +31,43 @@ class CRUD {
headers: { headers: {
"Content-Type": "application/x-www-form-urlencoded", "Content-Type": "application/x-www-form-urlencoded",
'Authorization': 'Authorization':
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials.toString()))}', 'Bearer ${X.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs).toString().split(AppInformation.addd)[0]}'
}, },
); );
Log.print('request: ${response.request}'); if (response.statusCode == 200) {
Log.print('response: ${response.body}'); var jsonData = jsonDecode(response.body);
Log.print('payload: ${payload}'); if (jsonData['status'] == 'success') {
// if (response.statusCode == 200) { return response.body;
var jsonData = jsonDecode(response.body); }
if (jsonData['status'] == 'success') {
return response.body;
}
return jsonData['status']; return jsonData['status'];
} else if (response.statusCode == 401) {
// Specifically handle 401 Unauthorized
var jsonData = jsonDecode(response.body);
if (jsonData['error'] == 'Token expired') {
// Show snackbar prompting to re-login
await Get.put(LoginDriverController()).getJWT();
mySnackbarSuccess('please order now'.tr);
return 'token_expired'; // Return a specific value for token expiration
} else {
// Other 401 errors
addError('Unauthorized: ${jsonData['error']}', 'crud().post - 401');
return 'failure';
}
} else {
addError('Non-200 response code: ${response.statusCode}',
'crud().post - Other');
return 'failure';
}
} }
// } Future<dynamic> getWallet({
Future<dynamic> post({
required String link, required String link,
Map<String, dynamic>? payload, Map<String, dynamic>? payload,
}) async { }) async {
// String? basicAuthCredentials = var s = await LoginDriverController().getJwtWallet();
// await storage.read(key: BoxName.basicAuthCredentials);
var url = Uri.parse( var url = Uri.parse(
link, link,
); );
@@ -55,25 +76,94 @@ class CRUD {
body: payload, body: payload,
headers: { headers: {
"Content-Type": "application/x-www-form-urlencoded", "Content-Type": "application/x-www-form-urlencoded",
'Authorization': 'Authorization': 'Bearer $s'
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
}, },
); );
Log.print('request: ${response.request}');
Log.print('response: ${response.body}');
Log.print('payload: ${payload}');
var jsonData = jsonDecode(response.body);
if (response.statusCode == 200) { if (response.statusCode == 200) {
var jsonData = jsonDecode(response.body);
if (jsonData['status'] == 'success') { if (jsonData['status'] == 'success') {
return response.body; return response.body;
}
return jsonData['status'];
} else if (response.statusCode == 401) {
// Specifically handle 401 Unauthorized
var jsonData = jsonDecode(response.body);
if (jsonData['error'] == 'Token expired') {
// Show snackbar prompting to re-login
await Get.put(LoginDriverController()).getJwtWallet();
return 'token_expired'; // Return a specific value for token expiration
} else { } else {
// String errorMessage = jsonData['message']; // Other 401 errors
// Get.snackbar('Error'.tr, errorMessage.tr, addError('Unauthorized: ${jsonData['error']}', 'crud().post - 401');
// backgroundColor: AppColor.redColor); return 'failure';
return (jsonData['status']);
} }
} else { } else {
return response.statusCode; addError('Non-200 response code: ${response.statusCode}',
'crud().post - Other');
return 'failure';
}
}
Future<dynamic> post(
{required String link, Map<String, dynamic>? payload}) async {
var url = Uri.parse(link);
try {
var response = await http.post(
url,
body: payload,
headers: {
"Content-Type": "application/x-www-form-urlencoded",
'Authorization':
'Bearer ${X.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs).toString().split(AppInformation.addd)[0]}'
// 'Authorization': 'Bearer ${box.read(BoxName.jwt)}'
},
);
if (response.statusCode == 200) {
try {
var jsonData = jsonDecode(response.body);
if (jsonData['status'] == 'success') {
return jsonData;
} else {
return jsonData['status'];
}
} catch (e) {
addError(e.toString(), 'crud().post - JSON decoding');
return 'failure';
}
} else if (response.statusCode == 401) {
// Specifically handle 401 Unauthorized
var jsonData = jsonDecode(response.body);
if (jsonData['error'] == 'Token expired') {
// Show snackbar prompting to re-login
await Get.put(LoginDriverController()).getJWT();
// MyDialog().getDialog(
// 'Session expired. Please log in again.'.tr,
// '',
// () {
// Get.put(LoginController()).loginUsingCredentials(
// box.read(BoxName.passengerID), box.read(BoxName.email));
// Get.back();
// },
// );
return 'token_expired'; // Return a specific value for token expiration
} else {
// Other 401 errors
addError('Unauthorized: ${jsonData['error']}', 'crud().post - 401');
return 'failure';
}
} else {
addError('Non-200 response code: ${response.statusCode}',
'crud().post - Other');
return 'failure';
}
} catch (e) {
addError('HTTP request error: $e', 'crud().post - HTTP');
return 'failure';
} }
} }

View File

@@ -1,34 +1,50 @@
import 'package:encrypt/encrypt.dart' as encrypt; import 'package:encrypt/encrypt.dart' as encrypt;
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import '../../env/env.dart'; import '../../constant/box_name.dart';
import '../../main.dart';
var secretKey = Env.keyOfApp
.toString()
.split('XrXlBl')[0]; // Must be 16 characters for AES-128
String initializationVector = Env.initializationVector; // Must be 16 characters
final encryptionHelper = EncryptionHelper(
secretKey: secretKey,
initializationVector: initializationVector,
);
class EncryptionHelper { class EncryptionHelper {
final encrypt.Key key; static EncryptionHelper? _instance;
final encrypt.IV iv;
EncryptionHelper( late final encrypt.Key key;
{required String secretKey, required String initializationVector}) late final encrypt.IV iv;
: key = encrypt.Key.fromUtf8(secretKey),
iv = encrypt.IV.fromUtf8(initializationVector);
// Initialize the helper EncryptionHelper._(this.key, this.iv);
static EncryptionHelper get instance {
if (_instance == null) {
throw Exception(
"EncryptionHelper is not initialized. Call `await EncryptionHelper.initialize()` in main.");
}
return _instance!;
}
/// Encrypts the given plain text /// Initializes and stores the instance globally
static Future<void> initialize() async {
if (_instance != null) {
debugPrint("EncryptionHelper is already initialized.");
return; // Prevent re-initialization
}
debugPrint("Initializing EncryptionHelper...");
// Read stored keys
String? keyOfApp = await storage.read(key: BoxName.keyOfApp);
// Log.print('keyOfApp: ${keyOfApp}');
String? initializationVector =
await storage.read(key: BoxName.initializationVector);
// Log.print('initializationVector: ${initializationVector}');
// Set the global instance
_instance = EncryptionHelper._(
encrypt.Key.fromUtf8(keyOfApp!),
encrypt.IV.fromUtf8(initializationVector!),
);
debugPrint("EncryptionHelper initialized successfully.");
}
/// Encrypts a string
String encryptData(String plainText) { String encryptData(String plainText) {
try { try {
final encrypter = encrypt.Encrypter(encrypt.AES(key, final encrypter =
mode: encrypt.AESMode.cbc)); // Explicitly use CBC mode encrypt.Encrypter(encrypt.AES(key, mode: encrypt.AESMode.cbc));
final encrypted = encrypter.encrypt(plainText, iv: iv); final encrypted = encrypter.encrypt(plainText, iv: iv);
return encrypted.base64; return encrypted.base64;
} catch (e) { } catch (e) {
@@ -37,14 +53,13 @@ class EncryptionHelper {
} }
} }
/// Decrypts the given encrypted text /// Decrypts a string
String decryptData(String encryptedText) { String decryptData(String encryptedText) {
try { try {
final encrypter = encrypt.Encrypter(encrypt.AES(key, final encrypter =
mode: encrypt.AESMode.cbc)); // Explicitly use CBC mode encrypt.Encrypter(encrypt.AES(key, mode: encrypt.AESMode.cbc));
final encrypted = encrypt.Encrypted.fromBase64(encryptedText); final encrypted = encrypt.Encrypted.fromBase64(encryptedText);
final decrypted = encrypter.decrypt(encrypted, iv: iv); return encrypter.decrypt(encrypted, iv: iv);
return decrypted;
} catch (e) { } catch (e) {
debugPrint('Decryption Error: $e'); debugPrint('Decryption Error: $e');
return ''; return '';

View File

@@ -24,9 +24,9 @@ Future<String> faceDetector() async {
request.body = json.encode({ request.body = json.encode({
"url1": "url1":
"${AppLink.seferCairoServer}/card_image/id_front-${encryptionHelper.decryptData(box.read(BoxName.driverID))}.jpg", "${AppLink.seferCairoServer}/card_image/id_front-${EncryptionHelper.instance.decryptData(box.read(BoxName.driverID))}.jpg",
"url2": "url2":
"https://api.sefer.live/sefer/card_image/face_detect-${encryptionHelper.decryptData(box.read(BoxName.driverID))}.jpg" "https://api.sefer.live/sefer/card_image/face_detect-${EncryptionHelper.instance.decryptData(box.read(BoxName.driverID))}.jpg"
}); });
print('request.body: ${request.body}'); print('request.body: ${request.body}');
request.headers.addAll(headers); request.headers.addAll(headers);

View File

@@ -394,10 +394,10 @@ class AI extends GetxController {
update(); update();
var payload = { var payload = {
'first_name': encryptionHelper.encryptData( 'first_name': EncryptionHelper.instance.encryptData(
responseNonIdCardFront['full_name'].toString().split(' ')[0]) ?? responseNonIdCardFront['full_name'].toString().split(' ')[0]) ??
'Not specified', 'Not specified',
'last_name': encryptionHelper.encryptData( 'last_name': EncryptionHelper.instance.encryptData(
responseNonIdCardFront['full_name'].toString().split(' ').last) ?? responseNonIdCardFront['full_name'].toString().split(' ').last) ??
'Not specified', 'Not specified',
'email': box.read(BoxName.emailDriver)?.toString() ?? 'Not specified', 'email': box.read(BoxName.emailDriver)?.toString() ?? 'Not specified',
@@ -410,14 +410,14 @@ class AI extends GetxController {
.passwordController .passwordController
.text .text
.toString(), .toString(),
'gender': encryptionHelper 'gender': EncryptionHelper.instance
.encryptData(responseNonIdCardFront['gender'].toString()) ?? .encryptData(responseNonIdCardFront['gender'].toString()) ??
'Not specified', 'Not specified',
'license_type': 'Foreign', 'license_type': 'Foreign',
'national_number': encryptionHelper 'national_number': EncryptionHelper.instance
.encryptData(responseNonIdCardFront['passport_no'].toString()) ?? .encryptData(responseNonIdCardFront['passport_no'].toString()) ??
'Not specified', 'Not specified',
'name_arabic': encryptionHelper 'name_arabic': EncryptionHelper.instance
.encryptData(responseNonIdCardFront['full_name'].toString()) ?? .encryptData(responseNonIdCardFront['full_name'].toString()) ??
'Not specified', 'Not specified',
'name_english': 'Not specified', 'name_english': 'Not specified',
@@ -431,30 +431,30 @@ class AI extends GetxController {
? responseIdEgyptDriverLicense['license_categories'].join(', ') ? responseIdEgyptDriverLicense['license_categories'].join(', ')
: responseIdEgyptDriverLicense['license_categories']?.toString() ?? : responseIdEgyptDriverLicense['license_categories']?.toString() ??
'Not specified', 'Not specified',
'address': encryptionHelper 'address': EncryptionHelper.instance
.encryptData(responseNonIdCardFront['address'].toString()) ?? .encryptData(responseNonIdCardFront['address'].toString()) ??
'Not specified', 'Not specified',
'card_id': encryptionHelper 'card_id': EncryptionHelper.instance
.encryptData(responseNonIdCardFront['card_id'].toString()) ?? .encryptData(responseNonIdCardFront['card_id'].toString()) ??
'Not specified', 'Not specified',
'occupation': encryptionHelper 'occupation': EncryptionHelper.instance
.encryptData(responseNonIdCardBack['workStatus'].toString()) ?? .encryptData(responseNonIdCardBack['workStatus'].toString()) ??
'Not specified', 'Not specified',
'education': 'Not specified', 'education': 'Not specified',
'licenseIssueDate': 'licenseIssueDate':
responseNonIdCardBack['issueDate']?.toString() ?? 'Not specified', responseNonIdCardBack['issueDate']?.toString() ?? 'Not specified',
'religion': encryptionHelper 'religion': EncryptionHelper.instance
.encryptData(responseNonIdCardFront['country'].toString()) ?? .encryptData(responseNonIdCardFront['country'].toString()) ??
'Not specified', 'Not specified',
'status': 'yet', 'status': 'yet',
'birthdate': encryptionHelper 'birthdate': EncryptionHelper.instance
.encryptData(responseNonIdCardFront['birthdate'].toString()) ?? .encryptData(responseNonIdCardFront['birthdate'].toString()) ??
'Not specified', 'Not specified',
'maritalStatus': 'Not specified', 'maritalStatus': 'Not specified',
'site': encryptionHelper 'site': EncryptionHelper.instance
.encryptData(responseNonIdCardFront['address'].toString()) ?? .encryptData(responseNonIdCardFront['address'].toString()) ??
'Not specified', 'Not specified',
'employmentType': encryptionHelper 'employmentType': EncryptionHelper.instance
.encryptData(responseNonIdCardBack['residencyType'].toString()) ?? .encryptData(responseNonIdCardBack['residencyType'].toString()) ??
'Not specified', 'Not specified',
}; };
@@ -499,10 +499,10 @@ class AI extends GetxController {
update(); update();
var payload = { var payload = {
'first_name': encryptionHelper.encryptData( 'first_name': EncryptionHelper.instance.encryptData(
responseIdEgyptDriverLicense['firstName'].toString()) ?? responseIdEgyptDriverLicense['firstName'].toString()) ??
'Not specified', 'Not specified',
'last_name': encryptionHelper.encryptData( 'last_name': EncryptionHelper.instance.encryptData(
responseIdEgyptDriverLicense['lastName'].toString()) ?? responseIdEgyptDriverLicense['lastName'].toString()) ??
'Not specified', 'Not specified',
'email': box.read(BoxName.emailDriver)?.toString() ?? 'Not specified', 'email': box.read(BoxName.emailDriver)?.toString() ?? 'Not specified',
@@ -515,18 +515,18 @@ class AI extends GetxController {
.passwordController .passwordController
.text .text
.toString(), .toString(),
'gender': encryptionHelper 'gender': EncryptionHelper.instance
.encryptData(responseIdEgyptBack['gender'].toString()) ?? .encryptData(responseIdEgyptBack['gender'].toString()) ??
'Not specified', 'Not specified',
'license_type': encryptionHelper.encryptData( 'license_type': EncryptionHelper.instance.encryptData(
responseIdEgyptDriverLicense['license_type'].toString()) ?? responseIdEgyptDriverLicense['license_type'].toString()) ??
'Not specified', 'Not specified',
'national_number': encryptionHelper 'national_number': EncryptionHelper.instance
.encryptData(responseIdEgyptBack['nationalID'].toString()) ?? .encryptData(responseIdEgyptBack['nationalID'].toString()) ??
'Not specified', 'Not specified',
'name_arabic': encryptionHelper 'name_arabic': EncryptionHelper.instance
.encryptData(responseIdEgyptDriverLicense['name_arabic'].toString()), .encryptData(responseIdEgyptDriverLicense['name_arabic'].toString()),
'name_english': encryptionHelper 'name_english': EncryptionHelper.instance
.encryptData(responseIdEgyptDriverLicense['name_english'].toString()), .encryptData(responseIdEgyptDriverLicense['name_english'].toString()),
'issue_date': responseIdEgyptDriverLicense['issue_date']?.toString() ?? 'issue_date': responseIdEgyptDriverLicense['issue_date']?.toString() ??
'Not specified', 'Not specified',
@@ -537,34 +537,34 @@ class AI extends GetxController {
? responseIdEgyptDriverLicense['license_categories'].join(', ') ? responseIdEgyptDriverLicense['license_categories'].join(', ')
: responseIdEgyptDriverLicense['license_categories']?.toString() ?? : responseIdEgyptDriverLicense['license_categories']?.toString() ??
'Not specified', 'Not specified',
'address': encryptionHelper 'address': EncryptionHelper.instance
.encryptData(responseIdEgyptFront['address'].toString()) ?? .encryptData(responseIdEgyptFront['address'].toString()) ??
'Not specified', 'Not specified',
'card_id': encryptionHelper 'card_id': EncryptionHelper.instance
.encryptData(responseIdEgyptFront['card_id'].toString()) ?? .encryptData(responseIdEgyptFront['card_id'].toString()) ??
'Not specified', 'Not specified',
'occupation': encryptionHelper 'occupation': EncryptionHelper.instance
.encryptData(responseIdEgyptBack['occupation'].toString()) ?? .encryptData(responseIdEgyptBack['occupation'].toString()) ??
'Not specified', 'Not specified',
'education': encryptionHelper 'education': EncryptionHelper.instance
.encryptData(responseIdEgyptBack['occupation'].toString()) ?? .encryptData(responseIdEgyptBack['occupation'].toString()) ??
'Not specified', 'Not specified',
'licenseIssueDate': 'licenseIssueDate':
responseIdEgyptDriverLicense['issue_date'].toString() ?? responseIdEgyptDriverLicense['issue_date'].toString() ??
'Not specified', 'Not specified',
'religion': encryptionHelper 'religion': EncryptionHelper.instance
.encryptData(responseIdEgyptBack['religion'].toString()) ?? .encryptData(responseIdEgyptBack['religion'].toString()) ??
'Not specified', 'Not specified',
'status': 'yet', 'status': 'yet',
'birthdate': encryptionHelper.encryptData(extractDOB( 'birthdate': EncryptionHelper.instance.encryptData(extractDOB(
responseIdEgyptDriverLicense['national_number'].toString())), responseIdEgyptDriverLicense['national_number'].toString())),
'maritalStatus': encryptionHelper 'maritalStatus': EncryptionHelper.instance
.encryptData(responseIdEgyptBack['maritalStatus'].toString()) ?? .encryptData(responseIdEgyptBack['maritalStatus'].toString()) ??
'Not specified', 'Not specified',
'site': encryptionHelper.encryptData( 'site': EncryptionHelper.instance.encryptData(
responseIdEgyptDriverLicense['address'].toString()) ?? responseIdEgyptDriverLicense['address'].toString()) ??
'Not specified', 'Not specified',
'employmentType': encryptionHelper.encryptData( 'employmentType': EncryptionHelper.instance.encryptData(
responseIdEgyptDriverLicense['employmentType'].toString()) ?? responseIdEgyptDriverLicense['employmentType'].toString()) ??
'Not specified', 'Not specified',
}; };
@@ -609,7 +609,7 @@ class AI extends GetxController {
var res = await CRUD().post(link: AppLink.addCriminalDocuments, payload: { var res = await CRUD().post(link: AppLink.addCriminalDocuments, payload: {
"driverId": box.read(BoxName.driverID), "driverId": box.read(BoxName.driverID),
"IssueDate": responseCriminalRecordEgypt['IssueDate'], "IssueDate": responseCriminalRecordEgypt['IssueDate'],
"InspectionResult": encryptionHelper "InspectionResult": EncryptionHelper.instance
.encryptData(responseCriminalRecordEgypt['InspectionResult']), .encryptData(responseCriminalRecordEgypt['InspectionResult']),
}); });
if (res != 'failure') { if (res != 'failure') {
@@ -624,7 +624,7 @@ class AI extends GetxController {
var res = await CRUD().post(link: AppLink.addRegisrationCar, payload: { var res = await CRUD().post(link: AppLink.addRegisrationCar, payload: {
'driverID': box.read(BoxName.driverID), 'driverID': box.read(BoxName.driverID),
'vin': responseIdCardDriverEgyptBack['chassis'].toString(), 'vin': responseIdCardDriverEgyptBack['chassis'].toString(),
'car_plate': encryptionHelper.encryptData( 'car_plate': EncryptionHelper.instance.encryptData(
responseIdCardDriverEgyptFront['car_plate'].toString()), responseIdCardDriverEgyptFront['car_plate'].toString()),
'make': (responseIdCardDriverEgyptBack['make'].toString()), 'make': (responseIdCardDriverEgyptBack['make'].toString()),
'model': (responseIdCardDriverEgyptBack['model']), 'model': (responseIdCardDriverEgyptBack['model']),
@@ -632,10 +632,10 @@ class AI extends GetxController {
'expiration_date': 'expiration_date':
responseIdCardDriverEgyptFront['LicenseExpirationDate'].toString(), responseIdCardDriverEgyptFront['LicenseExpirationDate'].toString(),
'color': responseIdCardDriverEgyptBack['color'], 'color': responseIdCardDriverEgyptBack['color'],
'owner': encryptionHelper 'owner': EncryptionHelper.instance
.encryptData(responseIdCardDriverEgyptFront['owner']), .encryptData(responseIdCardDriverEgyptFront['owner']),
'color_hex': responseIdCardDriverEgyptBack['color_hex'].toString(), 'color_hex': responseIdCardDriverEgyptBack['color_hex'].toString(),
'address': encryptionHelper 'address': EncryptionHelper.instance
.encryptData(responseIdCardDriverEgyptFront['address'].toString()), .encryptData(responseIdCardDriverEgyptFront['address'].toString()),
'displacement': responseIdCardDriverEgyptBack['engine'].toString(), 'displacement': responseIdCardDriverEgyptBack['engine'].toString(),
'fuel': responseIdCardDriverEgyptBack['fuel'].toString(), 'fuel': responseIdCardDriverEgyptBack['fuel'].toString(),
@@ -654,7 +654,7 @@ class AI extends GetxController {
payload: { payload: {
'driverID': box.read(BoxName.driverID), 'driverID': box.read(BoxName.driverID),
'vin': responseIdCardDriverEgyptBack['chassis'].toString(), 'vin': responseIdCardDriverEgyptBack['chassis'].toString(),
'car_plate': encryptionHelper.encryptData( 'car_plate': EncryptionHelper.instance.encryptData(
responseIdCardDriverEgyptFront['car_plate'].toString()), responseIdCardDriverEgyptFront['car_plate'].toString()),
'make': (responseIdCardDriverEgyptBack['make'].toString()), 'make': (responseIdCardDriverEgyptBack['make'].toString()),
'model': (responseIdCardDriverEgyptBack['model']), 'model': (responseIdCardDriverEgyptBack['model']),
@@ -663,11 +663,11 @@ class AI extends GetxController {
responseIdCardDriverEgyptFront['LicenseExpirationDate'] responseIdCardDriverEgyptFront['LicenseExpirationDate']
.toString(), .toString(),
'color': responseIdCardDriverEgyptBack['color'], 'color': responseIdCardDriverEgyptBack['color'],
'owner': encryptionHelper 'owner': EncryptionHelper.instance
.encryptData(responseIdCardDriverEgyptFront['owner']), .encryptData(responseIdCardDriverEgyptFront['owner']),
'color_hex': 'color_hex':
responseIdCardDriverEgyptBack['color_hex'].toString(), responseIdCardDriverEgyptBack['color_hex'].toString(),
'address': encryptionHelper.encryptData( 'address': EncryptionHelper.instance.encryptData(
responseIdCardDriverEgyptFront['address'].toString()), responseIdCardDriverEgyptFront['address'].toString()),
'displacement': 'displacement':
responseIdCardDriverEgyptBack['engine'].toString(), responseIdCardDriverEgyptBack['engine'].toString(),
@@ -680,7 +680,7 @@ class AI extends GetxController {
payload: { payload: {
'driverID': box.read(BoxName.driverID), 'driverID': box.read(BoxName.driverID),
'vin': responseIdCardDriverEgyptBack['chassis'].toString(), 'vin': responseIdCardDriverEgyptBack['chassis'].toString(),
'car_plate': encryptionHelper.encryptData( 'car_plate': EncryptionHelper.instance.encryptData(
responseIdCardDriverEgyptFront['car_plate'].toString()), responseIdCardDriverEgyptFront['car_plate'].toString()),
'make': (responseIdCardDriverEgyptBack['make'].toString()), 'make': (responseIdCardDriverEgyptBack['make'].toString()),
'model': (responseIdCardDriverEgyptBack['model']), 'model': (responseIdCardDriverEgyptBack['model']),
@@ -689,11 +689,11 @@ class AI extends GetxController {
responseIdCardDriverEgyptFront['LicenseExpirationDate'] responseIdCardDriverEgyptFront['LicenseExpirationDate']
.toString(), .toString(),
'color': responseIdCardDriverEgyptBack['color'], 'color': responseIdCardDriverEgyptBack['color'],
'owner': encryptionHelper 'owner': EncryptionHelper.instance
.encryptData(responseIdCardDriverEgyptFront['owner']), .encryptData(responseIdCardDriverEgyptFront['owner']),
'color_hex': 'color_hex':
responseIdCardDriverEgyptBack['color_hex'].toString(), responseIdCardDriverEgyptBack['color_hex'].toString(),
'address': encryptionHelper.encryptData( 'address': EncryptionHelper.instance.encryptData(
responseIdCardDriverEgyptFront['address'].toString()), responseIdCardDriverEgyptFront['address'].toString()),
'displacement': 'displacement':
responseIdCardDriverEgyptBack['engine'].toString(), responseIdCardDriverEgyptBack['engine'].toString(),

View File

@@ -91,7 +91,7 @@ class LocationController extends GetxController {
longitude >= minLongitude && longitude >= minLongitude &&
longitude <= maxLongitude) { longitude <= maxLongitude) {
box.write(BoxName.serverChosen, box.write(BoxName.serverChosen,
encryptionHelper.decryptData(locationData['server_link'])); EncryptionHelper.instance.decryptData(locationData['server_link']));
// Log.print( // Log.print(
// 'locationData----server_link: ${locationData['server_link']}'); // 'locationData----server_link: ${locationData['server_link']}');
return locationData['name']; return locationData['name'];

View File

@@ -76,7 +76,8 @@ class LogOutController extends GetxController {
title: 'Delete'.tr, title: 'Delete'.tr,
onPressed: () async { onPressed: () async {
if (checkTxtController.text == if (checkTxtController.text ==
encryptionHelper.decryptData(box.read(BoxName.nameDriver))) { EncryptionHelper.instance
.decryptData(box.read(BoxName.nameDriver))) {
// deletecaptainAccount(); // deletecaptainAccount();
var id = await checkBeforeDelete(); var id = await checkBeforeDelete();
@@ -101,23 +102,10 @@ class LogOutController extends GetxController {
style: ButtonStyle( style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(AppColor.redColor), backgroundColor: MaterialStateProperty.all(AppColor.redColor),
), ),
onPressed: () { onPressed: () async {
// box.remove(BoxName.agreeTerms); // box.remove(BoxName.agreeTerms);
box.remove(BoxName.driverID); await box.erase();
box.remove(BoxName.email); await storage.deleteAll();
box.remove(BoxName.lang);
box.remove(BoxName.name);
box.remove(BoxName.passengerID);
box.remove(BoxName.phone);
box.remove(BoxName.tokenFCM);
box.remove(BoxName.tokens);
box.remove(BoxName.addHome);
box.remove(BoxName.addWork);
box.remove(BoxName.agreeTerms);
box.remove(BoxName.apiKeyRun);
box.remove(BoxName.countryCode);
box.remove(BoxName.accountIdStripeConnect);
box.remove(BoxName.passengerWalletTotal);
Get.offAll(OnBoardingPage()); Get.offAll(OnBoardingPage());
}, },
child: Text( child: Text(
@@ -144,27 +132,10 @@ class LogOutController extends GetxController {
style: ButtonStyle( style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(AppColor.redColor), backgroundColor: MaterialStateProperty.all(AppColor.redColor),
), ),
onPressed: () { onPressed: () async {
// box.remove(BoxName.agreeTerms); // box.remove(BoxName.agreeTerms);
box.remove(BoxName.driverID); await box.erase();
box.remove(BoxName.sexDriver); await storage.deleteAll();
box.remove(BoxName.dobDriver);
box.remove(BoxName.nameDriver);
box.remove(BoxName.emailDriver);
box.remove(BoxName.phoneDriver);
box.remove(BoxName.statusDriverLocation);
box.remove(BoxName.cvvCodeDriver);
box.remove(BoxName.lastNameDriver);
box.remove(BoxName.passwordDriver);
box.remove(BoxName.cardNumberDriver);
box.remove(BoxName.expiryDateDriver);
box.remove(BoxName.cardHolderNameDriver);
box.remove(BoxName.vin);
box.remove(BoxName.make);
box.remove(BoxName.year);
box.remove(BoxName.owner);
box.remove(BoxName.onBoarding);
box.remove(BoxName.agreeTerms);
Get.offAll(OnBoardingPage()); Get.offAll(OnBoardingPage());
}, },
child: Text( child: Text(

View File

@@ -1,6 +1,8 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'dart:ui'; import 'dart:ui';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:jailbreak_root_detection/jailbreak_root_detection.dart';
import 'package:sefer_driver/constant/box_name.dart'; import 'package:sefer_driver/constant/box_name.dart';
import 'package:sefer_driver/constant/colors.dart'; import 'package:sefer_driver/constant/colors.dart';
import 'package:sefer_driver/constant/links.dart'; import 'package:sefer_driver/constant/links.dart';
@@ -12,6 +14,7 @@ import 'package:package_info_plus/package_info_plus.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import '../../constant/info.dart'; import '../../constant/info.dart';
import '../../main.dart'; import '../../main.dart';
import 'encrypt_decrypt.dart';
Future<void> checkForUpdate(BuildContext context) async { Future<void> checkForUpdate(BuildContext context) async {
final packageInfo = await PackageInfo.fromPlatform(); final packageInfo = await PackageInfo.fromPlatform();
@@ -159,3 +162,122 @@ void showUpdateDialog(BuildContext context) {
}, },
); );
} }
getDeviceFingerprint() async {
final deviceInfo = await DeviceInfoPlugin().deviceInfo;
var deviceData;
if (Platform.isAndroid) {
deviceData = deviceInfo.data;
} else if (Platform.isIOS) {
deviceData = deviceInfo.data;
}
final String deviceId =
deviceData['androidId'] ?? deviceData['identifierForVendor'];
final String deviceModel = deviceData['model'];
final String osVersion = deviceData['systemVersion'];
return EncryptionHelper.instance
.encryptData('${deviceId}_${deviceModel}_$osVersion');
}
class SecurityHelper {
/// Performs security checks and handles potential risks
static Future<void> performSecurityChecks() async {
bool isNotTrust = false;
bool isJailBroken = false;
bool isRealDevice = true;
bool isOnExternalStorage = false;
bool checkForIssues = false;
bool isDevMode = false;
bool isTampered = false;
String bundleId = "";
try {
isNotTrust = await JailbreakRootDetection.instance.isNotTrust;
isJailBroken = await JailbreakRootDetection.instance.isJailBroken;
isRealDevice = await JailbreakRootDetection.instance.isRealDevice;
isOnExternalStorage =
await JailbreakRootDetection.instance.isOnExternalStorage;
List<JailbreakIssue> issues =
await JailbreakRootDetection.instance.checkForIssues;
checkForIssues = issues.isNotEmpty;
isDevMode = await JailbreakRootDetection.instance.isDevMode;
// Get Bundle ID
PackageInfo packageInfo = await PackageInfo.fromPlatform();
bundleId = packageInfo.packageName;
if (bundleId.isNotEmpty) {
// Pass the CORRECT bundle ID to isTampered
isTampered = await JailbreakRootDetection.instance.isTampered(bundleId);
}
} catch (e) {
debugPrint("Error during security checks: $e");
// Consider handling specific exceptions, not just general errors.
}
// Save values to storage (using GetStorage)
await box.write('isNotTrust', isNotTrust); // Use await for write operations
await box.write('isTampered', isTampered); // Use await
await box.write('isJailBroken', isJailBroken); // Use await
// debugPrint("Security Check Results:");
// debugPrint("isNotTrust: $isNotTrust");
// debugPrint("isJailBroken: $isJailBroken");
// debugPrint("isRealDevice: $isRealDevice");
// debugPrint("isOnExternalStorage: $isOnExternalStorage");
// debugPrint("checkForIssues: $checkForIssues");
// debugPrint("isDevMode: $isDevMode");
// debugPrint("isTampered: $isTampered");
// debugPrint("Bundle ID: $bundleId"); // Print the bundle ID
// Check for security risks and potentially show a warning
if (isNotTrust ||
isJailBroken ||
isTampered ||
isDevMode ||
isOnExternalStorage ||
!isRealDevice) {
// print("security_warning".tr); //using easy_localization
// Use a more robust approach to show a warning, like a dialog:
_showSecurityWarning();
}
}
/// Deletes all app data
static Future<void> clearAllData() async {
//await storage.deleteAll(); // What's 'storage'? Be specific. Likely GetStorage as well.
await box.erase(); // Clear GetStorage data
exit(0); // This will terminate the app. Be VERY careful with this.
}
static void _showSecurityWarning() {
// Show a dialog, navigate to an error screen, etc.
// Example using Get.dialog (if you use GetX):
Get.dialog(
AlertDialog(
title: Text("Security Warning".tr), // Or use localized string
content: Text(
"Potential security risks detected. The application may not function correctly."
.tr), //Or use localized string
actions: [
TextButton(
onPressed: () async {
await storage.deleteAll();
await box.erase();
Get.back(); // Close the dialog
// Or, if you really must, exit the app (but give the user a chance!)
exit(0);
},
child: Text("OK"), // Or use a localized string
),
],
),
barrierDismissible: false, // Prevent closing by tapping outside
);
}
}

View File

@@ -1,9 +1,14 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:jwt_decoder/jwt_decoder.dart';
import 'package:secure_string_operations/secure_string_operations.dart';
import 'package:sefer_driver/controller/auth/captin/login_captin_controller.dart';
import 'package:sefer_driver/controller/functions/encrypt_decrypt.dart'; import 'package:sefer_driver/controller/functions/encrypt_decrypt.dart';
import '../../constant/box_name.dart'; import '../../constant/box_name.dart';
import '../../constant/char_map.dart';
import '../../constant/info.dart';
import '../../constant/links.dart'; import '../../constant/links.dart';
import '../../main.dart'; import '../../main.dart';
import '../../print.dart'; import '../../print.dart';
@@ -34,24 +39,41 @@ class AppInitializer {
List<Map<String, dynamic>> links = []; List<Map<String, dynamic>> links = [];
Future<void> initializeApp() async { Future<void> initializeApp() async {
await getKey(); Log.print('box.read("jwt"): ${box.read(BoxName.jwt)}');
await getAIKey('FCM_PRIVATE_KEY'); if (box.read(BoxName.jwt) == null) {
await LoginDriverController().getJWT();
} else {
print('firstTimeLoadKey ${box.read(BoxName.firstTimeLoadKey)}');
bool isTokenExpired = JwtDecoder.isExpired(X
.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs)
.toString()
.split(AppInformation.addd)[0]);
Log.print('isTokenExpired: $isTokenExpired');
if (isTokenExpired) {
await LoginDriverController().getJWT();
}
}
// await getKey();
} }
getAIKey(String key) async { getAIKey(String key1) async {
var res = if (box.read(BoxName.firstTimeLoadKey) == null) {
await CRUD().get(link: AppLink.getapiKey, payload: {"keyName": key}); var res =
if (res != 'failure') { await CRUD().get(link: AppLink.getapiKey, payload: {"keyName": key1});
var d = jsonDecode(res)['message']; if (res != 'failure') {
storage.write(key: 'FCM_PRIVATE_KEY', value: d[key].toString()); var d = jsonDecode(res)['message'];
// return d[key].toString(); await storage.write(key: key1, value: d[key1].toString());
} else {} await Future.delayed(Duration.zero);
} else {}
}
} }
Future<void> getKey() async { Future<void> getKey() async {
try { try {
var res = var res =
await CRUD().get(link: AppLink.getLocationAreaLinks, payload: {}); await CRUD().get(link: AppLink.getLocationAreaLinks, payload: {});
// Log.print('res: ${res}');
if (res != 'failure') { if (res != 'failure') {
links = List<Map<String, dynamic>>.from(jsonDecode(res)['message']); links = List<Map<String, dynamic>>.from(jsonDecode(res)['message']);
await box.remove(BoxName.locationName); await box.remove(BoxName.locationName);
@@ -61,14 +83,18 @@ class AppInitializer {
await box.remove(links[2]['name']); await box.remove(links[2]['name']);
await box.write(BoxName.locationName, links); await box.write(BoxName.locationName, links);
await box.write(BoxName.basicLink, await box.write(BoxName.basicLink,
encryptionHelper.decryptData(links[0]['server_link'])); EncryptionHelper.instance.decryptData(links[0]['server_link']));
await box.write(links[2]['name'], await box.write(links[2]['name'],
encryptionHelper.decryptData(links[2]['server_link'])); EncryptionHelper.instance.decryptData(links[2]['server_link']));
await box.write(links[1]['name'], await box.write(links[1]['name'],
encryptionHelper.decryptData(links[1]['server_link'])); EncryptionHelper.instance.decryptData(links[3]['server_link']));
await box.write(links[3]['name'],
EncryptionHelper.instance.decryptData(links[1]['server_link']));
await box.write(BoxName.paymentLink, await box.write(BoxName.paymentLink,
encryptionHelper.decryptData(links[4]['server_link'])); EncryptionHelper.instance.decryptData(links[4]['server_link']));
} }
} catch (e) {} } catch (e) {
print('Error fetching or decoding location data: $e');
}
} }
} }

View File

@@ -46,12 +46,12 @@ class SmsEgyptController extends GetxController {
if (jsonDecode(res.body)['message'].toString() != "Success") { if (jsonDecode(res.body)['message'].toString() != "Success") {
await CRUD().post(link: AppLink.updatePhoneInvalidSMS, payload: { await CRUD().post(link: AppLink.updatePhoneInvalidSMS, payload: {
"phone_number": encryptionHelper.encryptData( "phone_number": EncryptionHelper.instance.encryptData(
'+2${Get.find<RegisterCaptainController>().phoneController.text}') '+2${Get.find<RegisterCaptainController>().phoneController.text}')
}); });
box.write( box.write(
BoxName.phoneDriver, BoxName.phoneDriver,
encryptionHelper.encryptData( EncryptionHelper.instance.encryptData(
'+2${Get.find<RegisterCaptainController>().phoneController.text}')); '+2${Get.find<RegisterCaptainController>().phoneController.text}'));
box.write(BoxName.phoneVerified, '1'); box.write(BoxName.phoneVerified, '1');

View File

@@ -419,9 +419,10 @@ class ImageController extends GetxController {
await uploadImage( await uploadImage(
compressedImage, compressedImage,
{ {
'driverID': 'driverID': EncryptionHelper.instance
encryptionHelper.decryptData(box.read(BoxName.driverID)) ?? .decryptData(box.read(BoxName.driverID)) ??
encryptionHelper.decryptData(box.read(BoxName.passengerID)), EncryptionHelper.instance
.decryptData(box.read(BoxName.passengerID)),
'imageType': imageType 'imageType': imageType
}, },
link, link,
@@ -461,7 +462,7 @@ class ImageController extends GetxController {
stream, stream,
length, length,
filename: filename:
'${encryptionHelper.decryptData(box.read(BoxName.driverID))}.jpg', '${EncryptionHelper.instance.decryptData(box.read(BoxName.driverID))}.jpg',
), ),
); );
data.forEach((key, value) { data.forEach((key, value) {

View File

@@ -31,7 +31,8 @@ class HelpController extends GetxController {
update(); update();
var res = await CRUD().post(link: AppLink.addhelpCenter, payload: { var res = await CRUD().post(link: AppLink.addhelpCenter, payload: {
'driverID': box.read(BoxName.driverID).toString(), 'driverID': box.read(BoxName.driverID).toString(),
'helpQuestion': encryptionHelper.encryptData(helpQuestionController.text) 'helpQuestion':
EncryptionHelper.instance.encryptData(helpQuestionController.text)
}); });
var d = jsonDecode(res); var d = jsonDecode(res);
isLoading = false; isLoading = false;

View File

@@ -183,7 +183,7 @@ class MapDriverController extends GetxController {
await CRUD().post( await CRUD().post(
link: "${AppLink.seferCairoServer}/ride/rides/update.php", link: "${AppLink.seferCairoServer}/ride/rides/update.php",
payload: { payload: {
"id": encryptionHelper "id": EncryptionHelper.instance
.encryptData(rideId) .encryptData(rideId)
.toString(), // Convert to String .toString(), // Convert to String
"status": 'CancelFromDriverAfterApply' "status": 'CancelFromDriverAfterApply'
@@ -193,24 +193,26 @@ class MapDriverController extends GetxController {
payload: { payload: {
'driver_id': box.read(BoxName.driverID).toString(), 'driver_id': box.read(BoxName.driverID).toString(),
// box.read(BoxName.driverID).toString(), // box.read(BoxName.driverID).toString(),
'order_id': encryptionHelper.encryptData(rideId).toString(), 'order_id':
EncryptionHelper.instance.encryptData(rideId).toString(),
'status': 'CancelFromDriverAfterApply' 'status': 'CancelFromDriverAfterApply'
}); });
await CRUD().post( await CRUD().post(
link: link:
"${AppLink.seferCairoServer}/ride/cancelRide/addCancelTripFromDriverAfterApplied.php", "${AppLink.seferCairoServer}/ride/cancelRide/addCancelTripFromDriverAfterApplied.php",
payload: { payload: {
"order_id": encryptionHelper.encryptData(rideId).toString(), "order_id":
EncryptionHelper.instance.encryptData(rideId).toString(),
"driver_id": box.read(BoxName.driverID).toString(), "driver_id": box.read(BoxName.driverID).toString(),
"status": 'reject After Applied', "status": 'reject After Applied',
"notes": encryptionHelper "notes": EncryptionHelper.instance
.encryptData(cancelTripCotroller.text) .encryptData(cancelTripCotroller.text)
.toString() .toString()
}); });
if (AppLink.endPoint != AppLink.seferCairoServer) { if (AppLink.endPoint != AppLink.seferCairoServer) {
CRUD() CRUD()
.post(link: "${AppLink.endPoint}/ride/rides/update.php", payload: { .post(link: "${AppLink.endPoint}/ride/rides/update.php", payload: {
"id": encryptionHelper "id": EncryptionHelper.instance
.encryptData(rideId) .encryptData(rideId)
.toString(), // Convert to String .toString(), // Convert to String
"status": 'CancelFromDriverAfterApply' "status": 'CancelFromDriverAfterApply'
@@ -220,24 +222,26 @@ class MapDriverController extends GetxController {
payload: { payload: {
'driver_id': box.read(BoxName.driverID).toString(), 'driver_id': box.read(BoxName.driverID).toString(),
// box.read(BoxName.driverID).toString(), // box.read(BoxName.driverID).toString(),
'order_id': encryptionHelper.encryptData(rideId).toString(), 'order_id':
EncryptionHelper.instance.encryptData(rideId).toString(),
'status': 'CancelFromDriverAfterApply' 'status': 'CancelFromDriverAfterApply'
}); });
CRUD().post( CRUD().post(
link: link:
"${AppLink.endPoint}/ride/cancelRide/addCancelTripFromDriverAfterApplied.php", "${AppLink.endPoint}/ride/cancelRide/addCancelTripFromDriverAfterApplied.php",
payload: { payload: {
"order_id": encryptionHelper.encryptData(rideId).toString(), "order_id":
EncryptionHelper.instance.encryptData(rideId).toString(),
"driver_id": box.read(BoxName.driverID).toString(), "driver_id": box.read(BoxName.driverID).toString(),
"status": 'reject After Applied', "status": 'reject After Applied',
"notes": encryptionHelper "notes": EncryptionHelper.instance
.encryptData(cancelTripCotroller.text) .encryptData(cancelTripCotroller.text)
.toString() .toString()
}); });
} }
sql.insertData({ sql.insertData({
'order_id': encryptionHelper.encryptData(rideId), 'order_id': EncryptionHelper.instance.encryptData(rideId),
'created_at': DateTime.now().toString(), 'created_at': DateTime.now().toString(),
'driver_id': box.read(BoxName.driverID).toString(), 'driver_id': box.read(BoxName.driverID).toString(),
}, TableName.driverOrdersRefuse); }, TableName.driverOrdersRefuse);
@@ -308,13 +312,13 @@ class MapDriverController extends GetxController {
await CRUD().post( await CRUD().post(
link: "${AppLink.seferCairoServer}/ride/rides/update.php", link: "${AppLink.seferCairoServer}/ride/rides/update.php",
payload: { payload: {
'id': encryptionHelper.encryptData(rideId), 'id': EncryptionHelper.instance.encryptData(rideId),
'driverGoToPassengerTime': DateTime.now().toString(), 'driverGoToPassengerTime': DateTime.now().toString(),
'status': 'Applied' 'status': 'Applied'
}); });
if (AppLink.endPoint != AppLink.seferCairoServer) { if (AppLink.endPoint != AppLink.seferCairoServer) {
CRUD().post(link: "${AppLink.endPoint}/ride/rides/update.php", payload: { CRUD().post(link: "${AppLink.endPoint}/ride/rides/update.php", payload: {
'id': encryptionHelper.encryptData(rideId), 'id': EncryptionHelper.instance.encryptData(rideId),
'driverGoToPassengerTime': DateTime.now().toString(), 'driverGoToPassengerTime': DateTime.now().toString(),
'status': 'Applied' 'status': 'Applied'
}); });
@@ -529,35 +533,35 @@ class MapDriverController extends GetxController {
: (distanceBetweenDriverAndPassengerWhenConfirm * .06) + : (distanceBetweenDriverAndPassengerWhenConfirm * .06) +
(5 * .06); //for Eygpt other like jordan .06 per minute (5 * .06); //for Eygpt other like jordan .06 per minute
await CRUD().post(link: AppLink.updateRides, payload: { await CRUD().post(link: AppLink.updateRides, payload: {
'id': encryptionHelper.encryptData(rideId), 'id': EncryptionHelper.instance.encryptData(rideId),
'rideTimeStart': DateTime.now().toString(), 'rideTimeStart': DateTime.now().toString(),
'status': 'CancelAfterWait', 'status': 'CancelAfterWait',
}); });
CRUD().post(link: AppLink.addDriverOrder, payload: { CRUD().post(link: AppLink.addDriverOrder, payload: {
'driver_id': box.read(BoxName.driverID).toString(), 'driver_id': box.read(BoxName.driverID).toString(),
'order_id': encryptionHelper.encryptData(rideId).toString(), 'order_id': EncryptionHelper.instance.encryptData(rideId).toString(),
'status': 'CancelAfterWait' 'status': 'CancelAfterWait'
}); });
if (AppLink.endPoint != AppLink.seferCairoServer) { if (AppLink.endPoint != AppLink.seferCairoServer) {
CRUD().post(link: "${AppLink.endPoint}/rides/update.php", payload: { CRUD().post(link: "${AppLink.endPoint}/rides/update.php", payload: {
'id': encryptionHelper.encryptData(rideId), 'id': EncryptionHelper.instance.encryptData(rideId),
'rideTimeStart': DateTime.now().toString(), 'rideTimeStart': DateTime.now().toString(),
'status': 'CancelAfterWait', 'status': 'CancelAfterWait',
}); });
CRUD().post(link: "${AppLink.endPoint}/rides/update.php", payload: { CRUD().post(link: "${AppLink.endPoint}/rides/update.php", payload: {
'driver_id': box.read(BoxName.driverID).toString(), 'driver_id': box.read(BoxName.driverID).toString(),
'order_id': encryptionHelper.encryptData(rideId).toString(), 'order_id': EncryptionHelper.instance.encryptData(rideId).toString(),
'status': 'CancelAfterWait' 'status': 'CancelAfterWait'
}); });
} }
var paymentTokenWait = var paymentTokenWait =
await generateTokenDriver(costOfWaiting5Minute.toString()); await generateTokenDriver(costOfWaiting5Minute.toString());
var res = await CRUD().post(link: AppLink.addDrivePayment, payload: { var res = await CRUD().post(link: AppLink.addDrivePayment, payload: {
'rideId': encryptionHelper.encryptData(rideId), 'rideId': EncryptionHelper.instance.encryptData(rideId),
'amount': (costOfWaiting5Minute.toString()), 'amount': (costOfWaiting5Minute.toString()),
'payment_method': 'wait-cancel', 'payment_method': 'wait-cancel',
'passengerID': encryptionHelper.encryptData(passengerId), 'passengerID': EncryptionHelper.instance.encryptData(passengerId),
'token': paymentTokenWait, 'token': paymentTokenWait,
'driverID': box.read(BoxName.driverID).toString(), 'driverID': box.read(BoxName.driverID).toString(),
}); });
@@ -565,7 +569,7 @@ class MapDriverController extends GetxController {
await generateTokenDriver(costOfWaiting5Minute.toString()); await generateTokenDriver(costOfWaiting5Minute.toString());
var res1 = var res1 =
await CRUD().post(link: AppLink.addDriversWalletPoints, payload: { await CRUD().post(link: AppLink.addDriversWalletPoints, payload: {
'paymentID': 'rideId${encryptionHelper.encryptData(rideId)}', 'paymentID': 'rideId${EncryptionHelper.instance.encryptData(rideId)}',
'amount': (costOfWaiting5Minute).toStringAsFixed(0), 'amount': (costOfWaiting5Minute).toStringAsFixed(0),
'paymentMethod': 'wait', 'paymentMethod': 'wait',
'token': paymentTokenWait1, 'token': paymentTokenWait1,
@@ -581,7 +585,7 @@ class MapDriverController extends GetxController {
var paymentTokenWaitPassenger1 = var paymentTokenWaitPassenger1 =
await generateTokenPassenger((costOfWaiting5Minute * -1).toString()); await generateTokenPassenger((costOfWaiting5Minute * -1).toString());
await CRUD().post(link: AppLink.addPassengersWallet, payload: { await CRUD().post(link: AppLink.addPassengersWallet, payload: {
'passenger_id': encryptionHelper.encryptData(passengerId), 'passenger_id': EncryptionHelper.instance.encryptData(passengerId),
'balance': (costOfWaiting5Minute * -1).toString(), 'balance': (costOfWaiting5Minute * -1).toString(),
'token': paymentTokenWaitPassenger1, 'token': paymentTokenWaitPassenger1,
}); });
@@ -667,13 +671,13 @@ class MapDriverController extends GetxController {
// Prepare data for API calls // Prepare data for API calls
final nowString = DateTime.now().toString(); final nowString = DateTime.now().toString();
final basePayload = { final basePayload = {
'id': encryptionHelper.encryptData(rideId), 'id': EncryptionHelper.instance.encryptData(rideId),
'rideTimeFinish': nowString, 'rideTimeFinish': nowString,
'status': 'Finished', 'status': 'Finished',
'price': totalCost, 'price': totalCost,
}; };
final driverOrderPayload = { final driverOrderPayload = {
'order_id': encryptionHelper.encryptData(rideId.toString()), 'order_id': EncryptionHelper.instance.encryptData(rideId.toString()),
'status': 'Finished' 'status': 'Finished'
}; };
@@ -706,7 +710,7 @@ class MapDriverController extends GetxController {
paymentToken = await generateTokenPassenger( paymentToken = await generateTokenPassenger(
((-1) * double.parse(paymentAmount)).toString()); ((-1) * double.parse(paymentAmount)).toString());
futures.add(CRUD().post(link: AppLink.addPassengersWallet, payload: { futures.add(CRUD().post(link: AppLink.addPassengersWallet, payload: {
'passenger_id': encryptionHelper.encryptData(passengerId), 'passenger_id': EncryptionHelper.instance.encryptData(passengerId),
'balance': ((-1) * double.parse(paymentAmount)).toString(), 'balance': ((-1) * double.parse(paymentAmount)).toString(),
'token': paymentToken, 'token': paymentToken,
})); }));
@@ -714,11 +718,11 @@ class MapDriverController extends GetxController {
paymentToken = await generateTokenDriver(paymentAmount.toString()); paymentToken = await generateTokenDriver(paymentAmount.toString());
futures.add(CRUD().post(link: AppLink.addDrivePayment, payload: { futures.add(CRUD().post(link: AppLink.addDrivePayment, payload: {
'rideId': encryptionHelper.encryptData(rideId), 'rideId': EncryptionHelper.instance.encryptData(rideId),
'amount': paymentAmount, 'amount': paymentAmount,
'payment_method': 'payment_method':
walletChecked == 'true' ? "${paymentMethod}Ride" : paymentMethod, walletChecked == 'true' ? "${paymentMethod}Ride" : paymentMethod,
'passengerID': encryptionHelper.encryptData(passengerId), 'passengerID': EncryptionHelper.instance.encryptData(passengerId),
'token': paymentToken, 'token': paymentToken,
'driverID': box.read(BoxName.driverID).toString(), 'driverID': box.read(BoxName.driverID).toString(),
})); }));
@@ -727,7 +731,7 @@ class MapDriverController extends GetxController {
final paymentToken1 = await generateTokenPassenger( final paymentToken1 = await generateTokenPassenger(
((-1) * double.parse(passengerWalletBurc)).toString()); ((-1) * double.parse(passengerWalletBurc)).toString());
futures.add(CRUD().post(link: AppLink.addPassengersWallet, payload: { futures.add(CRUD().post(link: AppLink.addPassengersWallet, payload: {
'passenger_id': encryptionHelper.encryptData(passengerId), 'passenger_id': EncryptionHelper.instance.encryptData(passengerId),
'token': paymentToken1, 'token': paymentToken1,
'balance': ((-1) * double.parse(passengerWalletBurc)).toString() 'balance': ((-1) * double.parse(passengerWalletBurc)).toString()
})); }));
@@ -737,7 +741,7 @@ class MapDriverController extends GetxController {
final paymentToken2 = final paymentToken2 =
await generateTokenDriver((pointsSubtraction).toStringAsFixed(0)); await generateTokenDriver((pointsSubtraction).toStringAsFixed(0));
futures.add(CRUD().post(link: AppLink.addDriversWalletPoints, payload: { futures.add(CRUD().post(link: AppLink.addDriversWalletPoints, payload: {
'paymentID': 'rideId${encryptionHelper.encryptData(rideId)}', 'paymentID': 'rideId${EncryptionHelper.instance.encryptData(rideId)}',
'amount': (pointsSubtraction).toStringAsFixed(0), 'amount': (pointsSubtraction).toStringAsFixed(0),
'paymentMethod': paymentMethod, 'paymentMethod': paymentMethod,
'token': paymentToken2, 'token': paymentToken2,
@@ -894,7 +898,7 @@ class MapDriverController extends GetxController {
var res = await CRUD().get( var res = await CRUD().get(
link: "${AppLink.endPoint}/ride/driver_order/getOrderCancelStatus.php", link: "${AppLink.endPoint}/ride/driver_order/getOrderCancelStatus.php",
payload: { payload: {
'order_id': encryptionHelper.encryptData(rideId), 'order_id': EncryptionHelper.instance.encryptData(rideId),
}); //.then((value) { }); //.then((value) {
var response = jsonDecode(res); var response = jsonDecode(res);
canelString = response['data']['status']; canelString = response['data']['status'];

View File

@@ -65,6 +65,12 @@ class MyTranslation extends Translations {
"Order Applied": "تم تطبيق الطلب", "Order Applied": "تم تطبيق الطلب",
//firebase above //firebase above
'please order now': " ‏الرجاء الطلب مرة أخرى",
'Session expired. Please log in again.':
'انتهت الجلسة. يرجى تسجيل الدخول مرة أخرى.',
"Security Warning": "⚠️ تحذير أمني",
"Potential security risks detected. The application may not function correctly.":
"تم اكتشاف ثغرات أمنية على هذا الجهاز. للحفاظ على أمان بياناتك، سيتم حذف جميع البيانات وإغلاق التطبيق.",
"I will go now": "هروح دلوقتي", "I will go now": "هروح دلوقتي",
"Yes": "أيوة", "Yes": "أيوة",

View File

@@ -156,9 +156,12 @@ class PaymentController extends GetxController {
paymentIntentClientSecret: clientSecret, paymentIntentClientSecret: clientSecret,
merchantDisplayName: AppInformation.appName, merchantDisplayName: AppInformation.appName,
billingDetails: BillingDetails( billingDetails: BillingDetails(
name: encryptionHelper.decryptData(box.read(BoxName.nameDriver)), name: EncryptionHelper.instance
email: encryptionHelper.decryptData(box.read(BoxName.emailDriver)), .decryptData(box.read(BoxName.nameDriver)),
phone: encryptionHelper.decryptData(box.read(BoxName.phoneDriver)), email: EncryptionHelper.instance
.decryptData(box.read(BoxName.emailDriver)),
phone: EncryptionHelper.instance
.decryptData(box.read(BoxName.phoneDriver)),
address: Address( address: Address(
city: 'city', city: 'city',
country: box.read(BoxName.countryCode), //'United States' country: box.read(BoxName.countryCode), //'United States'

View File

@@ -134,12 +134,13 @@ class PaymobManager extends GetxController {
"currency": currency, "currency": currency,
"billing_data": { "billing_data": {
"first_name": "first_name":
encryptionHelper.decryptData(box.read(BoxName.nameDriver)), EncryptionHelper.instance.decryptData(box.read(BoxName.nameDriver)),
"last_name": "last_name": EncryptionHelper.instance
encryptionHelper.decryptData(box.read(BoxName.lastNameDriver)), .decryptData(box.read(BoxName.lastNameDriver)),
"email": encryptionHelper.decryptData(box.read(BoxName.emailDriver)), "email": EncryptionHelper.instance
"phone_number": .decryptData(box.read(BoxName.emailDriver)),
encryptionHelper.decryptData(box.read(BoxName.phoneDriver)), "phone_number": EncryptionHelper.instance
.decryptData(box.read(BoxName.phoneDriver)),
"apartment": "NA", "apartment": "NA",
"floor": "NA", "floor": "NA",
"street": "NA", "street": "NA",

View File

@@ -224,11 +224,12 @@ class PaymobBillingData {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
return { return {
"email": encryptionHelper.decryptData(box.read(BoxName.emailDriver)), "email":
EncryptionHelper.instance.decryptData(box.read(BoxName.emailDriver)),
"first_name": box.read(BoxName.nameDriver), "first_name": box.read(BoxName.nameDriver),
"last_name": box.read(BoxName.nameDriver), "last_name": box.read(BoxName.nameDriver),
"phone_number": "phone_number":
encryptionHelper.decryptData(box.read(BoxName.phoneDriver)), EncryptionHelper.instance.decryptData(box.read(BoxName.phoneDriver)),
"apartment": apartment ?? "NA", "apartment": apartment ?? "NA",
"floor": floor ?? "NA", "floor": floor ?? "NA",
"building": building ?? "NA", "building": building ?? "NA",

View File

@@ -267,7 +267,8 @@ class PaymobBillingDataWallet {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
return { return {
"email": encryptionHelper.decryptData(box.read(BoxName.emailDriver)), "email":
EncryptionHelper.instance.decryptData(box.read(BoxName.emailDriver)),
"first_name": box.read(BoxName.name) ?? box.read(BoxName.nameDriver), "first_name": box.read(BoxName.name) ?? box.read(BoxName.nameDriver),
"last_name": box.read(BoxName.name) ?? box.read(BoxName.nameDriver), "last_name": box.read(BoxName.name) ?? box.read(BoxName.nameDriver),
"phone_number": (box.read(BoxName.phoneWallet)), "phone_number": (box.read(BoxName.phoneWallet)),

View File

@@ -42,10 +42,10 @@ class RatingController extends GetxController {
"name": box.read(BoxName.driverID) != null "name": box.read(BoxName.driverID) != null
? box.read(BoxName.nameDriver) ? box.read(BoxName.nameDriver)
: box.read(BoxName.name), : box.read(BoxName.name),
"email": encryptionHelper "email": EncryptionHelper.instance
.decryptData(box.read(BoxName.emailDriver)) .decryptData(box.read(BoxName.emailDriver))
.toString(), .toString(),
"phone": encryptionHelper "phone": EncryptionHelper.instance
.decryptData(box.read(BoxName.phoneDriver)) .decryptData(box.read(BoxName.phoneDriver))
.toString(), .toString(),
"userId": box.read(BoxName.driverID), "userId": box.read(BoxName.driverID),

View File

@@ -22,6 +22,7 @@ import 'constant/info.dart';
import 'constant/notification.dart'; import 'constant/notification.dart';
import 'controller/firebase/firbase_messge.dart'; import 'controller/firebase/firbase_messge.dart';
import 'controller/firebase/local_notification.dart'; import 'controller/firebase/local_notification.dart';
import 'controller/functions/encrypt_decrypt.dart';
import 'controller/functions/location_controller.dart'; import 'controller/functions/location_controller.dart';
import 'controller/functions/secure_storage.dart'; import 'controller/functions/secure_storage.dart';
import 'controller/home/payment/captain_wallet_controller.dart'; import 'controller/home/payment/captain_wallet_controller.dart';
@@ -124,9 +125,15 @@ void main() async {
await WakelockPlus.enable(); await WakelockPlus.enable();
await GetStorage.init(); await GetStorage.init();
Stripe.publishableKey = AK.publishableKeyStripe;
final AppInitializer initializer = AppInitializer(); final AppInitializer initializer = AppInitializer();
await initializer.initializeApp(); await initializer.initializeApp();
await Future.delayed(Duration.zero);
await EncryptionHelper.initialize();
Stripe.publishableKey = AK.publishableKeyStripe;
PermissionStatus status1 = await Permission.location.status; PermissionStatus status1 = await Permission.location.status;
if (status1.isGranted) { if (status1.isGranted) {
await LocationController().startLocationUpdates(); await LocationController().startLocationUpdates();
@@ -141,11 +148,6 @@ void main() async {
await FirebaseMessagesController().requestFirebaseMessagingPermission(); await FirebaseMessagesController().requestFirebaseMessagingPermission();
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
// NotificationController1().initNotifications();
// NotificationController().initNotifications();
// if (Platform.isAndroid) {
// await Get.put(NotificationController()).initNotifications();
// }
await notificationController.initNotifications(); await notificationController.initNotifications();
@@ -171,17 +173,19 @@ void main() async {
]); ]);
} }
String? key = (await storage.read(key: BoxName.payMobApikey));
String? apiKey = EncryptionHelper.instance.decryptData(key!);
PaymobPayment.instance.initialize( PaymobPayment.instance.initialize(
apiKey: AK.payMobApikey, apiKey: apiKey,
// integrationID: 4556055,
integrationID: int.parse(AK.integrationIdPayMob), integrationID: int.parse(AK.integrationIdPayMob),
userTokenExpiration: 200, userTokenExpiration: 200,
iFrameID: 837992, iFrameID: 837992,
); );
PaymobPaymentWallet.instance.initialize( PaymobPaymentWallet.instance.initialize(
apiKey: AK.payMobApikey, apiKey: apiKey,
integrationID: int.parse(AK.integrationIdPayMobWallet), integrationID: int.parse(AK.integrationIdPayMobWallet),
// integrationID: 4556056,
userTokenExpiration: 200, userTokenExpiration: 200,
iFrameID: 837992, iFrameID: 837992,
); );

View File

@@ -95,17 +95,17 @@ class AiPage extends StatelessWidget {
Row( Row(
children: [ children: [
Text( Text(
'${'Name'.tr} :${encryptionHelper.decryptData(contentController.responseMap['first_name'])}', '${'Name'.tr} :${EncryptionHelper.instance.decryptData(contentController.responseMap['first_name'])}',
style: AppStyle.subtitle, style: AppStyle.subtitle,
), ),
Text( Text(
' ${encryptionHelper.decryptData(contentController.responseMap['last_name'])}', ' ${EncryptionHelper.instance.decryptData(contentController.responseMap['last_name'])}',
style: AppStyle.subtitle, style: AppStyle.subtitle,
), ),
], ],
), ),
Text( Text(
'${'Name in arabic'.tr}: ${encryptionHelper.decryptData(contentController.responseMap['name_in_arabic'])}', '${'Name in arabic'.tr}: ${EncryptionHelper.instance.decryptData(contentController.responseMap['name_in_arabic'])}',
style: AppStyle.title, style: AppStyle.title,
), ),
Text( Text(
@@ -121,7 +121,7 @@ class AiPage extends StatelessWidget {
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'${'National Number'.tr}: ${encryptionHelper.decryptData(contentController.responseMap['id'])}', '${'National Number'.tr}: ${EncryptionHelper.instance.decryptData(contentController.responseMap['id'])}',
style: AppStyle.title, style: AppStyle.title,
), ),
// Image.memory( // Image.memory(
@@ -131,7 +131,7 @@ class AiPage extends StatelessWidget {
// ), // ),
]), ]),
Text( Text(
'${'Address'.tr}: ${encryptionHelper.decryptData(contentController.responseMap['address'])}', '${'Address'.tr}: ${EncryptionHelper.instance.decryptData(contentController.responseMap['address'])}',
style: AppStyle.title, style: AppStyle.title,
), ),
Row( Row(

View File

@@ -322,7 +322,7 @@ class EgyptCardAI extends StatelessWidget {
IconButton( IconButton(
onPressed: () async { onPressed: () async {
await ai.allMethodForAI( await ai.allMethodForAI(
encryptionHelper.decryptData( EncryptionHelper.instance.decryptData(
ai.prompts[0]['prompt'].toString()), ai.prompts[0]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'driver_license'); //egypt 'driver_license'); //egypt
@@ -335,32 +335,32 @@ class EgyptCardAI extends StatelessWidget {
const Divider(color: AppColor.accentColor), const Divider(color: AppColor.accentColor),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'License Type'.tr}: ${encryptionHelper.decryptData(ai.responseIdEgyptDriverLicense['license_type'])}', '${'License Type'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptDriverLicense['license_type'])}',
style: AppStyle.title, style: AppStyle.title,
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'National Number'.tr}: ${encryptionHelper.decryptData(ai.responseIdEgyptDriverLicense['national_number'])}', '${'National Number'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptDriverLicense['national_number'])}',
style: AppStyle.title.copyWith( style: AppStyle.title.copyWith(
color: encryptionHelper.decryptData( color: EncryptionHelper.instance.decryptData(
ai.responseIdEgyptDriverLicense[ ai.responseIdEgyptDriverLicense[
'national_number']) == 'national_number']) ==
encryptionHelper.decryptData( EncryptionHelper.instance.decryptData(
ai.responseIdEgyptBack['nationalID']) ai.responseIdEgyptBack['nationalID'])
? AppColor.greenColor ? AppColor.greenColor
: AppColor.redColor), : AppColor.redColor),
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'Name (Arabic)'.tr}: ${encryptionHelper.decryptData(ai.responseIdEgyptDriverLicense['name_arabic'])}', '${'Name (Arabic)'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptDriverLicense['name_arabic'])}',
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'Name (English)'.tr}: ${encryptionHelper.decryptData(ai.responseIdEgyptDriverLicense['name_english'])}', '${'Name (English)'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptDriverLicense['name_english'])}',
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'Address'.tr}: ${encryptionHelper.decryptData(ai.responseIdEgyptDriverLicense['address'])}', '${'Address'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptDriverLicense['address'])}',
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
@@ -387,7 +387,7 @@ class EgyptCardAI extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
await ai.allMethodForAI( await ai.allMethodForAI(
encryptionHelper EncryptionHelper.instance
.decryptData(ai.prompts[0]['prompt'].toString()), .decryptData(ai.prompts[0]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'driver_license'); //egypt 'driver_license'); //egypt
@@ -443,7 +443,7 @@ class EgyptCardAI extends StatelessWidget {
IconButton( IconButton(
onPressed: () async { onPressed: () async {
await ai.allMethodForAI( await ai.allMethodForAI(
encryptionHelper.decryptData( EncryptionHelper.instance.decryptData(
ai.prompts[1]['prompt'].toString()), ai.prompts[1]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'id_back'); //egypt 'id_back'); //egypt
@@ -457,12 +457,12 @@ class EgyptCardAI extends StatelessWidget {
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
// Assuming these keys exist in ai.responseIdEgyptFront // Assuming these keys exist in ai.responseIdEgyptFront
Text( Text(
'${'National ID'.tr}: ${encryptionHelper.decryptData(ai.responseIdEgyptBack['nationalID'])}', '${'National ID'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptBack['nationalID'])}',
style: AppStyle.title.copyWith( style: AppStyle.title.copyWith(
color: encryptionHelper.decryptData( color: EncryptionHelper.instance.decryptData(
ai.responseIdEgyptDriverLicense[ ai.responseIdEgyptDriverLicense[
'national_number']) == 'national_number']) ==
encryptionHelper.decryptData( EncryptionHelper.instance.decryptData(
ai.responseIdEgyptBack['nationalID']) ai.responseIdEgyptBack['nationalID'])
? AppColor.greenColor ? AppColor.greenColor
: AppColor.redColor), : AppColor.redColor),
@@ -470,7 +470,7 @@ class EgyptCardAI extends StatelessWidget {
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'Occupation'.tr}: ${encryptionHelper.decryptData(ai.responseIdEgyptBack['occupation'])}', // Assuming 'occupation' exists '${'Occupation'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptBack['occupation'])}', // Assuming 'occupation' exists
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Row( Row(
@@ -480,7 +480,7 @@ class EgyptCardAI extends StatelessWidget {
'${'Issue Date'.tr}: ${ai.responseIdEgyptBack['issueDate']}', // Assuming 'issueDate' exists '${'Issue Date'.tr}: ${ai.responseIdEgyptBack['issueDate']}', // Assuming 'issueDate' exists
), ),
Text( Text(
'${'Gender'.tr}: ${encryptionHelper.decryptData(ai.responseIdEgyptBack['gender'])}', // Assuming 'gender' exists '${'Gender'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptBack['gender'])}', // Assuming 'gender' exists
), ),
], ],
), ),
@@ -517,7 +517,7 @@ class EgyptCardAI extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
await ai.allMethodForAI( await ai.allMethodForAI(
encryptionHelper EncryptionHelper.instance
.decryptData(ai.prompts[1]['prompt'].toString()), .decryptData(ai.prompts[1]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'id_back'); //egypt 'id_back'); //egypt
@@ -571,7 +571,7 @@ class EgyptCardAI extends StatelessWidget {
IconButton( IconButton(
onPressed: () async { onPressed: () async {
await ai.allMethodForAI( await ai.allMethodForAI(
encryptionHelper.decryptData( EncryptionHelper.instance.decryptData(
ai.prompts[7]['prompt'].toString()), ai.prompts[7]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'non_id_back'); 'non_id_back');
@@ -584,16 +584,16 @@ class EgyptCardAI extends StatelessWidget {
const Divider(color: AppColor.accentColor), const Divider(color: AppColor.accentColor),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'Country'.tr}: ${encryptionHelper.decryptData(ai.responseNonIdCardBack['country'])}', '${'Country'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardBack['country'])}',
style: AppStyle.title, style: AppStyle.title,
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'Residency Type'.tr}: ${encryptionHelper.decryptData(ai.responseNonIdCardBack['residencyType'])}', '${'Residency Type'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardBack['residencyType'])}',
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'Work Status'.tr}: ${encryptionHelper.decryptData(ai.responseNonIdCardBack['workStatus'])}', '${'Work Status'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardBack['workStatus'])}',
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Row( Row(
@@ -603,7 +603,7 @@ class EgyptCardAI extends StatelessWidget {
'${'Issue Date'.tr}: ${ai.responseNonIdCardBack['issueDate']}', '${'Issue Date'.tr}: ${ai.responseNonIdCardBack['issueDate']}',
), ),
Text( Text(
'${'Birth Date'.tr}: ${encryptionHelper.decryptData(ai.responseNonIdCardBack['birthDate'])}', '${'Birth Date'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardBack['birthDate'])}',
), ),
], ],
), ),
@@ -624,7 +624,7 @@ class EgyptCardAI extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
await ai.allMethodForAI( await ai.allMethodForAI(
encryptionHelper EncryptionHelper.instance
.decryptData(ai.prompts[7]['prompt'].toString()), .decryptData(ai.prompts[7]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'non_id_back'); 'non_id_back');
@@ -670,7 +670,7 @@ class EgyptCardAI extends StatelessWidget {
IconButton( IconButton(
onPressed: () async { onPressed: () async {
await ai.allMethodForAI( await ai.allMethodForAI(
encryptionHelper.decryptData( EncryptionHelper.instance.decryptData(
ai.prompts[2]['id_front'].toString()), ai.prompts[2]['id_front'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'id_front'); //egypt 'id_front'); //egypt
@@ -688,10 +688,10 @@ class EgyptCardAI extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'${'First Name'.tr}: ${encryptionHelper.decryptData(ai.responseIdEgyptFront['first_name'])}', '${'First Name'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptFront['first_name'])}',
), ),
Text( Text(
'${'CardID'.tr}: ${encryptionHelper.decryptData(ai.responseIdEgyptFront['card_id'])}', '${'CardID'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptFront['card_id'])}',
), ),
], ],
), ),
@@ -700,16 +700,16 @@ class EgyptCardAI extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'${'Full Name'.tr}: ${encryptionHelper.decryptData(ai.responseIdEgyptFront['full_name'])}', '${'Full Name'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptFront['full_name'])}',
), ),
Text( Text(
'${'DOB'.tr}: ${encryptionHelper.decryptData(ai.responseIdEgyptFront['dob'])}', '${'DOB'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptFront['dob'])}',
), ),
], ],
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'Address'.tr}: ${encryptionHelper.decryptData(ai.responseIdEgyptFront['address'])}', '${'Address'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptFront['address'])}',
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
// Text( // Text(
@@ -727,7 +727,7 @@ class EgyptCardAI extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
await ai.allMethodForAI( await ai.allMethodForAI(
encryptionHelper EncryptionHelper.instance
.decryptData(ai.prompts[2]['prompt'].toString()), .decryptData(ai.prompts[2]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'id_front'); //egypt 'id_front'); //egypt
@@ -773,7 +773,7 @@ class EgyptCardAI extends StatelessWidget {
IconButton( IconButton(
onPressed: () async { onPressed: () async {
await ai.allMethodForAI( await ai.allMethodForAI(
encryptionHelper.decryptData( EncryptionHelper.instance.decryptData(
ai.prompts[6]['prompt'].toString()), ai.prompts[6]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'non_id_front'); 'non_id_front');
@@ -786,7 +786,7 @@ class EgyptCardAI extends StatelessWidget {
const Divider(color: AppColor.accentColor), const Divider(color: AppColor.accentColor),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'Full Name'.tr}: ${encryptionHelper.decryptData(ai.responseNonIdCardFront['full_name'])}', '${'Full Name'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardFront['full_name'])}',
style: AppStyle.title, style: AppStyle.title,
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
@@ -794,10 +794,10 @@ class EgyptCardAI extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'${'Passport No'.tr}: ${encryptionHelper.decryptData(ai.responseNonIdCardFront['passport_no'])}', '${'Passport No'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardFront['passport_no'])}',
), ),
Text( Text(
'${'Card ID'.tr}: ${encryptionHelper.decryptData(ai.responseNonIdCardFront['card_id'])}', '${'Card ID'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardFront['card_id'])}',
), ),
], ],
), ),
@@ -806,20 +806,20 @@ class EgyptCardAI extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'${'Country'.tr}: ${encryptionHelper.decryptData(ai.responseNonIdCardFront['country'])}', '${'Country'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardFront['country'])}',
), ),
Text( Text(
'${'Gender'.tr}: ${encryptionHelper.decryptData(ai.responseNonIdCardFront['gender'])}', '${'Gender'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardFront['gender'])}',
), ),
], ],
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'Birth Date'.tr}: ${encryptionHelper.decryptData(ai.responseNonIdCardFront['birthdate'])}', '${'Birth Date'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardFront['birthdate'])}',
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'Address'.tr}: ${encryptionHelper.decryptData(ai.responseNonIdCardFront['address'])}', '${'Address'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardFront['address'])}',
), ),
], ],
), ),
@@ -830,7 +830,7 @@ class EgyptCardAI extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
await ai.allMethodForAI( await ai.allMethodForAI(
encryptionHelper EncryptionHelper.instance
.decryptData(ai.prompts[6]['prompt'].toString()), .decryptData(ai.prompts[6]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'non_id_front'); 'non_id_front');
@@ -884,7 +884,7 @@ class EgyptCardAI extends StatelessWidget {
IconButton( IconButton(
onPressed: () async { onPressed: () async {
ai.allMethodForAI( ai.allMethodForAI(
encryptionHelper.decryptData( EncryptionHelper.instance.decryptData(
ai.prompts[3]['prompt'].toString()), ai.prompts[3]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'car_front'); 'car_front');
@@ -899,15 +899,15 @@ class EgyptCardAI extends StatelessWidget {
// Removed Make, Model, etc. as they are not available // Removed Make, Model, etc. as they are not available
Text( Text(
'${'Plate Number'.tr}: ${encryptionHelper.decryptData(ai.responseIdCardDriverEgyptFront['car_plate'])}', '${'Plate Number'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdCardDriverEgyptFront['car_plate'])}',
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'Owner Name'.tr}: ${encryptionHelper.decryptData(ai.responseIdCardDriverEgyptFront['owner'])}', '${'Owner Name'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdCardDriverEgyptFront['owner'])}',
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'Address'.tr}: ${encryptionHelper.decryptData(ai.responseIdCardDriverEgyptFront['address'])}', '${'Address'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdCardDriverEgyptFront['address'])}',
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Row( Row(
@@ -932,7 +932,7 @@ class EgyptCardAI extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
ai.allMethodForAI( ai.allMethodForAI(
encryptionHelper EncryptionHelper.instance
.decryptData(ai.prompts[3]['prompt'].toString()), .decryptData(ai.prompts[3]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'car_front'); 'car_front');
@@ -1003,7 +1003,7 @@ class EgyptCardAI extends StatelessWidget {
IconButton( IconButton(
onPressed: () async { onPressed: () async {
ai.allMethodForAI( ai.allMethodForAI(
encryptionHelper.decryptData( EncryptionHelper.instance.decryptData(
ai.prompts[4]['prompt'].toString()), ai.prompts[4]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'car_back'); 'car_back');
@@ -1077,7 +1077,7 @@ class EgyptCardAI extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
ai.allMethodForAI( ai.allMethodForAI(
encryptionHelper EncryptionHelper.instance
.decryptData(ai.prompts[4]['prompt'].toString()), .decryptData(ai.prompts[4]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'car_back'); 'car_back');
@@ -1123,7 +1123,7 @@ class EgyptCardAI extends StatelessWidget {
IconButton( IconButton(
onPressed: () async { onPressed: () async {
await ai.allMethodForAI( await ai.allMethodForAI(
encryptionHelper.decryptData( EncryptionHelper.instance.decryptData(
ai.prompts[5]['prompt'].toString()), ai.prompts[5]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'criminalRecord', 'criminalRecord',
@@ -1140,11 +1140,11 @@ class EgyptCardAI extends StatelessWidget {
'${'InspectionResult'.tr}: ${ai.responseCriminalRecordEgypt['InspectionResult']}'), '${'InspectionResult'.tr}: ${ai.responseCriminalRecordEgypt['InspectionResult']}'),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'FullName'.tr}: ${encryptionHelper.decryptData(ai.responseCriminalRecordEgypt['FullName'])}', '${'FullName'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseCriminalRecordEgypt['FullName'])}',
style: AppStyle.title.copyWith( style: AppStyle.title.copyWith(
color: encryptionHelper.decryptData(ai color: EncryptionHelper.instance.decryptData(ai
.responseCriminalRecordEgypt['FullName']) == .responseCriminalRecordEgypt['FullName']) ==
encryptionHelper.decryptData( EncryptionHelper.instance.decryptData(
ai.responseIdEgyptDriverLicense[ ai.responseIdEgyptDriverLicense[
'name_arabic']) 'name_arabic'])
? AppColor.greenColor ? AppColor.greenColor
@@ -1152,7 +1152,7 @@ class EgyptCardAI extends StatelessWidget {
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'NationalID'.tr}: ${encryptionHelper.decryptData(ai.responseCriminalRecordEgypt['NationalID'])}'), '${'NationalID'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseCriminalRecordEgypt['NationalID'])}'),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'IssueDate'.tr}: ${ai.responseCriminalRecordEgypt['IssueDate']}'), '${'IssueDate'.tr}: ${ai.responseCriminalRecordEgypt['IssueDate']}'),
@@ -1165,7 +1165,7 @@ class EgyptCardAI extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
await ai.allMethodForAI( await ai.allMethodForAI(
encryptionHelper EncryptionHelper.instance
.decryptData(ai.prompts[5]['prompt'].toString()), .decryptData(ai.prompts[5]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'criminalRecord', 'criminalRecord',

View File

@@ -21,9 +21,9 @@ class ContactUsPage extends StatelessWidget {
body: [ body: [
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: ListView(
crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Container( Container(
decoration: AppStyle.boxDecoration1, decoration: AppStyle.boxDecoration1,
@@ -35,7 +35,7 @@ class ContactUsPage extends StatelessWidget {
IconButton( IconButton(
onPressed: () async { onPressed: () async {
Get.put(TextToSpeechController()).speakText( Get.put(TextToSpeechController()).speakText(
'Swifti is the safest ride-sharing app that introduces many features for both captains and passengers. We offer the lowest commission rate of just 8%, ensuring you get the best value for your rides. Our app includes insurance for the best captains, regular maintenance of cars with top engineers, and on-road services to ensure a respectful and high-quality experience for all users.' 'Tripz is the safest ride-sharing app that introduces many features for both captains and passengers. We offer the lowest commission rate of just 8%, ensuring you get the best value for your rides. Our app includes insurance for the best captains, regular maintenance of cars with top engineers, and on-road services to ensure a respectful and high-quality experience for all users.'
.tr); .tr);
}, },
icon: const Icon(Icons.headphones), icon: const Icon(Icons.headphones),
@@ -43,7 +43,7 @@ class ContactUsPage extends StatelessWidget {
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text( child: Text(
'Swifti is the safest ride-sharing app that introduces many features for both captains and passengers. We offer the lowest commission rate of just 8%, ensuring you get the best value for your rides. Our app includes insurance for the best captains, regular maintenance of cars with top engineers, and on-road services to ensure a respectful and high-quality experience for all users.' 'Tripz is the safest ride-sharing app that introduces many features for both captains and passengers. We offer the lowest commission rate of just 8%, ensuring you get the best value for your rides. Our app includes insurance for the best captains, regular maintenance of cars with top engineers, and on-road services to ensure a respectful and high-quality experience for all users.'
.tr, .tr,
style: AppStyle.title, style: AppStyle.title,
textAlign: TextAlign.center, textAlign: TextAlign.center,

View File

@@ -36,7 +36,7 @@ class CriminalDocumemtPage extends StatelessWidget {
? MyElevatedButton( ? MyElevatedButton(
title: 'Next'.tr, title: 'Next'.tr,
onPressed: () async { onPressed: () async {
if (encryptionHelper.decryptData(controller if (EncryptionHelper.instance.decryptData(controller
.responseCriminalRecordEgypt['FullName']) != .responseCriminalRecordEgypt['FullName']) !=
box.read(BoxName.nameArabic)) //todo get from server box.read(BoxName.nameArabic)) //todo get from server
{ {
@@ -141,14 +141,14 @@ Please fill in the JSON object with the extracted information, following these g
const Divider(color: AppColor.accentColor), const Divider(color: AppColor.accentColor),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'InspectionResult'.tr}: ${encryptionHelper.decryptData(ai.responseCriminalRecordEgypt['InspectionResult'])}'), '${'InspectionResult'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseCriminalRecordEgypt['InspectionResult'])}'),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'FullName'.tr}: ${encryptionHelper.decryptData(ai.responseCriminalRecordEgypt['FullName'])}', '${'FullName'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseCriminalRecordEgypt['FullName'])}',
style: AppStyle.title.copyWith( style: AppStyle.title.copyWith(
color: encryptionHelper.decryptData(ai color: EncryptionHelper.instance.decryptData(ai
.responseCriminalRecordEgypt['FullName']) == .responseCriminalRecordEgypt['FullName']) ==
encryptionHelper.decryptData( EncryptionHelper.instance.decryptData(
ai.responseIdEgyptDriverLicense[ ai.responseIdEgyptDriverLicense[
'name_arabic']) 'name_arabic'])
? AppColor.greenColor ? AppColor.greenColor
@@ -156,7 +156,7 @@ Please fill in the JSON object with the extracted information, following these g
), ),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'NationalID'.tr}: ${encryptionHelper.decryptData(ai.responseCriminalRecordEgypt['NationalID'])}'), '${'NationalID'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseCriminalRecordEgypt['NationalID'])}'),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
Text( Text(
'${'IssueDate'.tr}: ${ai.responseCriminalRecordEgypt['IssueDate']}'), '${'IssueDate'.tr}: ${ai.responseCriminalRecordEgypt['IssueDate']}'),

View File

@@ -390,7 +390,7 @@ class InviteScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
encryptionHelper.decryptData( EncryptionHelper.instance.decryptData(
controller.driverInvitationData[index]['invitorName']), controller.driverInvitationData[index]['invitorName']),
style: const TextStyle( style: const TextStyle(
fontSize: 17, fontSize: 17,
@@ -447,7 +447,7 @@ class InviteScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
encryptionHelper EncryptionHelper.instance
.decryptData(invitation['passengerName']) .decryptData(invitation['passengerName'])
.toString(), // Handle null or missing data .toString(), // Handle null or missing data
style: const TextStyle( style: const TextStyle(
@@ -510,7 +510,7 @@ class InviteScreen extends StatelessWidget {
_buildStatItem( _buildStatItem(
context, context,
"Active Users".tr, "Active Users".tr,
encryptionHelper EncryptionHelper.instance
.decryptData(controller.driverInvitationDataToPassengers[0] .decryptData(controller.driverInvitationDataToPassengers[0]
['passengerName']) ['passengerName'])
.toString(), .toString(),

View File

@@ -327,8 +327,9 @@ class LoginCaptin extends StatelessWidget {
if (user != null) { if (user != null) {
box.write( box.write(
BoxName.emailDriver, BoxName.emailDriver,
encryptionHelper.encryptData( EncryptionHelper.instance
user.email.toString())); .encryptData(
user.email.toString()));
box.write( box.write(
BoxName.driverID, user.uid); BoxName.driverID, user.uid);
@@ -386,6 +387,19 @@ class LoginCaptin extends StatelessWidget {
style: AppStyle.subtitle, style: AppStyle.subtitle,
), ),
), ),
// GestureDetector(
// onTap: () async {
// await storage.deleteAll();
// box.erase();
// },
// child: Padding(
// padding: const EdgeInsets.all(8.0),
// child: Text(
// 'erase'.tr, // Improved wording
// style: AppStyle.subtitle,
// ),
// ),
// ),
], ],
), ),
) )

View File

@@ -80,7 +80,7 @@ class HistoryCaptain extends StatelessWidget {
.navTitleTextStyle, .navTitleTextStyle,
), ),
Text( Text(
encryptionHelper EncryptionHelper.instance
.decryptData(list['order_id']), .decryptData(list['order_id']),
style: CupertinoTheme.of(context) style: CupertinoTheme.of(context)
.textTheme .textTheme
@@ -108,8 +108,9 @@ class HistoryCaptain extends StatelessWidget {
), ),
Text( Text(
list['status'], list['status'],
style: encryptionHelper.decryptData( style: EncryptionHelper.instance
list['status']) == .decryptData(
list['status']) ==
'Apply' 'Apply'
? CupertinoTheme.of(context) ? CupertinoTheme.of(context)
.textTheme .textTheme
@@ -117,7 +118,7 @@ class HistoryCaptain extends StatelessWidget {
.copyWith( .copyWith(
color: CupertinoColors color: CupertinoColors
.systemGreen) .systemGreen)
: encryptionHelper.decryptData( : EncryptionHelper.instance.decryptData(
list['status']) == list['status']) ==
'Refused' 'Refused'
? CupertinoTheme.of(context) ? CupertinoTheme.of(context)

View File

@@ -46,7 +46,7 @@ class HistoryDetailsPage extends StatelessWidget {
CupertinoButton( CupertinoButton(
onPressed: () { onPressed: () {
String mapUrl = String mapUrl =
'https://www.google.com/maps/dir/${encryptionHelper.decryptData(res['start_location'])}/${encryptionHelper.decryptData(res['end_location'])}/'; 'https://www.google.com/maps/dir/${EncryptionHelper.instance.decryptData(res['start_location'])}/${EncryptionHelper.instance.decryptData(res['end_location'])}/';
showInBrowser(mapUrl); showInBrowser(mapUrl);
}, },
child: Container( child: Container(
@@ -79,24 +79,28 @@ class HistoryDetailsPage extends StatelessWidget {
polylineId: const PolylineId('route'), polylineId: const PolylineId('route'),
points: [ points: [
LatLng( LatLng(
double.parse(encryptionHelper double.parse(EncryptionHelper
.instance
.decryptData( .decryptData(
res['start_location']) res['start_location'])
.toString() .toString()
.split(',')[0]), .split(',')[0]),
double.parse(encryptionHelper double.parse(EncryptionHelper
.instance
.decryptData( .decryptData(
res['start_location']) res['start_location'])
.toString() .toString()
.split(',')[1]), .split(',')[1]),
), ),
LatLng( LatLng(
double.parse(encryptionHelper double.parse(EncryptionHelper
.instance
.decryptData( .decryptData(
res['end_location']) res['end_location'])
.toString() .toString()
.split(',')[0]), .split(',')[0]),
double.parse(encryptionHelper double.parse(EncryptionHelper
.instance
.decryptData( .decryptData(
res['end_location']) res['end_location'])
.toString() .toString()
@@ -115,7 +119,7 @@ class HistoryDetailsPage extends StatelessWidget {
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'${'Order ID'.tr} ${encryptionHelper.decryptData(res['id'])}', '${'Order ID'.tr} ${EncryptionHelper.instance.decryptData(res['id'])}',
style: CupertinoTheme.of(context) style: CupertinoTheme.of(context)
.textTheme .textTheme
.navActionTextStyle, .navActionTextStyle,
@@ -145,13 +149,13 @@ class HistoryDetailsPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'${'Price is'.tr} ${encryptionHelper.decryptData(res['price_for_driver'])}', '${'Price is'.tr} ${EncryptionHelper.instance.decryptData(res['price_for_driver'])}',
style: CupertinoTheme.of(context) style: CupertinoTheme.of(context)
.textTheme .textTheme
.textStyle, .textStyle,
), ),
Text( Text(
'${'Distance is'.tr} ${encryptionHelper.decryptData(res['distance'])} KM', '${'Distance is'.tr} ${EncryptionHelper.instance.decryptData(res['distance'])} KM',
style: CupertinoTheme.of(context) style: CupertinoTheme.of(context)
.textTheme .textTheme
.textStyle, .textStyle,
@@ -210,7 +214,7 @@ class HistoryDetailsPage extends StatelessWidget {
), ),
child: Center( child: Center(
child: Text( child: Text(
'${'Passenger Name is'.tr} ${encryptionHelper.decryptData(res['first_name'])} ${encryptionHelper.decryptData(res['last_name'])}', '${'Passenger Name is'.tr} ${EncryptionHelper.instance.decryptData(res['first_name'])} ${EncryptionHelper.instance.decryptData(res['last_name'])}',
style: CupertinoTheme.of(context) style: CupertinoTheme.of(context)
.textTheme .textTheme
.textStyle, .textStyle,
@@ -229,7 +233,7 @@ class HistoryDetailsPage extends StatelessWidget {
), ),
child: Center( child: Center(
child: Text( child: Text(
'${'Status is'.tr} ${encryptionHelper.decryptData(res['status'])}', '${'Status is'.tr} ${EncryptionHelper.instance.decryptData(res['status'])}',
style: CupertinoTheme.of(context) style: CupertinoTheme.of(context)
.textTheme .textTheme
.textStyle, .textStyle,

View File

@@ -536,7 +536,7 @@ class UserAccountHeader extends StatelessWidget {
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
Text( Text(
encryptionHelper.decryptData( EncryptionHelper.instance.decryptData(
box.read(BoxName.emailDriver), box.read(BoxName.emailDriver),
), ),
style: TextStyle( style: TextStyle(

View File

@@ -125,7 +125,7 @@ class HelpCaptain extends StatelessWidget {
.helpQuestionDate['message'][index]; .helpQuestionDate['message'][index];
return CupertinoListTile( return CupertinoListTile(
title: Text( title: Text(
encryptionHelper EncryptionHelper.instance
.decryptData(list['helpQuestion']), .decryptData(list['helpQuestion']),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
@@ -143,9 +143,9 @@ class HelpCaptain extends StatelessWidget {
), ),
onTap: () { onTap: () {
helpController.getIndex( helpController.getIndex(
int.parse(encryptionHelper int.parse(EncryptionHelper.instance
.decryptData(list['id'])), .decryptData(list['id'])),
encryptionHelper EncryptionHelper.instance
.decryptData(list['helpQuestion'])); .decryptData(list['helpQuestion']));
helpController helpController
.getHelpRepley(list['id'].toString()); .getHelpRepley(list['id'].toString());

View File

@@ -54,7 +54,7 @@ class HelpDetailsReplayPage extends StatelessWidget {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: helpController.status == child: helpController.status ==
'not yet' || 'not yet' ||
encryptionHelper EncryptionHelper.instance
.decryptData(helpController .decryptData(helpController
.helpQuestionRepleyDate[ .helpQuestionRepleyDate[
'message']['replay']) 'message']['replay'])
@@ -65,7 +65,7 @@ class HelpDetailsReplayPage extends StatelessWidget {
style: AppStyle.title, style: AppStyle.title,
) )
: Text( : Text(
encryptionHelper EncryptionHelper.instance
.decryptData(helpController .decryptData(helpController
.helpQuestionRepleyDate[ .helpQuestionRepleyDate[
'message']['replay']) 'message']['replay'])

View File

@@ -106,7 +106,8 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
// child: Builder(builder: (context) { // child: Builder(builder: (context) {
// return IconButton( // return IconButton(
// onPressed: () async { // onPressed: () async {
// Get.to(SmsSignupEgypt()); // await storage.deleteAll();
// box.erase();
// }, // },
// icon: const Icon( // icon: const Icon(
// FontAwesome5.grin_tears, // FontAwesome5.grin_tears,

View File

@@ -376,7 +376,7 @@ class _OrderRequestPageState extends State<OrderRequestPage> {
'notification.wav'); 'notification.wav');
controller.refuseOrder( controller.refuseOrder(
encryptionHelper.encryptData( EncryptionHelper.instance.encryptData(
controller.myList[16].toString()), controller.myList[16].toString()),
); );
controller.addRideToNotificationDriverString( controller.addRideToNotificationDriverString(

View File

@@ -74,8 +74,9 @@ class CaptainsCars extends StatelessWidget {
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 4), horizontal: 4),
child: Text( child: Text(
encryptionHelper.decryptData( EncryptionHelper.instance
car['car_plate']), .decryptData(
car['car_plate']),
style: AppStyle.title, style: AppStyle.title,
), ),
), ),

View File

@@ -95,7 +95,7 @@ GetBuilder<AI> egyptCarLicenceFront() {
IconButton( IconButton(
onPressed: () async { onPressed: () async {
ai.allMethodForAI( ai.allMethodForAI(
encryptionHelper.decryptData( EncryptionHelper.instance.decryptData(
ai.prompts[3]['prompt'].toString()), ai.prompts[3]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'car_front'); 'car_front');
@@ -143,7 +143,7 @@ GetBuilder<AI> egyptCarLicenceFront() {
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
ai.allMethodForAINewCar( ai.allMethodForAINewCar(
encryptionHelper EncryptionHelper.instance
.decryptData(ai.prompts[3]['prompt'].toString()), .decryptData(ai.prompts[3]['prompt'].toString()),
AppLink.uploadEgypt1, AppLink.uploadEgypt1,
'car_front', 'car_front',
@@ -214,7 +214,7 @@ GetBuilder<AI> egyptCarLicenceBack() {
IconButton( IconButton(
onPressed: () async { onPressed: () async {
ai.allMethodForAI( ai.allMethodForAI(
encryptionHelper.decryptData( EncryptionHelper.instance.decryptData(
ai.prompts[4]['prompt'].toString()), ai.prompts[4]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'car_back'); 'car_back');
@@ -287,7 +287,7 @@ GetBuilder<AI> egyptCarLicenceBack() {
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
ai.allMethodForAI( ai.allMethodForAI(
encryptionHelper EncryptionHelper.instance
.decryptData(ai.prompts[4]['prompt'].toString()), .decryptData(ai.prompts[4]['prompt'].toString()),
AppLink.uploadEgypt, AppLink.uploadEgypt,
'car_back'); 'car_back');

View File

@@ -73,34 +73,41 @@ class ProfileCaptain extends StatelessWidget {
driverId: driverId:
controller.captainProfileData['driverID'] ?? controller.captainProfileData['driverID'] ??
'', '',
name: encryptionHelper.decryptData((controller name: EncryptionHelper.instance.decryptData(
.captainProfileData['first_name']) ?? (controller.captainProfileData[
'') + 'first_name']) ??
'') +
' ' + ' ' +
encryptionHelper.decryptData((controller EncryptionHelper.instance.decryptData(
.captainProfileData['last_name']) ?? (controller.captainProfileData[
''), 'last_name']) ??
phoneNumber: encryptionHelper.decryptData( ''),
controller.captainProfileData['phone']) ?? phoneNumber: EncryptionHelper.instance
.decryptData(controller
.captainProfileData['phone']) ??
'', '',
email: encryptionHelper.decryptData( email: EncryptionHelper.instance.decryptData(
controller.captainProfileData['email']) ?? controller.captainProfileData['email']) ??
'', '',
birthdate: encryptionHelper.decryptData(controller birthdate: EncryptionHelper.instance.decryptData(
.captainProfileData['birthdate']) ?? controller
.captainProfileData['birthdate']) ??
'', '',
gender: encryptionHelper.decryptData(controller gender: EncryptionHelper.instance.decryptData(
.captainProfileData['gender']) ?? controller
.captainProfileData['gender']) ??
'', '',
education: encryptionHelper.decryptData(controller education: EncryptionHelper.instance.decryptData(
.captainProfileData['education']) ?? controller
.captainProfileData['education']) ??
'', '',
carMake: carMake:
controller.captainProfileData['make'] ?? '', controller.captainProfileData['make'] ?? '',
carModel: carModel:
controller.captainProfileData['model'] ?? '', controller.captainProfileData['model'] ?? '',
carPlate: encryptionHelper.decryptData(controller carPlate: EncryptionHelper.instance.decryptData(
.captainProfileData['car_plate']) ?? controller
.captainProfileData['car_plate']) ??
'', '',
carColor: carColor:
controller.captainProfileData['color'] ?? '', controller.captainProfileData['color'] ?? '',

View File

@@ -11,6 +11,7 @@ import file_selector_macos
import firebase_auth import firebase_auth
import firebase_core import firebase_core
import firebase_messaging import firebase_messaging
import flutter_app_group_directory
import flutter_image_compress_macos import flutter_image_compress_macos
import flutter_inappwebview_macos import flutter_inappwebview_macos
import flutter_local_notifications import flutter_local_notifications
@@ -38,6 +39,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin"))
FlutterAppGroupDirectoryPlugin.register(with: registry.registrar(forPlugin: "FlutterAppGroupDirectoryPlugin"))
FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin")) FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin"))
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin")) InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))

View File

@@ -351,13 +351,13 @@ packages:
source: hosted source: hosted
version: "0.7.10" version: "0.7.10"
device_info_plus: device_info_plus:
dependency: transitive dependency: "direct main"
description: description:
name: device_info_plus name: device_info_plus
sha256: "4fa68e53e26ab17b70ca39f072c285562cfc1589df5bb1e9295db90f6645f431" sha256: "72d146c6d7098689ff5c5f66bcf593ac11efc530095385356e131070333e64da"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "11.2.0" version: "11.3.0"
device_info_plus_platform_interface: device_info_plus_platform_interface:
dependency: transitive dependency: transitive
description: description:
@@ -563,6 +563,14 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_app_group_directory:
dependency: transitive
description:
name: flutter_app_group_directory
sha256: "680ef9b2dee84c237cd7bb7fc78bc45867b32556a8a5f0de61278078b9fefd05"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
flutter_cache_manager: flutter_cache_manager:
dependency: transitive dependency: transitive
description: description:
@@ -1308,6 +1316,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.5" version: "1.0.5"
jailbreak_root_detection:
dependency: "direct main"
description:
name: jailbreak_root_detection
sha256: ee98f5e69b43c758ee1779204b0926a09f0371eebe1462b876fb6a8bd130cbe5
url: "https://pub.dev"
source: hosted
version: "1.1.5"
js: js:
dependency: transitive dependency: transitive
description: description:
@@ -1348,6 +1364,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.4.13" version: "0.4.13"
jwt_decoder:
dependency: "direct main"
description:
name: jwt_decoder
sha256: "54774aebf83f2923b99e6416b4ea915d47af3bde56884eb622de85feabbc559f"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
leak_tracker: leak_tracker:
dependency: transitive dependency: transitive
description: description:
@@ -1380,6 +1404,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "5.1.1" version: "5.1.1"
live_activities:
dependency: "direct main"
description:
name: live_activities
sha256: fd5414cca16352add9bae9b949e7b5d84ca219a1eb298772174db1b3a2be4b77
url: "https://pub.dev"
source: hosted
version: "2.3.0"
local_auth: local_auth:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -1716,6 +1748,38 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.4.0" version: "1.4.0"
quick_actions:
dependency: "direct main"
description:
name: quick_actions
sha256: "7e35dd6a21f5bbd21acf6899039eaf85001a5ac26d52cbd6a8a2814505b90798"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
quick_actions_android:
dependency: transitive
description:
name: quick_actions_android
sha256: "926e50d6f879287b34d21934e6c9457f0d851f554179f2a9e8136c4acd1b7062"
url: "https://pub.dev"
source: hosted
version: "1.0.18"
quick_actions_ios:
dependency: transitive
description:
name: quick_actions_ios
sha256: "837b7e6b5973784d3da56b8c959b446b215914f20405d88cd7d22a2fb94e4e4c"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
quick_actions_platform_interface:
dependency: transitive
description:
name: quick_actions_platform_interface
sha256: "1fec7068db5122cd019e9340d3d7be5d36eab099695ef3402c7059ee058329a4"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
recase: recase:
dependency: transitive dependency: transitive
description: description:

View File

@@ -43,7 +43,6 @@ dependencies:
encrypt: ^5.0.3 encrypt: ^5.0.3
flutter_rating_bar: ^4.0.1 flutter_rating_bar: ^4.0.1
flutter_font_icons: ^2.2.5 flutter_font_icons: ^2.2.5
# device_info_plus: ^9.1.0
image_picker: ^1.0.4 image_picker: ^1.0.4
flutter_stripe: ^11.3.0 flutter_stripe: ^11.3.0
camera: ^0.11.0+1 #to be remove camera: ^0.11.0+1 #to be remove
@@ -89,6 +88,11 @@ dependencies:
youtube_player_flutter: ^9.0.4 youtube_player_flutter: ^9.0.4
flutter_confetti: ^0.3.0 flutter_confetti: ^0.3.0
slide_to_act: ^2.0.2 slide_to_act: ^2.0.2
live_activities: ^2.3.0
quick_actions: ^1.1.0
jwt_decoder: ^2.0.1
jailbreak_root_detection: ^1.1.5
device_info_plus: ^11.3.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: