CH-J SM Mobileإدارة الخوادم عبر SSH
القائمة
المصدر المنشور

CH-J SM Mobile

تصفّح الأدلة والملفات الخاصة بإصدار محدد من التطبيق.

تنزيل الشيفرة المصدرية بصيغة ZIP
CH-J / SM Mobile 175 ملفات
sm-mobile-20261016T185235Z-8e93ecc1b59a تاريخ الإضافة: · تاريخ البناء:
legal_lifecycle_test.dart تاريخ الإضافة: لم يُسجَّل التاريخ 1.8 KB · 56 أسطر
الشيفرة تنزيل الملف
1import 'dart:convert';
2import 'package:flutter/material.dart';
3import 'package:flutter_test/flutter_test.dart';
4import 'package:sm_mobile/core/app_controller.dart';
5import 'package:sm_mobile/core/failure.dart';
6import 'package:sm_mobile/services/legal.dart';
7import 'support.dart';
9void main() {
10 TestWidgetsFlutterBinding.ensureInitialized();
11 test(
12 'license consent binds exact build, license and displayed guidance',
13 () async {
14 final store = MemoryStore();
15 final legal = Legal(store);
16 expect(await legal.load(), false);
17 await expectLater(
18 legal.accept(guidanceDisplayed: false),
19 throwsA(isA<Failure>()),
20 );
21 await legal.accept(guidanceDisplayed: true);
22 expect(await Legal(store).load(), true);
23 final record = jsonDecode(store.values['consent']!);
24 record['identity'] = 'different-build-same-version';
25 store.values['consent'] = jsonEncode(record);
26 expect(await Legal(store).load(), false);
27 },
28 );
29 test('Vault cannot initialize before explicit license acceptance', () async {
30 final c = AppController(MemoryStore());
31 await c.initialize();
32 await expectLater(
33 c.openVault('valid master password', create: true),
34 throwsA(isA<Failure>()),
35 );
36 expect(await c.vault.exists(), false);
37 c.dispose();
38 });
39 test(
40 'background cancels Vault initialization and invalidates pending work',
41 () async {
42 final c = AppController(MemoryStore());
43 await c.initialize();
44 await c.acceptLicense();
45 final opening = c.openVault(
46 'valid background master password',
47 create: true,
48 );
49 c.didChangeAppLifecycleState(AppLifecycleState.paused);
50 await expectLater(opening, throwsA(isA<Failure>()));
51 expect(c.vault.unlocked, false);
52 expect(c.ssh.connected, false);
53 c.dispose();
54 },
55 );
SHA-256b6c6bea214973a3b8d248dde7fb248eed8fcff544b402f7b6d41b62f77338908

CH-J Proprietary Software License 1.14 · تُتاح الشيفرة المصدرية بموجب CH-J Proprietary Software License 1.14. وإتاحتها لا تغيّر شروط الترخيص ولا تمنح حقوقًا إضافية.

SHA-256 للأرشيف46e427a43e87af091004f36145590bda8fe90086dfb0f631afeb5029fb0b5655
الملفات