mirror of
https://github.com/leminlimez/Nugget.git
synced 2025-04-08 04:23:05 +08:00
add ios 16 support + remove windows path fix
This commit is contained in:
@@ -332,7 +332,7 @@ class DeviceManager:
|
||||
tmp_pb_dir = TemporaryDirectory()
|
||||
tweak.apply_tweak(
|
||||
files_to_restore=files_to_restore, output_dir=tmp_pb_dir.name,
|
||||
windows_path_fix=self.windows_path_fix
|
||||
version=self.get_current_device_version()
|
||||
)
|
||||
if tweak.enabled:
|
||||
uses_domains = True
|
||||
|
||||
@@ -20,7 +20,7 @@ from tweaks.custom_gestalt_tweaks import CustomGestaltTweaks, ValueTypeStrings
|
||||
from tweaks.daemons_tweak import Daemon
|
||||
|
||||
App_Version = "5.0.2"
|
||||
App_Build = 1
|
||||
App_Build = 0
|
||||
|
||||
class Page(Enum):
|
||||
Home = 0
|
||||
@@ -184,11 +184,9 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
self.ui.allowWifiApplyingChk.toggled.connect(self.on_allowWifiApplyingChk_toggled)
|
||||
self.ui.autoRebootChk.toggled.connect(self.on_autoRebootChk_toggled)
|
||||
self.ui.showRiskyChk.toggled.connect(self.on_showRiskyChk_toggled)
|
||||
# windows path fix toggle
|
||||
if os_name == "nt":
|
||||
self.ui.windowsPathFixChk.toggled.connect(self.on_windowsPathFixChk_toggled)
|
||||
else:
|
||||
self.ui.windowsPathFixChk.hide()
|
||||
# windows path fix toggle (depreciated)
|
||||
# TODO: Remove this from the UI and everything
|
||||
self.ui.windowsPathFixChk.hide()
|
||||
self.ui.showAllSpoofableChk.toggled.connect(self.on_showAllSpoofableChk_toggled)
|
||||
|
||||
self.ui.revertRdarChk.toggled.connect(self.on_revertRdarChk_toggled)
|
||||
|
||||
@@ -63,6 +63,7 @@ class PosterboardTweak(Tweak):
|
||||
self.bundle_id = "com.apple.PosterBoard"
|
||||
self.resetting = False
|
||||
self.resetType = 0 # 0 for descriptor 1 for prb
|
||||
self.structure_version = 61
|
||||
|
||||
def add_tendie(self, file: str):
|
||||
new_tendie = TendieFile(path=file)
|
||||
@@ -144,24 +145,29 @@ class PosterboardTweak(Tweak):
|
||||
self.recursive_add(
|
||||
files_to_restore,
|
||||
os.path.join(curr_path, folder),
|
||||
restore_path="/Library/Application Support/PRBPosterExtensionDataStore/61/Extensions/com.apple.WallpaperKit.CollectionsPoster/descriptors",
|
||||
restore_path=f"/Library/Application Support/PRBPosterExtensionDataStore/{self.structure_version}/Extensions/com.apple.WallpaperKit.CollectionsPoster/descriptors",
|
||||
isAdding=True,
|
||||
randomizeUUID=True
|
||||
)
|
||||
else:
|
||||
self.recursive_add(files_to_restore, os.path.join(curr_path, folder), isAdding=False)
|
||||
|
||||
def apply_tweak(self, files_to_restore: list[FileToRestore], output_dir: str, windows_path_fix: bool):
|
||||
def apply_tweak(self, files_to_restore: list[FileToRestore], output_dir: str, version: str):
|
||||
# unzip the file
|
||||
if not self.enabled:
|
||||
return
|
||||
if version.startswith("16"):
|
||||
# iOS 16 has a different number for the structure
|
||||
self.structure_version = 59
|
||||
else:
|
||||
self.structure_version = 61
|
||||
if self.resetting:
|
||||
# null out the folder
|
||||
file_paths = []
|
||||
if self.resetType == 0:
|
||||
# resetting descriptors
|
||||
file_paths.append("/61/Extensions/com.apple.WallpaperKit.CollectionsPoster/descriptors")
|
||||
file_paths.append("/61/Extensions/com.apple.MercuryPoster/descriptors")
|
||||
file_paths.append(f"/{self.structure_version}/Extensions/com.apple.WallpaperKit.CollectionsPoster/descriptors")
|
||||
file_paths.append(f"/{self.structure_version}/Extensions/com.apple.MercuryPoster/descriptors")
|
||||
else:
|
||||
file_paths.append("")
|
||||
for file_path in file_paths:
|
||||
@@ -173,9 +179,6 @@ class PosterboardTweak(Tweak):
|
||||
return
|
||||
elif self.tendies == None or len(self.tendies) == 0:
|
||||
return
|
||||
if os.name == "nt" and windows_path_fix:
|
||||
# try to get past directory name limit on windows
|
||||
output_dir = "\\\\?\\" + output_dir
|
||||
for tendie in self.tendies:
|
||||
zip_output = os.path.join(output_dir, str(uuid.uuid4()))
|
||||
os.makedirs(zip_output)
|
||||
|
||||
Reference in New Issue
Block a user