Update: 2026-07-22 00:27:49

This commit is contained in:
Hamza-Ayed
2026-07-22 00:27:50 +03:00
parent 699b380f2b
commit cf95455bcf
5 changed files with 108 additions and 65 deletions
@@ -119,7 +119,7 @@ class PhoneAuthHelper {
var res = await CRUD()
// this for register and login //
.post(link: "${AppLink.server}/ride/firebase/addToken.php", payload: {
'token': (box.read(BoxName.tokenFCM.toString())),
'token': (box.read(BoxName.tokenFCM)),
'passengerID': box.read(BoxName.passengerID).toString(),
"fingerPrint": fingerPrint
});
@@ -190,6 +190,15 @@ void showUpdateDialog(BuildContext context) {
class DeviceHelper {
static Future<String> getDeviceFingerprint() async {
// ── التحقق من وجود بصمة مخزّنة مسبقاً ──────────────────────
// AES-GCM يستخدم IV عشوائي كل مرة، فالتشفير ينتج نتيجة مختلفة
// حتى لو النص الأصلي نفسه. لذلك نخزّن البصمة المشفرة أول مرة
// ونرجعها من التخزين في كل مرة بعدها لضمان الثبات.
final String? cachedFp = box.read(BoxName.deviceFpEncrypted);
if (cachedFp != null && cachedFp.isNotEmpty) {
return cachedFp;
}
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
var deviceData;