Skip to content

Commit

Permalink
display mimir-ua in about page on debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
liplum committed Oct 14, 2024
1 parent e4eecb8 commit cc9df88
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
24 changes: 12 additions & 12 deletions lib/backend/network/ua.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> fixed, Map<String, String?> kv) {
Expand Down
8 changes: 7 additions & 1 deletion lib/settings/page/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -88,7 +89,12 @@ class _AboutSettingsPageState extends ConsumerState<AboutSettingsPage> {
DetailListTile(
title: "UUID",
subtitle: R.uuid,
)
),
if (kDebugMode)
DetailListTile(
title: "Mimir user agent",
subtitle: buildMimirUa(),
),
],
),
],
Expand Down

0 comments on commit cc9df88

Please sign in to comment.