fix(spoof): сука коки зачем нам самостав айося в спуфе

This commit is contained in:
torvalds
2026-06-22 11:28:53 +07:00
parent eef66b4ff9
commit eaf6084451
2 changed files with 50 additions and 23 deletions
+5 -5
View File
@@ -80,12 +80,12 @@ class SpoofingService {
}
}
bool isMobile(DevicePreset p) =>
p.deviceType == 'ANDROID' || p.deviceType == 'IOS';
bool isAndroid(DevicePreset p) => p.deviceType == 'ANDROID';
final fresh = devicePresets
.where((p) => isMobile(p) && !used.contains(p.deviceName))
.where((p) => isAndroid(p) && !used.contains(p.deviceName))
.toList();
final pool = fresh.isNotEmpty ? fresh : devicePresets.where(isMobile).toList();
final pool =
fresh.isNotEmpty ? fresh : devicePresets.where(isAndroid).toList();
final preset = pool[_rng.nextInt(pool.length)];
final shortLocale = preset.locale.split(RegExp(r'[-_]')).first;
@@ -99,7 +99,7 @@ class SpoofingService {
deviceLocale: shortLocale,
deviceId: _hex(8),
deviceType: preset.deviceType,
arch: preset.deviceType == 'IOS' ? 'arm64' : 'arm64-v8a',
arch: 'arm64-v8a',
appVersion: hardcodedAppVersion,
buildNumber: hardcodedBuildNumber,
pushDeviceType: 'GCM',
+45 -18
View File
@@ -138,6 +138,9 @@ class _SpoofScreenState extends State<SpoofScreen> {
var type = profile.deviceType.isEmpty ? 'ANDROID' : profile.deviceType;
if (type == 'WEB') type = 'ANDROID';
_selectedDeviceType = type;
if (type == 'IOS' || type == 'DESKTOP') {
_selectedMethod = SpoofingMethod.full;
}
}
SpoofProfile _buildProfileFromControllers() {
@@ -237,9 +240,10 @@ class _SpoofScreenState extends State<SpoofScreen> {
}
Future<void> _applyGeneratedData() async {
final filteredPresets = devicePresets
.where((p) => p.deviceType == _selectedDeviceType)
.toList();
final type =
_selectedMethod == SpoofingMethod.full ? _selectedDeviceType : 'ANDROID';
final filteredPresets =
devicePresets.where((p) => p.deviceType == type).toList();
if (filteredPresets.isEmpty) return;
@@ -574,6 +578,10 @@ class _SpoofScreenState extends State<SpoofScreen> {
if (!confirmed || !mounted) return;
}
setState(() => _selectedMethod = next);
if (next == SpoofingMethod.partial &&
_selectedDeviceType != 'ANDROID') {
_onDeviceTypeChanged('ANDROID');
}
_syncDeviceLocale();
},
),
@@ -602,21 +610,40 @@ class _SpoofScreenState extends State<SpoofScreen> {
text: l10n.spoofDeviceTypeDescription,
),
const SizedBox(height: 12),
_buildChipSelector<String>(
options: const [
_ChipOption('ANDROID', 'Android', Icons.android_outlined),
_ChipOption('IOS', 'iOS', Icons.phone_iphone_outlined),
],
selected: _selectedDeviceType,
onSelected: _onDeviceTypeChanged,
trailing: [
_buildDisabledChip(
'Desktop',
Icons.desktop_windows_outlined,
theme,
),
],
),
if (_selectedMethod == SpoofingMethod.full)
_buildChipSelector<String>(
options: const [
_ChipOption('ANDROID', 'Android', Icons.android_outlined),
_ChipOption('IOS', 'iOS', Icons.phone_iphone_outlined),
_ChipOption(
'DESKTOP',
'Desktop',
Icons.desktop_windows_outlined,
),
],
selected: _selectedDeviceType,
onSelected: _onDeviceTypeChanged,
)
else
_buildChipSelector<String>(
options: const [
_ChipOption('ANDROID', 'Android', Icons.android_outlined),
],
selected: 'ANDROID',
onSelected: _onDeviceTypeChanged,
trailing: [
_buildDisabledChip(
'iOS',
Icons.phone_iphone_outlined,
theme,
),
_buildDisabledChip(
'Desktop',
Icons.desktop_windows_outlined,
theme,
),
],
),
],
),
),