feat(spoof): обновил фингерпринт и версию до 26.19.2 + миграция старых профилей

This commit is contained in:
klockky
2026-06-23 16:32:31 +03:00
parent 4e6b77853f
commit a6acbfb115
3 changed files with 62 additions and 6 deletions
+22 -3
View File
@@ -8,8 +8,8 @@ import '../../models/spoof_profile.dart';
import 'token_storage.dart';
class SpoofingService {
static const String hardcodedAppVersion = '26.17.1';
static const int hardcodedBuildNumber = 6712;
static const String hardcodedAppVersion = '26.19.2';
static const int hardcodedBuildNumber = 6732;
static const String pendingScope = 'pending';
static const String _legacyEnabledKey = 'spoofing_enabled';
@@ -179,7 +179,9 @@ class SpoofingService {
final raw = prefs.getString(_profileKey(scope));
if (raw != null && raw.isNotEmpty) {
try {
return SpoofProfile.fromJson(jsonDecode(raw) as Map<String, dynamic>);
final profile =
SpoofProfile.fromJson(jsonDecode(raw) as Map<String, dynamic>);
return _migrateVersion(prefs, scope, profile);
} catch (_) {}
}
if (scope != pendingScope) {
@@ -188,6 +190,23 @@ class SpoofingService {
return null;
}
static Future<SpoofProfile> _migrateVersion(
SharedPreferences prefs,
String scope,
SpoofProfile profile,
) async {
if (profile.appVersion == hardcodedAppVersion &&
profile.buildNumber == hardcodedBuildNumber) {
return profile;
}
final migrated = profile.copyWith(
appVersion: hardcodedAppVersion,
buildNumber: hardcodedBuildNumber,
);
await prefs.setString(_profileKey(scope), jsonEncode(migrated.toJson()));
return migrated;
}
static Future<SpoofProfile?> _migrateLegacy(
SharedPreferences prefs,
String scope,