Run a virtual iPhone on an Apple Silicon Mac.
Swift
Fix the four build warnings in vphoned and vphone-cli
Lakrccf8ef7e6d27
diff --git a/VPhoneDaemon/Daemon/GuestEventPublisher.swift b/VPhoneDaemon/Daemon/GuestEventPublisher.swiftindex 21af4220..ade38d73 100644--- a/VPhoneDaemon/Daemon/GuestEventPublisher.swift+++ b/VPhoneDaemon/Daemon/GuestEventPublisher.swift@@ -21,7 +21,8 @@ final class GuestEventPublisher: @unchecked Sendable {timer.setEventHandler { [weak self] in self?.publishIfChanged() }timer.resume()hub.onSubscribedChange = { [weak self] _ in- Self.queue.async { self?.updatePolling() }+ guard let self else { return }+ Self.queue.async { self.updatePolling() }}}diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/Patchers/DyldSharedCacheIOMFBForceKernPatcher.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/Patchers/DyldSharedCacheIOMFBForceKernPatcher.swiftindex 01e8f4f4..bb4c1579 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/Patchers/DyldSharedCacheIOMFBForceKernPatcher.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/Patchers/DyldSharedCacheIOMFBForceKernPatcher.swift@@ -479,7 +479,7 @@ public enum DyldSharedCacheIOMFBForceKernPatcher {for site in sites where site.disposition == .forced {let address = site.entry.publicAddresslet data = try chunks.bytesAtVMA(address, length: 16)- let instructions = try disassembler.disassemble(data, at: address, count: 4)+ let instructions = disassembler.disassemble(data, at: address, count: 4)guard isConditionalDispatch(instructions, entry: site.entry)else {let bytes = data.map { String(format: "%02x", $0) }.joined()diff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swiftindex 1bd272e3..4067c854 100644--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift@@ -2168,7 +2168,7 @@ struct VPhoneCustomFirmwareInstaller {// it stands now.let folder = "dt-\(UUID().uuidString)"_ = try work.directory.directory(folder, create: true, mode: 0o700)- defer { try? work.directory.removeItem(folder) }+ defer { _ = try? work.directory.removeItem(folder) }let staged = work.file(folder).appendingPathComponent("devicetree.img4")try (hadRepairBackup ? root.readData(backup) : currentBytes).write(to: staged)@@ -2355,7 +2355,7 @@ struct VPhoneCustomFirmwareInstaller {// A folder of its own keeps the file's name, extension included.let folder = "stage-\(UUID().uuidString)"let stage = try work.directory.directory(folder, create: true, mode: 0o700)- defer { try? work.directory.removeItem(folder) }+ defer { _ = try? work.directory.removeItem(folder) }let leaf = (relative as NSString).lastPathComponenttry root.copyFile(from: relative, to: leaf, in: stage)let staged = work.file(folder).appendingPathComponent(leaf)