From a6acbfb115cf661cd2f48cab2d17540bbd6b5cc3 Mon Sep 17 00:00:00 2001 From: klockky Date: Tue, 23 Jun 2026 16:32:31 +0300 Subject: [PATCH] =?UTF-8?q?feat(spoof):=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=B8=D0=BB=20=D1=84=D0=B8=D0=BD=D0=B3=D0=B5=D1=80=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=D0=BD=D1=82=20=D0=B8=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8?= =?UTF-8?q?=D1=8E=20=D0=B4=D0=BE=2026.19.2=20+=20=D0=BC=D0=B8=D0=B3=D1=80?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8F=20=D1=81=D1=82=D0=B0=D1=80=D1=8B=D1=85?= =?UTF-8?q?=20=D0=BF=D1=80=D0=BE=D1=84=D0=B8=D0=BB=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/protocol/chat_cache_fingerprint.dart | 6 +-- lib/core/storage/spoofing_service.dart | 25 +++++++++++-- lib/models/spoof_profile.dart | 37 +++++++++++++++++++ 3 files changed, 62 insertions(+), 6 deletions(-) diff --git a/lib/core/protocol/chat_cache_fingerprint.dart b/lib/core/protocol/chat_cache_fingerprint.dart index b2ab84a..15261e5 100644 --- a/lib/core/protocol/chat_cache_fingerprint.dart +++ b/lib/core/protocol/chat_cache_fingerprint.dart @@ -5,13 +5,13 @@ import 'package:crypto/crypto.dart'; class ChatCacheFingerprint { static final Uint8List _signatureDigest = _hex( - '1684414033eb263e2c615f8b7df5ed8793850a07656304997fbf07e9e21e1e93', + '2917772b58095daca2a99a099f85ee0214c9a9d72bea2007cbaf5b45f29c8d18', ); static final Uint8List _soDigest = _hex( - 'c77b89270f44bd26c218a946c18911f2b156312693ea00b419d169b71c1ed111', + 'ec3f447f41e161b0dec7ce6d5ce9d52428895da54e0d9d036d93913b45c7a3c1', ); static final Uint8List _dexDigest = _hex( - '490a2746c7ebbff050353c575a186ca65bc708f9b6e0c1329b59a3bfab6c3924', + 'd590910db09464e19553e22c184c135ace8c6cb6d4407920f949d561724fb8fe', ); static Uint8List compute(int callsSeed, String deviceId) { diff --git a/lib/core/storage/spoofing_service.dart b/lib/core/storage/spoofing_service.dart index 4f78800..f0eee5a 100644 --- a/lib/core/storage/spoofing_service.dart +++ b/lib/core/storage/spoofing_service.dart @@ -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); + final profile = + SpoofProfile.fromJson(jsonDecode(raw) as Map); + return _migrateVersion(prefs, scope, profile); } catch (_) {} } if (scope != pendingScope) { @@ -188,6 +190,23 @@ class SpoofingService { return null; } + static Future _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 _migrateLegacy( SharedPreferences prefs, String scope, diff --git a/lib/models/spoof_profile.dart b/lib/models/spoof_profile.dart index 215f253..d8e3259 100644 --- a/lib/models/spoof_profile.dart +++ b/lib/models/spoof_profile.dart @@ -35,6 +35,43 @@ class SpoofProfile { this.userAgent = '', }); + SpoofProfile copyWith({ + bool? enabled, + String? deviceName, + String? osVersion, + String? screen, + String? timezone, + String? locale, + String? deviceLocale, + String? deviceId, + String? deviceType, + String? arch, + String? appVersion, + int? buildNumber, + String? pushDeviceType, + String? instanceId, + int? clientSessionId, + String? userAgent, + }) => + SpoofProfile( + enabled: enabled ?? this.enabled, + deviceName: deviceName ?? this.deviceName, + osVersion: osVersion ?? this.osVersion, + screen: screen ?? this.screen, + timezone: timezone ?? this.timezone, + locale: locale ?? this.locale, + deviceLocale: deviceLocale ?? this.deviceLocale, + deviceId: deviceId ?? this.deviceId, + deviceType: deviceType ?? this.deviceType, + arch: arch ?? this.arch, + appVersion: appVersion ?? this.appVersion, + buildNumber: buildNumber ?? this.buildNumber, + pushDeviceType: pushDeviceType ?? this.pushDeviceType, + instanceId: instanceId ?? this.instanceId, + clientSessionId: clientSessionId ?? this.clientSessionId, + userAgent: userAgent ?? this.userAgent, + ); + Map toJson() => { 'enabled': enabled, 'device_name': deviceName,