Merge branch 'main' into pb-video

This commit is contained in:
leminlimez
2025-03-31 12:45:23 -04:00
4 changed files with 26 additions and 5 deletions

View File

@@ -0,0 +1,12 @@
import os
def fix_windows_path(dos_path: str, encoding=None):
if os.name == 'nt':
if (not isinstance(dos_path, str) and encoding is not None):
dos_path = dos_path.decode(encoding)
path = os.path.abspath(dos_path)
if path.startswith(u"\\\\"):
return u"\\\\?\\UNC\\" + path[2:]
return u"\\\\?\\" + path
else:
return dos_path

View File

@@ -13,6 +13,8 @@ from devicemanagement.constants import Device, Version
from devicemanagement.data_singleton import DataSingleton from devicemanagement.data_singleton import DataSingleton
from gui.apply_worker import ApplyAlertMessage from gui.apply_worker import ApplyAlertMessage
from controllers.path_handler import fix_windows_path
from tweaks.tweaks import tweaks, FeatureFlagTweak, EligibilityTweak, AITweak, BasicPlistTweak, AdvancedPlistTweak, RdarFixTweak, NullifyFileTweak from tweaks.tweaks import tweaks, FeatureFlagTweak, EligibilityTweak, AITweak, BasicPlistTweak, AdvancedPlistTweak, RdarFixTweak, NullifyFileTweak
from tweaks.custom_gestalt_tweaks import CustomGestaltTweaks from tweaks.custom_gestalt_tweaks import CustomGestaltTweaks
from tweaks.posterboard_tweak import PosterboardTweak from tweaks.posterboard_tweak import PosterboardTweak
@@ -423,7 +425,11 @@ class DeviceManager:
update_label("Restoring to device...") update_label("Restoring to device...")
restore_files(files=files_to_restore, reboot=self.auto_reboot, lockdown_client=self.data_singleton.current_device.ld) restore_files(files=files_to_restore, reboot=self.auto_reboot, lockdown_client=self.data_singleton.current_device.ld)
if tmp_pb_dir != None: if tmp_pb_dir != None:
try:
tmp_pb_dir.cleanup() tmp_pb_dir.cleanup()
except Exception as e:
# ignore clean up errors
print(str(e))
msg = "Your device will now restart." msg = "Your device will now restart."
if not self.auto_reboot: if not self.auto_reboot:
msg = "Please restart your device to see changes." msg = "Please restart your device to see changes."
@@ -431,7 +437,11 @@ class DeviceManager:
update_label("Success!") update_label("Success!")
except Exception as e: except Exception as e:
if tmp_pb_dir != None: if tmp_pb_dir != None:
try:
tmp_pb_dir.cleanup() tmp_pb_dir.cleanup()
except Exception as e2:
# ignore clean up errors
print(str(e2))
show_alert(show_apply_error(e, update_label)) show_alert(show_apply_error(e, update_label))
## RESETTING MOBILE GESTALT ## RESETTING MOBILE GESTALT

View File

@@ -4,7 +4,7 @@ import uuid
import re import re
from random import randint from random import randint
from shutil import copytree from shutil import copytree
from PySide6 import QtWidgets, QtCore, QtGui from PySide6 import QtWidgets
from .tweak_classes import Tweak from .tweak_classes import Tweak
from Sparserestore.restore import FileToRestore from Sparserestore.restore import FileToRestore
@@ -12,7 +12,6 @@ from controllers.plist_handler import set_plist_value
from controllers.files_handler import get_bundle_files from controllers.files_handler import get_bundle_files
from controllers import video_handler from controllers import video_handler
from controllers.aar.aar import wrap_in_aar from controllers.aar.aar import wrap_in_aar
from qt.ui_mainwindow import Ui_Nugget
class TendieFile: class TendieFile:
path: str path: str