feat: N1d/N2/N3 + قانون فلاتر وإعادة ضبط تطبيق السائق
الباك إند: - تعيين أول أدمن صار يُنشئ المستخدم إن لم يوجد — كان يشترط دخولاً سابقاً، وهي بيضة ودجاجة تمنع الدخول إلى لوحة أي مستأجر جديد أصلاً. - OTP_DEV_MODE كان يفشل مفتوحاً (`!== 'false'`): غياب المتغيّر أو خطأ مطبعي يترك الإنتاج برمز ثابت يفتح كل حساب، ويحرس السحب المالي كذلك. صار `=== 'true'` في الإعداد وفي قارئَيه، مع تحذير عند الإقلاع. - N2: التحقّق من اللوغو عند الرفع (PNG/JPEG · 512+ · مربّع · سقف 5MB) عبر قراءة الترويسة بلا اعتمادية — بدل اكتشاف أيقونة ممطوطة بعد النشر. N3: السكربت يولّد build_config.dart بأعلام const (طبقات docs/22 §1.5)، ويضبط bundle IDs واسم التطبيق والأيقونات/splash، و--build يشغّل Shorebird. فلاتر: - docs/23: قانون مُلزِم للتطبيقين (البنية · Cubit · طبقة الشبكة · الأعلام). - السائق: أُزيل Dart القديم (GetX) مع الإبقاء على الأصيل والإضافات وشهادات التوقيع وShorebird وFirebase الخاص به، وأُعيد هيكلته مطابقاً للراكب. - طبقة الشبكة ترسل x-device-id وتجدّد التوكن عند 401 مرة واحدة فقط. - الحزم موحّدة بين التطبيقين، والـAPI https حصراً في الاثنين. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
3ab74a13a8
commit
de4bbd00ac
@@ -1,80 +0,0 @@
|
||||
import 'dart:io';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
import '../../constant/box_name.dart';
|
||||
|
||||
class DeviceInfo {
|
||||
final String? manufacturer;
|
||||
final String? model;
|
||||
final String? deviceId;
|
||||
final String? osVersion;
|
||||
final String? platform;
|
||||
final String? deviceName;
|
||||
final bool? isPhysicalDevice;
|
||||
|
||||
DeviceInfo({
|
||||
this.manufacturer,
|
||||
this.model,
|
||||
this.deviceId,
|
||||
this.osVersion,
|
||||
this.platform,
|
||||
this.deviceName,
|
||||
this.isPhysicalDevice,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'manufacturer': manufacturer,
|
||||
'model': model,
|
||||
'deviceId': deviceId,
|
||||
'osVersion': osVersion,
|
||||
'platform': platform,
|
||||
'deviceName': deviceName,
|
||||
'isPhysicalDevice': isPhysicalDevice,
|
||||
};
|
||||
}
|
||||
|
||||
class DeviceController {
|
||||
final box = GetStorage();
|
||||
final _deviceInfo = DeviceInfoPlugin();
|
||||
|
||||
Future<DeviceInfo> getDeviceInfo() async {
|
||||
if (Platform.isAndroid) {
|
||||
return await _getAndroidDeviceInfo();
|
||||
} else if (Platform.isIOS) {
|
||||
return await _getIosDeviceInfo();
|
||||
}
|
||||
throw UnsupportedError('Unsupported platform');
|
||||
}
|
||||
|
||||
Future<DeviceInfo> _getAndroidDeviceInfo() async {
|
||||
final androidInfo = await _deviceInfo.androidInfo;
|
||||
final deviceInfo = DeviceInfo(
|
||||
manufacturer: androidInfo.manufacturer,
|
||||
model: androidInfo.model,
|
||||
deviceId: androidInfo.serialNumber,
|
||||
osVersion: androidInfo.version.release,
|
||||
platform: 'Android',
|
||||
deviceName: androidInfo.device,
|
||||
isPhysicalDevice: androidInfo.isPhysicalDevice,
|
||||
);
|
||||
|
||||
box.write(BoxName.deviceInfo, deviceInfo.toJson());
|
||||
return deviceInfo;
|
||||
}
|
||||
|
||||
Future<DeviceInfo> _getIosDeviceInfo() async {
|
||||
final iosInfo = await _deviceInfo.iosInfo;
|
||||
final deviceInfo = DeviceInfo(
|
||||
manufacturer: 'Apple',
|
||||
model: iosInfo.model,
|
||||
deviceId: iosInfo.identifierForVendor,
|
||||
osVersion: iosInfo.systemVersion,
|
||||
platform: 'iOS',
|
||||
deviceName: iosInfo.name,
|
||||
isPhysicalDevice: iosInfo.isPhysicalDevice,
|
||||
);
|
||||
|
||||
box.write(BoxName.deviceInfo, deviceInfo.toJson());
|
||||
return deviceInfo;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user