This commit is contained in:
hiddify
2023-12-25 20:08:54 +03:30
11 changed files with 109 additions and 79 deletions

View File

@@ -1,5 +1,26 @@
# Changelog
## [0.12.2] - 2023-12-23
### New Features and Improvements
- Updated Sing-box to Version 1.7.6
### Bug Fixes
- Fixed app log file not including stacktrace
- Fixed initialization process failing for non-essential dependencies
- Fixed analytics preferences requiring app restart
## [0.12.1] - 2023-12-21
### Bug Fixes
- Fixed Android service mode
- Fixed [preferences initialization error on Windows and Linux](https://github.com/flutter/flutter/issues/89211)
- Fixed incorrect privacy policy URL
- Bumped Android compile and target SDK version (34)
## [0.12.0] - 2023-12-20
### New Features and Improvements
@@ -99,6 +120,8 @@
- Fixed localization mistakes in Russian. [PR#95](https://github.com/hiddify/hiddify-next/pull/95) by [solokot](https://github.com/solokot)
- Fixed localization mistakes in Russian. [PR#74](https://github.com/hiddify/hiddify-next/pull/74) by [Elshad Guseynov](https://github.com/lifeindarkside)
[0.12.2]: https://github.com/hiddify/hiddify-next/releases/tag/v0.12.2
[0.12.1]: https://github.com/hiddify/hiddify-next/releases/tag/v0.12.1
[0.12.0]: https://github.com/hiddify/hiddify-next/releases/tag/v0.12.0
[0.11.1]: https://github.com/hiddify/hiddify-next/releases/tag/v0.11.1
[0.11.0]: https://github.com/hiddify/hiddify-next/releases/tag/v0.11.0

View File

@@ -1 +1 @@
core.version=0.9.1
core.version=0.9.2

View File

@@ -65,7 +65,8 @@ Future<void> lazyBootstrap(
() => container.read(sharedPreferencesProvider.future),
);
final enableAnalytics = container.read(analyticsControllerProvider);
final enableAnalytics =
await container.read(analyticsControllerProvider.future);
if (enableAnalytics) {
await _init(
"analytics",

View File

@@ -19,7 +19,7 @@ bool _testCrashReport = false;
@Riverpod(keepAlive: true)
class AnalyticsController extends _$AnalyticsController with AppLogger {
@override
bool build() {
Future<bool> build() async {
return _preferences.getBool(enableAnalyticsPrefKey) ?? true;
}
@@ -27,41 +27,47 @@ class AnalyticsController extends _$AnalyticsController with AppLogger {
ref.read(sharedPreferencesProvider).requireValue;
Future<void> enableAnalytics() async {
loggy.debug("enabling analytics");
if (!state) {
await _preferences.setBool(enableAnalyticsPrefKey, true);
if (state case AsyncData(value: final enabled)) {
loggy.debug("enabling analytics");
state = const AsyncLoading();
if (!enabled) {
await _preferences.setBool(enableAnalyticsPrefKey, true);
}
final env = ref.read(environmentProvider);
final appInfo = await ref.read(appInfoProvider.future);
final dsn = !kDebugMode || _testCrashReport ? Environment.sentryDSN : "";
final sentryLogger = SentryLoggyIntegration();
LoggerController.instance.addPrinter("analytics", sentryLogger);
await SentryFlutter.init(
(options) {
options.dsn = dsn;
options.environment = env.name;
options.dist = appInfo.release.name;
options.debug = kDebugMode;
options.enableNativeCrashHandling = true;
options.enableNdkScopeSync = true;
options.attachThreads = true;
options.tracesSampleRate = 0.20;
options.enableUserInteractionTracing = true;
options.addIntegration(sentryLogger);
options.beforeSend = sentryBeforeSend;
},
);
state = const AsyncData(true);
}
final env = ref.read(environmentProvider);
final appInfo = await ref.read(appInfoProvider.future);
final dsn = !kDebugMode || _testCrashReport ? Environment.sentryDSN : "";
final sentryLogger = SentryLoggyIntegration();
LoggerController.instance.addPrinter("analytics", sentryLogger);
await SentryFlutter.init(
(options) {
options.dsn = dsn;
options.environment = env.name;
options.dist = appInfo.release.name;
options.debug = kDebugMode;
options.enableNativeCrashHandling = true;
options.enableNdkScopeSync = true;
options.attachThreads = true;
options.tracesSampleRate = 0.20;
options.enableUserInteractionTracing = true;
options.addIntegration(sentryLogger);
options.beforeSend = sentryBeforeSend;
},
);
state = true;
}
Future<void> disableAnalytics() async {
loggy.debug("disabling analytics");
await _preferences.setBool(enableAnalyticsPrefKey, false);
await Sentry.close();
LoggerController.instance.removePrinter("analytics");
state = false;
if (state case AsyncData()) {
loggy.debug("disabling analytics");
state = const AsyncLoading();
await _preferences.setBool(enableAnalyticsPrefKey, false);
await Sentry.close();
LoggerController.instance.removePrinter("analytics");
state = const AsyncData(false);
}
}
}

View File

@@ -1,9 +1,5 @@
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:hiddify/core/app_info/app_info_provider.dart';
import 'package:hiddify/core/preferences/general_preferences.dart';
import 'package:native_dio_adapter/native_dio_adapter.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'http_client_provider.g.dart';
@@ -20,9 +16,11 @@ Dio httpClient(HttpClientRef ref) {
},
),
);
final debug = ref.read(debugModeNotifierProvider);
if (debug && (Platform.isAndroid || Platform.isIOS || Platform.isMacOS)) {
dio.httpClientAdapter = NativeAdapter();
}
// https://github.com/dart-lang/http/issues/1047
// https://github.com/cfug/dio/issues/2042
// final debug = ref.read(debugModeNotifierProvider);
// if (debug && (Platform.isAndroid || Platform.isIOS || Platform.isMacOS)) {
// dio.httpClientAdapter = NativeAdapter();
// }
return dio;
}

View File

@@ -104,7 +104,7 @@ class EnableAnalyticsPrefTile extends HookConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final t = ref.watch(translationsProvider);
final autoReport = ref.watch(analyticsControllerProvider);
final enabled = ref.watch(analyticsControllerProvider).requireValue;
return SwitchListTile(
title: Text(t.settings.general.enableAnalytics),
@@ -113,12 +113,12 @@ class EnableAnalyticsPrefTile extends HookConsumerWidget {
style: Theme.of(context).textTheme.bodySmall,
),
secondary: const Icon(Icons.bug_report),
value: autoReport,
value: enabled,
onChanged: (value) async {
if (onChanged != null) {
return onChanged!(value);
}
if (autoReport) {
if (enabled) {
await ref
.read(analyticsControllerProvider.notifier)
.disableAnalytics();

View File

@@ -73,7 +73,9 @@ class IntroPage extends HookConsumerWidget with PresLogger {
onPressed: () async {
if (isStarting.value) return;
isStarting.value = true;
if (!ref.read(analyticsControllerProvider)) {
if (!ref
.read(analyticsControllerProvider)
.requireValue) {
loggy.info("disabling analytics per user request");
try {
await ref

Submodule libcore updated: 8e9d5239f4...540c736cc1

View File

@@ -15,13 +15,13 @@ PODS:
- FlutterMacOS
- screen_retriever (0.0.1):
- FlutterMacOS
- Sentry/HybridSDK (8.15.2):
- SentryPrivate (= 8.15.2)
- Sentry/HybridSDK (8.17.2):
- SentryPrivate (= 8.17.2)
- sentry_flutter (0.0.1):
- Flutter
- FlutterMacOS
- Sentry/HybridSDK (= 8.15.2)
- SentryPrivate (8.15.2)
- Sentry/HybridSDK (= 8.17.2)
- SentryPrivate (8.17.2)
- share_plus (0.0.1):
- FlutterMacOS
- shared_preferences_foundation (0.0.1):
@@ -113,9 +113,9 @@ SPEC CHECKSUMS:
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
protocol_handler: 587e1caf6c0b92ce351ab14081968dae49cb8cc6
screen_retriever: 59634572a57080243dd1bf715e55b6c54f241a38
Sentry: 6f5742b4c47c17c9adcf265f6f328cf4a0ed1923
sentry_flutter: 2c309a1d4b45e59d02cfa15795705687f1e2081b
SentryPrivate: b2f7996f37781080f04a946eb4e377ff63c64195
Sentry: 64a9f9c3637af913adcf53deced05bbe452d1410
sentry_flutter: 57912cf425e09398bdf47f38842a1fcb9836f1be
SentryPrivate: 024c6fed507ac39ae98e6d087034160f942920d5
share_plus: 76dd39142738f7a68dd57b05093b5e8193f220f7
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
sqlite3: 6e2d4a4879854d0ec86b476bf3c3e30870bac273

View File

@@ -585,10 +585,10 @@ packages:
dependency: "direct main"
description:
name: go_router
sha256: c5fa45fa502ee880839e3b2152d987c44abae26d064a2376d4aad434cf0f7b15
sha256: ca7e4a2249f96773152f1853fa25933ac752495cdd7fdf5dafb9691bd05830fd
url: "https://pub.dev"
source: hosted
version: "12.1.3"
version: "13.0.0"
go_router_builder:
dependency: "direct dev"
description:

View File

@@ -1,7 +1,7 @@
name: hiddify
description: Cross Platform Multi Protocol Proxy Frontend.
publish_to: "none"
version: 0.12.1+1210
version: 0.12.2+1220
environment:
sdk: ">=3.2.0 <4.0.0"
@@ -13,17 +13,17 @@ dependencies:
flutter_localizations:
sdk: flutter
intl: ^0.18.1
slang: ^3.25.0
slang_flutter: ^3.25.0
slang: ^3.28.0
slang_flutter: ^3.28.0
timeago: ^3.6.0
fpdart: ^1.1.0
freezed_annotation: ^2.4.1
json_annotation: ^4.8.1
hooks_riverpod: ^2.4.8
hooks_riverpod: ^2.4.9
flutter_hooks: ^0.20.3
riverpod_annotation: ^2.3.2
riverpod_annotation: ^2.3.3
rxdart: ^0.27.7
drift: ^2.13.2
drift: ^2.14.1
sqlite3_flutter_libs: ^0.5.18
shared_preferences: ^2.2.2
dio: ^5.4.0
@@ -31,16 +31,16 @@ dependencies:
ffi: ^2.1.0
path_provider: ^2.1.1
mobile_scanner: ^3.5.5
protocol_handler: ^0.1.5
flutter_native_splash: ^2.3.6
protocol_handler: ^0.1.6
flutter_native_splash: ^2.3.8
share_plus: ^7.2.1
window_manager: ^0.3.7
tray_manager: ^0.2.0
package_info_plus: ^5.0.1
url_launcher: ^6.2.1
url_launcher: ^6.2.2
vclibs: ^0.1.0
launch_at_startup: ^0.2.2
sentry_flutter: ^7.13.2
sentry_flutter: ^7.14.0
sentry_dart_plugin: ^1.6.3
combine: ^0.5.6
path: ^1.8.3
@@ -48,13 +48,13 @@ dependencies:
flutter_loggy: ^2.0.2
meta: ^1.10.0
dartx: ^1.2.0
uuid: ^4.2.1
uuid: ^4.2.2
tint: ^2.0.1
accessibility_tools: ^1.0.0
accessibility_tools: ^1.0.1
neat_periodic_task: ^2.0.1
retry: ^3.1.2
watcher: ^1.1.0
go_router: ^12.1.1
go_router: ^13.0.0
flex_color_scheme: ^7.3.1
flutter_animate: ^4.3.0
flutter_svg: ^2.0.9
@@ -63,7 +63,7 @@ dependencies:
sliver_tools: ^0.2.12
flutter_adaptive_scaffold: ^0.1.7+1
humanizer: ^2.2.0
upgrader: ^8.3.0
upgrader: ^8.4.0
toastification: ^1.1.0
version: ^3.0.2
posix: ^6.0.1
@@ -74,19 +74,19 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
lint: ^2.2.0
lint: ^2.3.0
build_runner: ^2.4.7
json_serializable: ^6.7.1
freezed: ^2.4.5
riverpod_generator: ^2.3.8
drift_dev: ^2.13.2
freezed: ^2.4.6
riverpod_generator: ^2.3.9
drift_dev: ^2.14.1
ffigen: ^8.0.2
slang_build_runner: ^3.25.0
slang_build_runner: ^3.28.0
flutter_gen_runner: ^5.3.2
go_router_builder: ^2.3.4
go_router_builder: ^2.4.0
custom_lint: ^0.5.7
riverpod_lint: ^2.3.6
icons_launcher: ^2.1.5
riverpod_lint: ^2.3.7
icons_launcher: ^2.1.6
flutter:
uses-material-design: true