Add debug export to clipboard
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
"disable": "Disable"
|
||||
},
|
||||
"sort": "Sort",
|
||||
"sortBy": "Sort by"
|
||||
"sortBy": "Sort by",
|
||||
"addToClipboard": "Add to clipboard"
|
||||
},
|
||||
"intro": {
|
||||
"termsAndPolicyCaution(rich)": "by continuing you agree with ${tap(@:about.termsAndConditions)}",
|
||||
@@ -167,7 +168,7 @@
|
||||
},
|
||||
"pageTitle": "Config Options",
|
||||
"executeConfigAsIs": "Execute Config As Is",
|
||||
"executeConfigAsIsMsg": "Executes the SingBox configs with minimal changes.",
|
||||
"executeConfigAsIsMsg": "Executes the SingBox configs with minimal changes. Can cause problems.",
|
||||
"logLevel": "Log Level",
|
||||
"resolveDestination": "Resolve Destination",
|
||||
"ipv6Mode": "IPv6 Route",
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"disable": "غیر فعال"
|
||||
},
|
||||
"sort": "مرتبسازی",
|
||||
"sortBy": "مرتبسازی براساس"
|
||||
"sortBy": "مرتبسازی براساس",
|
||||
"addToClipboard": "افزودن به کلیپبورد"
|
||||
},
|
||||
"intro": {
|
||||
"termsAndPolicyCaution(rich)": "در صورت ادامه با ${tap(@:about.termsAndConditions)} موافقت میکنید",
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"disable": "Выключить"
|
||||
},
|
||||
"sort": "Сортировать",
|
||||
"sortBy": "Сортировать по"
|
||||
"sortBy": "Сортировать по",
|
||||
"addToClipboard": ""
|
||||
},
|
||||
"intro": {
|
||||
"termsAndPolicyCaution(rich)": "продолжая, вы соглашаетесь с ${tap(@:about.termsAndConditions)}",
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"disable": "停用"
|
||||
},
|
||||
"sort": "排序",
|
||||
"sortBy": "排序方式"
|
||||
"sortBy": "排序方式",
|
||||
"addToClipboard": ""
|
||||
},
|
||||
"intro": {
|
||||
"termsAndPolicyCaution(rich)": "继续即表示您同意 ${tap(@:about.termsAndConditions)}",
|
||||
|
||||
@@ -88,9 +88,7 @@ Future<void> _lazyBootstrap(
|
||||
await filesEditor.init();
|
||||
|
||||
initLoggers(container.read, debug);
|
||||
_logger.info(
|
||||
"os: [${Platform.operatingSystem}](${Platform.operatingSystemVersion}), processor count [${Platform.numberOfProcessors}]",
|
||||
);
|
||||
_logger.info(container.read(appInfoProvider).format());
|
||||
|
||||
final silentStart = container.read(silentStartNotifierProvider);
|
||||
if (silentStart) {
|
||||
|
||||
@@ -25,6 +25,7 @@ class AppRepositoryImpl
|
||||
release: Release.read(),
|
||||
installerMedia: packageInfo.installerStore,
|
||||
operatingSystem: Platform.operatingSystem,
|
||||
operatingSystemVersion: Platform.operatingSystemVersion,
|
||||
environment: environment,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ class AppInfo with _$AppInfo {
|
||||
required Release release,
|
||||
String? installerMedia,
|
||||
required String operatingSystem,
|
||||
required String operatingSystemVersion,
|
||||
required Environment environment,
|
||||
}) = _AppInfo;
|
||||
|
||||
@@ -25,6 +26,12 @@ class AppInfo with _$AppInfo {
|
||||
? version
|
||||
: "$version ${environment.name}";
|
||||
|
||||
/// formats app info for sharing
|
||||
String format() => '''
|
||||
$name v$version ($buildNumber) ${environment.name}
|
||||
${release.name} release ${installerMedia != null ? "via $installerMedia" : ""}
|
||||
$operatingSystem [$operatingSystemVersion]''';
|
||||
|
||||
factory AppInfo.fromJson(Map<String, dynamic> json) =>
|
||||
_$AppInfoFromJson(json);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:hiddify/core/prefs/prefs.dart';
|
||||
import 'package:hiddify/utils/platform_utils.dart';
|
||||
@@ -7,6 +9,8 @@ part 'config_options.g.dart';
|
||||
|
||||
@freezed
|
||||
class ConfigOptions with _$ConfigOptions {
|
||||
const ConfigOptions._();
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.kebab)
|
||||
const factory ConfigOptions({
|
||||
@Default(false) bool executeConfigAsIs,
|
||||
@@ -36,6 +40,11 @@ class ConfigOptions with _$ConfigOptions {
|
||||
setSystemProxy: PlatformUtils.isDesktop,
|
||||
);
|
||||
|
||||
String format() {
|
||||
const encoder = JsonEncoder.withIndent(' ');
|
||||
return encoder.convert(toJson());
|
||||
}
|
||||
|
||||
factory ConfigOptions.fromJson(Map<String, dynamic> json) =>
|
||||
_$ConfigOptionsFromJson(json);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:hiddify/core/core_providers.dart';
|
||||
import 'package:hiddify/domain/constants.dart';
|
||||
@@ -45,6 +46,22 @@ class AboutPage extends HookConsumerWidget {
|
||||
slivers: [
|
||||
SliverAppBar(
|
||||
title: Text(t.about.pageTitle),
|
||||
actions: [
|
||||
PopupMenuButton(
|
||||
itemBuilder: (context) {
|
||||
return [
|
||||
PopupMenuItem(
|
||||
child: Text(t.general.addToClipboard),
|
||||
onTap: () {
|
||||
Clipboard.setData(
|
||||
ClipboardData(text: appInfo.format()),
|
||||
);
|
||||
},
|
||||
),
|
||||
];
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
SliverToBoxAdapter(
|
||||
child: Padding(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:hiddify/core/core_providers.dart';
|
||||
import 'package:hiddify/core/prefs/prefs.dart';
|
||||
@@ -23,6 +24,22 @@ class ConfigOptionsPage extends HookConsumerWidget {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(t.settings.config.pageTitle),
|
||||
actions: [
|
||||
PopupMenuButton(
|
||||
itemBuilder: (context) {
|
||||
return [
|
||||
PopupMenuItem(
|
||||
child: Text(t.general.addToClipboard),
|
||||
onTap: () {
|
||||
Clipboard.setData(
|
||||
ClipboardData(text: options.format()),
|
||||
);
|
||||
},
|
||||
),
|
||||
];
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: ListView(
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user