From 5c6e54864d45f5bdc7e7b9e070ba5352b23e8e49 Mon Sep 17 00:00:00 2001 From: Kima Date: Sun, 17 Sep 2023 14:10:22 +0200 Subject: [PATCH] user agent shit again --- filcnaplo/lib/models/config.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/filcnaplo/lib/models/config.dart b/filcnaplo/lib/models/config.dart index 510ce22..1cc2557 100644 --- a/filcnaplo/lib/models/config.dart +++ b/filcnaplo/lib/models/config.dart @@ -3,18 +3,22 @@ import 'dart:io'; class Config { String _userAgent; Map? json; - static const String _version = String.fromEnvironment("APPVER", defaultValue: "2.2.0"); + static const String _version = + String.fromEnvironment("APPVER", defaultValue: "3.0.4"); Config({required String userAgent, this.json}) : _userAgent = userAgent; factory Config.fromJson(Map json) { return Config( - userAgent: json["user_agent"] ?? "hu.refilc.naplo/\$0/\$1/\$2", + userAgent: json["user_agent"] ?? "hu.ekreta.student/\$0/\$1/\$2", json: json, ); } - String get userAgent => _userAgent.replaceAll("\$0", _version).replaceAll("\$1", platform).replaceAll("\$2", "0"); + String get userAgent => _userAgent + .replaceAll("\$0", _version) + .replaceAll("\$1", platform) + .replaceAll("\$2", "0"); static String get platform { if (Platform.isAndroid) {