diff --git a/lib/backend/network/ua.dart b/lib/backend/network/ua.dart index 8ebda743..075981b1 100644 --- a/lib/backend/network/ua.dart +++ b/lib/backend/network/ua.dart @@ -8,19 +8,19 @@ class MimirUserAgentDioInterceptor extends Interceptor { options.headers["User-Agent"] = buildMimirUa(); handler.next(options); } +} - String buildMimirUa() { - return _encodeMimirUa([ - "1", - "app", - "${R.meta.version}", - $locale.toLanguageTag(), - R.meta.platform.name, - R.uuid, - ], { - "installer": R.meta.installerStore, - }); - } +String buildMimirUa() { + return _encodeMimirUa([ + "1", + "app", + "${R.meta.version}", + $locale.toLanguageTag(), + R.meta.platform.name, + R.uuid, + ], { + "installer": R.meta.installerStore, + }); } String _encodeMimirUa(List fixed, Map kv) { diff --git a/lib/settings/page/about.dart b/lib/settings/page/about.dart index 73f62000..d4da3981 100644 --- a/lib/settings/page/about.dart +++ b/lib/settings/page/about.dart @@ -4,6 +4,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:mimir/agreements/entity/agreements.dart'; import 'package:mimir/agreements/page/privacy_policy.dart'; +import 'package:mimir/backend/network/ua.dart'; import 'package:mimir/design/adaptive/dialog.dart'; import 'package:mimir/design/widget/list_tile.dart'; import 'package:mimir/feature/feature.dart'; @@ -88,7 +89,12 @@ class _AboutSettingsPageState extends ConsumerState { DetailListTile( title: "UUID", subtitle: R.uuid, - ) + ), + if (kDebugMode) + DetailListTile( + title: "Mimir user agent", + subtitle: buildMimirUa(), + ), ], ), ],