mirror of
https://github.com/leminlimez/Nugget.git
synced 2025-04-08 04:23:05 +08:00
fix ids not randomizing per uuid
This commit is contained in:
@@ -19,7 +19,7 @@ from tweaks.custom_gestalt_tweaks import CustomGestaltTweaks, ValueTypeStrings
|
|||||||
from tweaks.daemons_tweak import Daemon
|
from tweaks.daemons_tweak import Daemon
|
||||||
|
|
||||||
App_Version = "5.0"
|
App_Version = "5.0"
|
||||||
App_Build = 3
|
App_Build = 4
|
||||||
|
|
||||||
class Page(Enum):
|
class Page(Enum):
|
||||||
Home = 0
|
Home = 0
|
||||||
|
|||||||
@@ -36,16 +36,18 @@ class PosterboardTweak(Tweak):
|
|||||||
if isAdding:
|
if isAdding:
|
||||||
# randomize uuid
|
# randomize uuid
|
||||||
folder_name = folder
|
folder_name = folder
|
||||||
|
curr_randomized_id = randomizedID
|
||||||
if randomizeUUID:
|
if randomizeUUID:
|
||||||
folder_name = str(uuid.uuid4()).upper()
|
folder_name = str(uuid.uuid4()).upper()
|
||||||
|
curr_randomized_id = randint(9999, 99999)
|
||||||
# if file then add it, otherwise recursively call again
|
# if file then add it, otherwise recursively call again
|
||||||
if os.path.isfile(os.path.join(curr_path, folder)):
|
if os.path.isfile(os.path.join(curr_path, folder)):
|
||||||
try:
|
try:
|
||||||
# update plist ids if needed
|
# update plist ids if needed
|
||||||
new_contents = None
|
new_contents = None
|
||||||
contents_path = os.path.join(curr_path, folder)
|
contents_path = os.path.join(curr_path, folder)
|
||||||
if randomizedID != None:
|
if curr_randomized_id != None:
|
||||||
new_contents = self.update_plist_id(curr_path, folder, randomizedID)
|
new_contents = self.update_plist_id(curr_path, folder, curr_randomized_id)
|
||||||
if new_contents != None:
|
if new_contents != None:
|
||||||
contents_path = None
|
contents_path = None
|
||||||
files_to_restore.append(FileToRestore(
|
files_to_restore.append(FileToRestore(
|
||||||
@@ -57,7 +59,7 @@ class PosterboardTweak(Tweak):
|
|||||||
except IOError:
|
except IOError:
|
||||||
print(f"Failed to open file: {folder}") # TODO: Add QDebug equivalent
|
print(f"Failed to open file: {folder}") # TODO: Add QDebug equivalent
|
||||||
else:
|
else:
|
||||||
self.recursive_add(files_to_restore, os.path.join(curr_path, folder), f"{restore_path}/{folder_name}", isAdding, randomizedID=randomizedID)
|
self.recursive_add(files_to_restore, os.path.join(curr_path, folder), f"{restore_path}/{folder_name}", isAdding, randomizedID=curr_randomized_id)
|
||||||
else:
|
else:
|
||||||
# look for container folder
|
# look for container folder
|
||||||
name = folder.lower()
|
name = folder.lower()
|
||||||
@@ -70,7 +72,7 @@ class PosterboardTweak(Tweak):
|
|||||||
os.path.join(curr_path, folder),
|
os.path.join(curr_path, folder),
|
||||||
restore_path="/Library/Application Support/PRBPosterExtensionDataStore/61/Extensions/com.apple.WallpaperKit.CollectionsPoster/descriptors",
|
restore_path="/Library/Application Support/PRBPosterExtensionDataStore/61/Extensions/com.apple.WallpaperKit.CollectionsPoster/descriptors",
|
||||||
isAdding=True,
|
isAdding=True,
|
||||||
randomizeUUID=True, randomizedID=randint(9999, 99999)
|
randomizeUUID=True
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self.recursive_add(files_to_restore, os.path.join(curr_path, folder), isAdding=False)
|
self.recursive_add(files_to_restore, os.path.join(curr_path, folder), isAdding=False)
|
||||||
|
|||||||
Reference in New Issue
Block a user