ซอร์สที่เผยแพร่
ดาวน์โหลด ZIP ของซอร์ส
CH-J SM Mobile
เรียกดูไดเรกทอรีและไฟล์ของรุ่นแอปพลิเคชันที่ระบุ
CH-J / SM Mobile
175 ไฟล์
sm-mobile-20261016T185235Z-8e93ecc1b59a
วันที่เพิ่ม: · วันที่บิลด์:
1
import 'dart:io';2
import 'dart:typed_data';3
import 'package:path_provider/path_provider.dart';5
/// Opaque binary records too large for the keychain, such as encrypted6
/// editor drafts. Callers encrypt before writing; nothing here is secret.7
abstract interface class BlobStore {8
Future<Uint8List?> read(String name);9
Future<void> write(String name, Uint8List bytes);10
Future<void> delete(String name);11
}13
class MemoryBlobStore implements BlobStore {14
final values = <String, Uint8List>{};15
@override16
Future<Uint8List?> read(String name) async => values[name];17
@override18
Future<void> write(String name, Uint8List bytes) async =>19
values[name] = Uint8List.fromList(bytes);20
@override21
Future<void> delete(String name) async => values.remove(name);22
}24
/// Files in the app's private support directory, written atomically25
/// (temporary file, flush, rename) so a crash never leaves half a record.26
class FileBlobStore implements BlobStore {27
Future<Directory>? _root;28
Future<Directory> get root => _root ??= () async {29
final base = await getApplicationSupportDirectory();30
return Directory('${base.path}/sm-blobs').create(recursive: true);31
}();33
static String _check(String name) {34
if (!RegExp(r'^[A-Za-z0-9_-]{1,80}$').hasMatch(name)) {35
throw ArgumentError.value(name, 'name');36
}37
return name;38
}40
@override41
Future<Uint8List?> read(String name) async {42
final file = File('${(await root).path}/${_check(name)}');43
return await file.exists() ? file.readAsBytes() : null;44
}46
@override47
Future<void> write(String name, Uint8List bytes) async {48
final dir = await root;49
final target = File('${dir.path}/${_check(name)}');50
final temp = File('${dir.path}/.${_check(name)}.tmp');51
await temp.writeAsBytes(bytes, flush: true);52
await temp.rename(target.path);53
}55
@override56
Future<void> delete(String name) async {57
final file = File('${(await root).path}/${_check(name)}');58
if (await file.exists()) await file.delete();59
}60
}SHA-256
ae482658006380f09b655765829360a5614d19d84b1b6e9457c04f29eb06b7faCH-J Proprietary Software License 1.14 · ซอร์สโค้ดนี้ให้ไว้ภายใต้ CH-J Proprietary Software License 1.14 การเปิดให้เข้าถึงไม่ได้เปลี่ยนแปลงเงื่อนไขของสัญญาอนุญาตหรือให้สิทธิ์เพิ่มเติม
SHA-256 ของไฟล์บีบอัด
46e427a43e87af091004f36145590bda8fe90086dfb0f631afeb5029fb0b5655