网络质量探测 1.1.3:自更新、HTTP/3 与中心节点
版本名 1.1.3,构建号 6。应用标识和签名未改。包含自动更新、覆盖安装、目标历史、IPv4/IPv6 开关、HTTP(含 HTTP/3)以及中心服务端一键添加节点。
This commit is contained in:
1 parent
943259774f
commit
8cdc0f436f
66 files changed
+5489
-78
No files matched your search
@@ -5,11 +5,13 @@ import 'package:path_provider/path_provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../models/session_config.dart';
|
||||
import '../models/target_history.dart';
|
||||
import 'token_vault.dart';
|
||||
|
||||
class AppStore {
|
||||
static const _key = 'netquality.settings.v2';
|
||||
static const _legacy = 'netquality.settings.v1';
|
||||
static const historyKey = 'netquality.target-history.v1';
|
||||
|
||||
Future<({SessionConfig config, String legacyEcho})> load() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
@@ -45,6 +47,16 @@ class AppStore {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setString(_key, jsonEncode(config.toJson()));
|
||||
}
|
||||
|
||||
Future<TargetHistory> loadHistory() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
return TargetHistory.decode(prefs.getString(historyKey) ?? '');
|
||||
}
|
||||
|
||||
Future<void> saveHistory(TargetHistory history) async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setString(historyKey, history.encode());
|
||||
}
|
||||
}
|
||||
|
||||
Future<TokenVault> openTokenVault() async {
|
||||
|
||||
@@ -101,3 +101,5 @@ class FileTokenVault implements TokenVault {
|
||||
const echoTokenKey = 'target-echo-token';
|
||||
|
||||
String nodeTokenKey(String nodeId) => 'node-token.$nodeId';
|
||||
|
||||
String centerTokenKey(String centerId) => 'center-token.$centerId';
|
||||
Reference in new issue
Block a user