fix ai spoofing

This commit is contained in:
leminlimez
2024-10-28 18:09:56 -04:00
parent a312c7b2b0
commit 6f6cd20c34
5 changed files with 5010 additions and 4 deletions

View File

@@ -2,12 +2,14 @@ from enum import Enum
from pymobiledevice3.lockdown import LockdownClient
class Device:
def __init__(self, uuid: int, name: str, version: str, build: str, model: str, locale: str, ld: LockdownClient):
def __init__(self, uuid: int, name: str, version: str, build: str, model: str, hardware: str, cpu: str, locale: str, ld: LockdownClient):
self.uuid = uuid
self.name = name
self.version = version
self.build = build
self.model = model
self.hardware = hardware
self.cpu = cpu
self.locale = locale
self.ld = ld

View File

@@ -57,13 +57,27 @@ class DeviceManager:
ld = create_using_usbmux(serial=device.serial)
vals = ld.all_values
model = vals['ProductType']
hardware = vals['HardwareModel']
cpu = vals['HardwarePlatform']
try:
product_type = settings.value(device.serial + "_model", "", type=str)
hardware_type = settings.value(device.serial + "_hardware", "", type=str)
cpu_type = settings.value(device.serial + "_cpu", "", type=str)
if product_type == "":
# save the new product type
settings.setValue(device.serial + "_model", model)
else:
model = product_type
if hardware_type == "":
# save the new hardware model
settings.setValue(device.serial + "_hardware", hardware)
else:
hardware = hardware_type
if cpu_type == "":
# save the new cpu model
settings.setValue(device.serial + "_cpu", cpu)
else:
cpu = cpu_type
except:
pass
dev = Device(
@@ -72,6 +86,8 @@ class DeviceManager:
version=vals['ProductVersion'],
build=vals['BuildVersion'],
model=model,
hardware=hardware,
cpu=cpu,
locale=ld.locale,
ld=ld
)
@@ -94,6 +110,8 @@ class DeviceManager:
self.data_singleton.gestalt_path = None
self.current_device_index = 0
tweaks["SpoofModel"].value[0] = "Placeholder"
tweaks["SpoofHardware"].value[0] = "Placeholder"
tweaks["SpoofCPU"].value[0] = "Placeholder"
else:
self.data_singleton.current_device = self.devices[index]
if Version(self.devices[index].version) < Version("17.0"):
@@ -102,6 +120,8 @@ class DeviceManager:
else:
self.data_singleton.device_available = True
tweaks["SpoofModel"].value[0] = self.data_singleton.current_device.model
tweaks["SpoofHardware"].value[0] = self.data_singleton.current_device.hardware
tweaks["SpoofCPU"].value[0] = self.data_singleton.current_device.cpu
self.current_device_index = index
def get_current_device_name(self) -> str:
@@ -319,8 +339,10 @@ class DeviceManager:
# restore to the device
update_label("Restoring to device...")
try:
# remove the saved device model
# remove the saved device model, hardware, and cpu
settings.setValue(self.data_singleton.current_device.uuid + "_model", "")
settings.setValue(self.data_singleton.current_device.uuid + "_hardware", "")
settings.setValue(self.data_singleton.current_device.uuid + "_cpu", "")
domain, file_path = self.get_domain_for_path("/var/containers/Shared/SystemGroup/systemgroup.com.apple.mobilegestaltcache/Library/Caches/com.apple.MobileGestalt.plist")
restore_files(files=[FileToRestore(
contents=b"",

View File

@@ -547,6 +547,12 @@ class MainWindow(QtWidgets.QMainWindow):
tweaks["AIEligibility"].set_language_code(text)
def on_spoofedModelDrp_activated(self, index: int):
tweaks["SpoofModel"].set_selected_option(index)
if index == 0:
tweaks["SpoofHardware"].set_selected_option(0)
tweaks["SpoofCPU"].set_selected_option(0)
else:
tweaks["SpoofHardware"].set_selected_option(1)
tweaks["SpoofCPU"].set_selected_option(0)
## SPRINGBOARD OPTIONS PAGE

4974
qt/mainwindow.ui.autosave Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -41,8 +41,10 @@ tweaks = {
## AI Enabler
"AIEligibility": AITweak(),
"AIGestalt": MobileGestaltTweak("Enable Apple Intelligence (for Unsupported Devices) (Gestalt)", "A62OafQ85EJAiiqKn4agtg", min_version=Version("18.1")),
"SpoofModel": MobileGestaltPickerTweak("Spoofed Device Model", "h9jDsbgj7xIVeIQ8S3/X3Q", values=["Placeholder", "iPhone16,2", "iPhone17,4", "iPhone17,3", "iPhone17,2", "iPad16,3"], min_version=Version("18.1"), divider_below=True),
"AIGestalt": MobileGestaltMultiTweak("Enable Apple Intelligence (for Unsupported Devices) (Gestalt)", {"A62OafQ85EJAiiqKn4agtg": 1, "6J0wLdcDgChLVU8l8pz8CA": 1}, min_version=Version("18.1")),
"SpoofModel": MobileGestaltPickerTweak("Spoofed Device Model", "h9jDsbgj7xIVeIQ8S3/X3Q", values=["Placeholder", "iPhone16,2", "iPhone17,4", "iPhone17,3", "iPhone17,2", "iPad16,3"], min_version=Version("18.1")),
"SpoofHardware": MobileGestaltPickerTweak("Spoof Hardware Model", "oYicEKzVTz4/CxxE05pEgQ", values=["Placeholder", "D93AP"], min_version=Version("18.1")),
"SpoofCPU": MobileGestaltPickerTweak("Spoof CPU Model", "5pYKlGnYYBzGvAlIU8RjEQ", values=["Placeholder", "t8130"], min_version=Version("18.1"), divider_below=True),
## Springboard Tweaks
"LockScreenFootnote": BasicPlistTweak(