CH-J Tools MobileSSH를 통한 서버 관리
메뉴
공개된 소스

CH-J Tools Mobile

특정 애플리케이션 릴리스의 디렉터리와 파일을 살펴보세요.

소스 ZIP 다운로드
CH-J / CH-J Tools Mobile 175 개 파일
sm-mobile-20261016T185235Z-8e93ecc1b59a 추가됨: · 빌드됨:
legal.dart 추가됨: 날짜 기록 없음 1.8 KB · 59 줄
코드 파일 다운로드
1import 'dart:convert';
2import 'package:cryptography/cryptography.dart';
3import 'package:flutter/services.dart';
4import '../core/build_info.dart';
5import '../core/failure.dart';
6import 'secure_store.dart';
8class Legal {
9 final SecureStore store;
10 String license = '';
11 final Map<String, String> guidance = {};
12 String? _identity;
13 Legal(this.store);
14 Future<bool> load() async {
15 try {
16 license = await rootBundle.loadString('assets/legal/LICENSE.txt');
17 if (!license.contains('Version 1.14') || license.length < 20000) {
18 throw const Failure('licenseError');
19 }
20 for (final lang in ['cs', 'de', 'en']) {
21 guidance[lang] = await rootBundle.loadString(
22 'assets/legal/guidance_$lang.md',
23 );
24 if (guidance[lang]!.isEmpty) throw const Failure('licenseError');
25 }
26 _identity = base64Encode(
27 (await Sha256().hash(
28 utf8.encode(jsonEncode([appVersion, buildId, license, guidance])),
29 )).bytes,
30 );
31 final record = await store.read('consent');
32 if (record == null) return false;
33 final data = jsonDecode(record);
34 return data['identity'] == _identity &&
35 data['accepted'] == true &&
36 data['guidanceDisplayed'] == true;
37 } catch (_) {
38 throw const Failure('licenseError');
39 }
40 }
42 Future<void> accept({required bool guidanceDisplayed}) async {
43 if (_identity == null || !guidanceDisplayed) {
44 throw const Failure('licenseError');
45 }
46 await store.write(
47 'consent',
48 jsonEncode({
49 'identity': _identity,
50 'accepted': true,
51 'guidanceDisplayed': true,
52 'version': appVersion,
53 'buildId': buildId,
54 'licenseVersion': '1.14',
55 'acceptedAt': DateTime.now().toUtc().toIso8601String(),
56 }),
57 );
58 }
SHA-256ee8e9ce7c54cdc46fb260e17eeeceef02b53c81691e87be7bfba4e03d2f5e049

CH-J Proprietary Software License 1.14 · 소스는 CH-J Proprietary Software License 1.14에 따라 제공됩니다. 소스를 공개한다고 해서 라이선스 조항이 바뀌거나 추가 권리가 부여되지는 않습니다.

압축 파일 SHA-25646e427a43e87af091004f36145590bda8fe90086dfb0f631afeb5029fb0b5655
파일