mirror of
https://github.com/leminlimez/Nugget.git
synced 2025-04-08 04:23:05 +08:00
use rarfile on windows instead of zipfile
This commit is contained in:
@@ -19,8 +19,8 @@ from tweaks.tweaks import tweaks
|
|||||||
from tweaks.custom_gestalt_tweaks import CustomGestaltTweaks, ValueTypeStrings
|
from tweaks.custom_gestalt_tweaks import CustomGestaltTweaks, ValueTypeStrings
|
||||||
from tweaks.daemons_tweak import Daemon
|
from tweaks.daemons_tweak import Daemon
|
||||||
|
|
||||||
App_Version = "5.0.2"
|
App_Version = "5.0.3"
|
||||||
App_Build = 0
|
App_Build = 1
|
||||||
|
|
||||||
class Page(Enum):
|
class Page(Enum):
|
||||||
Home = 0
|
Home = 0
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
pymobiledevice3
|
pymobiledevice3
|
||||||
PySide6-Essentials
|
PySide6-Essentials
|
||||||
PyInstaller
|
PyInstaller
|
||||||
|
rarfile
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import zipfile
|
import zipfile
|
||||||
|
import rarfile
|
||||||
import uuid
|
import uuid
|
||||||
import re
|
import re
|
||||||
from random import randint
|
from random import randint
|
||||||
@@ -182,7 +183,16 @@ class PosterboardTweak(Tweak):
|
|||||||
for tendie in self.tendies:
|
for tendie in self.tendies:
|
||||||
zip_output = os.path.join(output_dir, str(uuid.uuid4()))
|
zip_output = os.path.join(output_dir, str(uuid.uuid4()))
|
||||||
os.makedirs(zip_output)
|
os.makedirs(zip_output)
|
||||||
with zipfile.ZipFile(tendie.path, 'r') as zip_ref:
|
if os == 'nt':
|
||||||
zip_ref.extractall(zip_output)
|
rar_archive = rarfile.RarFile(tendie.path)
|
||||||
|
try:
|
||||||
|
# Extract the contents to the target directory
|
||||||
|
rar_archive.extractall(path=zip_output)
|
||||||
|
finally:
|
||||||
|
# Close the RAR file to release resources
|
||||||
|
rar_archive.close()
|
||||||
|
else:
|
||||||
|
with zipfile.ZipFile(tendie.path, 'r') as zip_ref:
|
||||||
|
zip_ref.extractall(zip_output)
|
||||||
# add the files
|
# add the files
|
||||||
self.recursive_add(files_to_restore, curr_path=output_dir)
|
self.recursive_add(files_to_restore, curr_path=output_dir)
|
||||||
|
|||||||
Reference in New Issue
Block a user