fix(spoof): persist and apply all spoofing fields

This commit is contained in:
klockky
2026-06-06 19:36:24 +03:00
parent 43ce561a2b
commit 7964c61699
3 changed files with 73 additions and 5 deletions
@@ -103,6 +103,21 @@ class _SpoofScreenState extends State<SpoofScreen> {
_buildNumberController.text =
prefs.getInt('spoof_buildnumber')?.toString() ??
'$_hardcodedBuildNumber';
_pushDeviceTypeController.text =
prefs.getString('spoof_pushdevicetype') ?? 'GCM';
final savedDeviceLocale = prefs.getString('spoof_devicelocale');
if (savedDeviceLocale != null && savedDeviceLocale.isNotEmpty) {
_deviceLocaleController.text = savedDeviceLocale;
}
final savedInstanceId = prefs.getString('spoof_instanceid');
if (savedInstanceId != null && savedInstanceId.isNotEmpty) {
_instanceIdController.text = savedInstanceId;
}
final savedClientSessionId = prefs.getInt('spoof_clientsessionid');
if (savedClientSessionId != null) {
_clientSessionIdController.text = '$savedClientSessionId';
}
String savedType = prefs.getString('spoof_devicetype') ?? 'ANDROID';
if (savedType == 'WEB') savedType = 'ANDROID';
@@ -235,6 +250,13 @@ class _SpoofScreenState extends State<SpoofScreen> {
'device_id': prefs.getString('spoof_deviceid') ?? '',
'device_type': prefs.getString('spoof_devicetype') ?? 'ANDROID',
'arch': prefs.getString('spoof_arch') ?? '',
'device_locale': prefs.getString('spoof_devicelocale') ?? '',
'app_version': prefs.getString('spoof_appversion') ?? '',
'build_number': prefs.getInt('spoof_buildnumber')?.toString() ?? '',
'push_device_type': prefs.getString('spoof_pushdevicetype') ?? '',
'instance_id': prefs.getString('spoof_instanceid') ?? '',
'client_session_id':
prefs.getInt('spoof_clientsessionid')?.toString() ?? '',
};
final newValues = {
@@ -246,6 +268,12 @@ class _SpoofScreenState extends State<SpoofScreen> {
'device_id': _deviceIdController.text,
'device_type': _selectedDeviceType,
'arch': _selectedArch,
'device_locale': _deviceLocaleController.text,
'app_version': _appVersionController.text,
'build_number': _buildNumberController.text,
'push_device_type': _pushDeviceTypeController.text,
'instance_id': _instanceIdController.text,
'client_session_id': _clientSessionIdController.text,
};
bool otherDataChanged = false;
@@ -358,6 +386,27 @@ class _SpoofScreenState extends State<SpoofScreen> {
await prefs.setString('spoof_deviceid', _deviceIdController.text);
await prefs.setString('spoof_devicetype', _selectedDeviceType);
await prefs.setString('spoof_arch', _selectedArch);
await prefs.setString('spoof_devicelocale', _deviceLocaleController.text);
await prefs.setString('spoof_appversion', _appVersionController.text);
await prefs.setString(
'spoof_pushdevicetype',
_pushDeviceTypeController.text,
);
await prefs.setString('spoof_instanceid', _instanceIdController.text);
final buildNumber = int.tryParse(_buildNumberController.text);
if (buildNumber != null) {
await prefs.setInt('spoof_buildnumber', buildNumber);
} else {
await prefs.remove('spoof_buildnumber');
}
final clientSessionId = int.tryParse(_clientSessionIdController.text);
if (clientSessionId != null) {
await prefs.setInt('spoof_clientsessionid', clientSessionId);
} else {
await prefs.remove('spoof_clientsessionid');
}
}
void _generateNewDeviceId() {