diff --git a/StikJIT.xcodeproj/project.pbxproj b/StikJIT.xcodeproj/project.pbxproj index d4d4a9b..f8919d9 100644 --- a/StikJIT.xcodeproj/project.pbxproj +++ b/StikJIT.xcodeproj/project.pbxproj @@ -438,7 +438,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"StikJIT/Preview Content\""; - DEVELOPMENT_TEAM = SZ977XLF24; + DEVELOPMENT_TEAM = 7YA8C4S586; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -463,7 +463,7 @@ ); MACOSX_DEPLOYMENT_TARGET = 15.1; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.stik.StikJIT; + PRODUCT_BUNDLE_IDENTIFIER = com.dusk.StikJIT; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = auto; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; @@ -486,7 +486,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"StikJIT/Preview Content\""; - DEVELOPMENT_TEAM = SZ977XLF24; + DEVELOPMENT_TEAM = 7YA8C4S586; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -511,7 +511,7 @@ ); MACOSX_DEPLOYMENT_TARGET = 15.1; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.stik.StikJIT; + PRODUCT_BUNDLE_IDENTIFIER = com.dusk.StikJIT; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = auto; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; diff --git a/StikJIT/StikJITApp.swift b/StikJIT/StikJITApp.swift index 8a1ea00..093ab46 100644 --- a/StikJIT/StikJITApp.swift +++ b/StikJIT/StikJITApp.swift @@ -292,8 +292,8 @@ class MountingProgress: ObservableObject { mountingThread = Thread { let mount = mountPersonalDDI(imagePath: URL.documentsDirectory.appendingPathComponent("DDI/Image.dmg").path, trustcachePath: URL.documentsDirectory.appendingPathComponent("DDI/Image.dmg.trustcache").path, manifestPath: URL.documentsDirectory.appendingPathComponent("DDI/BuildManifest.plist").path, pairingFilePath: pairingpath) - if !mount { - showAlert(title: "Error", message: "An Error Occured when Mounting the DDI", showOk: true, showTryAgain: true) { cool in + if mount != 0 { + showAlert(title: "Error", message: "An Error Occured when Mounting the DDI\nError Code: " + String(mount), showOk: true, showTryAgain: true) { cool in if cool { self.mount() } diff --git a/StikJIT/Utilities/mountDDI.swift b/StikJIT/Utilities/mountDDI.swift index ff5432d..926a97e 100644 --- a/StikJIT/Utilities/mountDDI.swift +++ b/StikJIT/Utilities/mountDDI.swift @@ -115,7 +115,7 @@ func isMounted() -> Bool { } } -func mountPersonalDDI(deviceIP: String = "10.7.0.1", imagePath: String, trustcachePath: String, manifestPath: String, pairingFilePath: String) -> Bool { +func mountPersonalDDI(deviceIP: String = "10.7.0.1", imagePath: String, trustcachePath: String, manifestPath: String, pairingFilePath: String) -> Int { idevice_init_logger(Debug, Disabled, nil) print("Mounting \(imagePath) \(trustcachePath) \(manifestPath)") @@ -124,7 +124,7 @@ func mountPersonalDDI(deviceIP: String = "10.7.0.1", imagePath: String, trustcac let trustcache = readFile(path: trustcachePath), let buildManifest = readFile(path: manifestPath) else { print("Failed to read one or more files") - return false + return 1 // EC: 1 } var addr = sockaddr_in() @@ -135,14 +135,14 @@ func mountPersonalDDI(deviceIP: String = "10.7.0.1", imagePath: String, trustcac guard inet_pton(AF_INET, deviceIP, &addr.sin_addr) == 1 else { print("Invalid IP address") - return false + return 2 // EC: 2 } var pairingFile: IdevicePairingFile? let err = idevice_pairing_file_read(pairingFilePath.cString(using: .utf8), &pairingFile) if err != IdeviceSuccess { print("Failed to read pairing file: \(err)") - return false + return 3 // EC: 3 } @@ -150,7 +150,7 @@ func mountPersonalDDI(deviceIP: String = "10.7.0.1", imagePath: String, trustcac let providerError = idevice_tcp_provider_new(sockaddrPointer, pairingFile, "ImageMounterTest".cString(using: .utf8), &provider) if providerError != IdeviceSuccess { print("Failed to create TCP provider: \(providerError)") - return false + return 4 // EC: 4 } @@ -158,24 +158,24 @@ func mountPersonalDDI(deviceIP: String = "10.7.0.1", imagePath: String, trustcac let P2err = idevice_pairing_file_read(pairingFilePath.cString(using: .utf8), &pairingFile2) if P2err != IdeviceSuccess { print("Failed to read pairing file: \(err)") - return false + return 5 // EC: 5 } var lockdownClient: LockdowndClientHandle? guard lockdownd_connect_tcp(provider, &lockdownClient) == IdeviceSuccess else { print("Failed to connect to lockdownd") - return false + return 6 // EC: 6 } guard lockdownd_start_session(lockdownClient, pairingFile2) == IdeviceSuccess else { print("Failed to start session") - return false + return 7 // EC: 7 } var uniqueChipIDPlist: plist_t? guard lockdownd_get_value(lockdownClient, "UniqueChipID".cString(using: .utf8), &uniqueChipIDPlist) == IdeviceSuccess else { print("Failed to get UniqueChipID") - return false + return 8 // EC: 8 } var uniqueChipID: UInt64 = 0 @@ -187,7 +187,7 @@ func mountPersonalDDI(deviceIP: String = "10.7.0.1", imagePath: String, trustcac var mounterClient: ImageMounterHandle? guard image_mounter_connect_tcp(provider, &mounterClient) == IdeviceSuccess else { print("Failed to connect to image mounter") - return false + return 9 // EC: 9 } let result = image.withUnsafeBytes { imagePtr in @@ -214,9 +214,9 @@ func mountPersonalDDI(deviceIP: String = "10.7.0.1", imagePath: String, trustcac if result != IdeviceSuccess { print(result) print("Failed to mount personalized image") - return false + return 10 // EC: 10 } else { print("Successfully mounted personalized image!") - return true + return 0 // no EC } }