feat(spoof): обновил фингерпринт и версию до 26.19.2 + миграция старых профилей
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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<String, dynamic> toJson() => {
|
||||
'enabled': enabled,
|
||||
'device_name': deviceName,
|
||||
|
||||
Reference in New Issue
Block a user