mirror of
https://github.com/leminlimez/Nugget.git
synced 2025-04-08 04:23:05 +08:00
fix domain sorting error
This commit is contained in:
@@ -4,7 +4,7 @@ from pymobiledevice3.services.installation_proxy import InstallationProxyService
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
class FileToRestore:
|
class FileToRestore:
|
||||||
def __init__(self, contents: str, restore_path: str, contents_path: str = None, domain: str = None, owner: int = 501, group: int = 501):
|
def __init__(self, contents: str, restore_path: str, contents_path: str = None, domain: str = "", owner: int = 501, group: int = 501):
|
||||||
self.contents = contents
|
self.contents = contents
|
||||||
self.contents_path = contents_path
|
self.contents_path = contents_path
|
||||||
self.restore_path = restore_path
|
self.restore_path = restore_path
|
||||||
@@ -95,7 +95,7 @@ def restore_files(files: list[FileToRestore], reboot: bool = False, lockdown_cli
|
|||||||
last_path = ""
|
last_path = ""
|
||||||
exploit_only = True
|
exploit_only = True
|
||||||
for file in sorted_files:
|
for file in sorted_files:
|
||||||
if file.domain == None:
|
if file.domain == "":
|
||||||
last_domain = concat_exploit_file(file, files_list, last_domain)
|
last_domain = concat_exploit_file(file, files_list, last_domain)
|
||||||
else:
|
else:
|
||||||
last_domain, last_path = concat_regular_file(file, files_list, last_domain, last_path)
|
last_domain, last_path = concat_regular_file(file, files_list, last_domain, last_path)
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ class DeviceManager:
|
|||||||
# returns Domain: str?, Path: str
|
# returns Domain: str?, Path: str
|
||||||
if self.get_current_device_supported() and not path.startswith("/var/mobile/") and not owner == 0:
|
if self.get_current_device_supported() and not path.startswith("/var/mobile/") and not owner == 0:
|
||||||
# don't do anything on sparserestore versions
|
# don't do anything on sparserestore versions
|
||||||
return path, None
|
return path, ""
|
||||||
fully_patched = self.get_current_device_patched()
|
fully_patched = self.get_current_device_patched()
|
||||||
# just make the Sys Containers to use the regular way (won't work for mga)
|
# just make the Sys Containers to use the regular way (won't work for mga)
|
||||||
sysSharedContainer = "SysSharedContainerDomain-"
|
sysSharedContainer = "SysSharedContainerDomain-"
|
||||||
@@ -274,7 +274,7 @@ class DeviceManager:
|
|||||||
new_domain += parts[0]
|
new_domain += parts[0]
|
||||||
new_path = new_path.replace(parts[0] + "/", "")
|
new_path = new_path.replace(parts[0] + "/", "")
|
||||||
return new_path, new_domain
|
return new_path, new_domain
|
||||||
return path, None
|
return path, ""
|
||||||
|
|
||||||
def concat_file(self, contents: str, path: str, files_to_restore: list[FileToRestore], owner: int = 501, group: int = 501):
|
def concat_file(self, contents: str, path: str, files_to_restore: list[FileToRestore], owner: int = 501, group: int = 501):
|
||||||
# TODO: try using inodes here instead
|
# TODO: try using inodes here instead
|
||||||
|
|||||||
Reference in New Issue
Block a user