Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

Add bootstrap uninstall and guest reboot flow

Lakr59873ece1525
diff --git a/Research/vphoned_http_api.md b/Research/vphoned_http_api.md
index d9ab15ec..c4b895ef 100644
--- a/Research/vphoned_http_api.md
+++ b/Research/vphoned_http_api.md
@@ -63,6 +63,21 @@ The status reports `phase` and, during download, `downloaded_bytes` and
`total_bytes` when the server provides a length. The sheet shows the download
progress, then the installation result without closing.
+`GET /v1/bootstrap/inspect` (RPC `bootstrap.inspect`) reports the layout and
+path recorded by a completed vphoned installation, or `installed: false`.
+`POST /v1/bootstrap/uninstall` (RPC `bootstrap.uninstall`) requires
+`{"jbroot":"<path from inspect>","force":true}`. It accepts only the
+rootless `/var/jb` directory or a valid RootHide `.jbroot-<16 hex>` directory
+recorded by vphoned. A rootless `/var/jb` symlink is accepted only when its
+target is a physical directory under `/private/preboot`; the target and link
+are both removed. The daemon rejects a changed path and symlinked child
+directories. It unloads the bootstrap's launch daemons, unregisters apps in
+its `Applications` directory, deletes the bootstrap root and completion marker,
+then schedules a full guest reboot. If cleanup fails, the marker remains so
+the operation can be retried. Irisin's mobile Documents data outside the
+bootstrap is retained. Guest > Uninstall Bootstrap… shows the recorded path
+in a destructive confirmation alert before sending the request.
+
## HTTP and WebSocket contract
JSON resource routes cover device state, apps, input, location, Developer Mode, low power
@@ -171,7 +186,7 @@ request carries `"force": true`.
| Preferences, clipboard, location | `settings.get/set/delete`, `clipboard.get/set/clear`, `location.set/clear/current` |
| Keychain | `keychain.list {class?}`, `add`, `delete`, `get`, `update`, `database` |
| Packages (read-only) | `packages.list`, `status`, `info {path}`, `compare`, `tweaks`, `repos` |
-| Bootstrap | `bootstrap.install {layout}`, `bootstrap.status`, `bootstrap.firmware` (see above) |
+| Bootstrap | `bootstrap.install {layout}`, `bootstrap.status`, `bootstrap.inspect`, `bootstrap.uninstall {jbroot, force}`, `bootstrap.firmware` (see above) |
`processes.list` joins icli's kernel process list with `proc_pid_rusage`
footprint, resident size and CPU time (`VPhoneDaemon/Native/vphoned_process.m`),
diff --git a/VPhoneDaemon/Daemon/GuestAPI.swift b/VPhoneDaemon/Daemon/GuestAPI.swift
index 004d12e9..fbd990a7 100644
--- a/VPhoneDaemon/Daemon/GuestAPI.swift
+++ b/VPhoneDaemon/Daemon/GuestAPI.swift
@@ -63,6 +63,7 @@ enum GuestAPI {
"keychain",
"ipa_install",
"bootstrap_install",
+ "bootstrap_uninstall",
"port_forward",
"camera",
"screenshot",
@@ -220,6 +221,11 @@ enum GuestAPI {
)
case "bootstrap.status":
return GuestIrisinInstaller.status()
+ case "bootstrap.inspect":
+ return try GuestIrisinInstaller.installedBootstrap()
+ case "bootstrap.uninstall":
+ try requireForce(params, "uninstall the bootstrap")
+ return try GuestIrisinInstaller.uninstall(expectedRoot: string(params, "jbroot"))
case "bootstrap.firmware":
return try GuestIrisinInstaller.repairFirmwareRecord()
case "input.touch":
diff --git a/VPhoneDaemon/Daemon/GuestHyperTextHandler.swift b/VPhoneDaemon/Daemon/GuestHyperTextHandler.swift
index bae7bcdc..9dbc7686 100644
--- a/VPhoneDaemon/Daemon/GuestHyperTextHandler.swift
+++ b/VPhoneDaemon/Daemon/GuestHyperTextHandler.swift
@@ -176,6 +176,8 @@ final class GuestHyperTextHandler: ChannelInboundHandler, RemovableChannelHandle
case (.POST, "/v1/apps/install"): "apps.install"
case (.POST, "/v1/bootstrap/install"): "bootstrap.install"
case (.GET, "/v1/bootstrap/status"): "bootstrap.status"
+ case (.GET, "/v1/bootstrap/inspect"): "bootstrap.inspect"
+ case (.POST, "/v1/bootstrap/uninstall"): "bootstrap.uninstall"
case (.POST, "/v1/bootstrap/firmware"): "bootstrap.firmware"
case (.POST, "/v1/input/touch"): "input.touch"
case (.POST, "/v1/input/hid"): "input.hid"
diff --git a/VPhoneDaemon/Daemon/GuestIrisinInstaller.swift b/VPhoneDaemon/Daemon/GuestIrisinInstaller.swift
index 8de5f91c..54514dc4 100644
--- a/VPhoneDaemon/Daemon/GuestIrisinInstaller.swift
+++ b/VPhoneDaemon/Daemon/GuestIrisinInstaller.swift
@@ -39,6 +39,117 @@ enum GuestIrisinInstaller {
return progress
}
+ static func installedBootstrap() throws -> [String: Any] {
+ guard let installation = try completedBootstrap() else { return ["installed": false] }
+ return ["installed": true, "layout": installation.layout, "jbroot": installation.root]
+ }
+
+ static func uninstall(expectedRoot: String) throws -> [String: Any] {
+ installLock.lock()
+ defer { installLock.unlock() }
+ guard let installation = try completedBootstrap() else {
+ throw GuestAPIError.operationFailed("No completed vphoned bootstrap was found")
+ }
+ let root = installation.root
+ guard expectedRoot == root else {
+ throw GuestAPIError.invalidRequest("Bootstrap path changed; inspect it again before uninstalling")
+ }
+
+ let files = FileManager.default
+ let rootURL = URL(fileURLWithPath: root, isDirectory: true)
+ let removal = try removalRoot(root, layout: installation.layout)
+ if try directoryExistsWithoutSymlink(removal.physicalPath) {
+ for relative in ["Library/LaunchDaemons", "basebin/LaunchDaemons"] {
+ let directory = rootURL.appendingPathComponent(relative, isDirectory: true).path
+ guard try physicalChildDirectoryExists(root: root, relative: relative) else { continue }
+ let plists = try files.contentsOfDirectory(atPath: directory)
+ .filter { $0.hasSuffix(".plist") }
+ .sorted()
+ .map { directory + "/" + $0 }
+ for plist in plists {
+ var info = stat()
+ guard lstat(plist, &info) == 0, info.st_mode & mode_t(S_IFMT) == mode_t(S_IFREG) else {
+ throw GuestAPIError.operationFailed("Bootstrap service is not a regular plist: \(plist)")
+ }
+ }
+ if !plists.isEmpty { _ = try loadServices(plists, load: false, override: false) }
+ }
+
+ let apps = rootURL.appendingPathComponent("Applications", isDirectory: true).path
+ if try physicalChildDirectoryExists(root: root, relative: "Applications") {
+ _ = try unregisterAppsInDirectory(apps, force: true)
+ }
+ try files.removeItem(atPath: removal.physicalPath)
+ }
+ if removal.isSymlink { try files.removeItem(at: rootURL) }
+ try files.removeItem(at: completionMarker)
+ DispatchQueue.global().asyncAfter(deadline: .now() + 1) {
+ do {
+ _ = try requestReboot(userspace: false, force: true)
+ } catch {
+ NSLog("vphoned: bootstrap removed but reboot failed: %@", String(describing: error))
+ }
+ }
+ return ["jbroot": root, "layout": installation.layout, "deleted": true, "reboot_scheduled": true]
+ }
+
+ private static func completedBootstrap() throws -> (layout: String, root: String)? {
+ guard itemExists(completionMarker) else { return nil }
+ let data = try Data(contentsOf: completionMarker)
+ guard let marker = try JSONSerialization.jsonObject(with: data) as? [String: String],
+ let layout = marker["layout"], let root = marker["jbroot"],
+ (layout == "rootless" && root == "/var/jb") ||
+ (layout == "roothide" && root.hasPrefix("/private/var/containers/Bundle/Application/")
+ && roothideName(String(root.dropFirst("/private/var/containers/Bundle/Application/".count))))
+ else { throw GuestAPIError.operationFailed("Completed bootstrap marker has an invalid root") }
+ return (layout, root)
+ }
+
+ private static func directoryExistsWithoutSymlink(_ path: String) throws -> Bool {
+ var info = stat()
+ if lstat(path, &info) != 0 {
+ if errno == ENOENT { return false }
+ throw GuestAPIError.operationFailed("Could not inspect bootstrap directory: \(path)")
+ }
+ guard info.st_mode & mode_t(S_IFMT) == mode_t(S_IFDIR) else {
+ throw GuestAPIError.operationFailed("Bootstrap directory is not a physical directory: \(path)")
+ }
+ return true
+ }
+
+ private static func physicalChildDirectoryExists(root: String, relative: String) throws -> Bool {
+ var path = root
+ for component in relative.split(separator: "/") {
+ path += "/" + component
+ guard try directoryExistsWithoutSymlink(path) else { return false }
+ }
+ return true
+ }
+
+ private static func removalRoot(_ root: String, layout: String) throws -> (physicalPath: String, isSymlink: Bool) {
+ var info = stat()
+ guard lstat(root, &info) == 0 else {
+ if errno == ENOENT { return (root, false) }
+ throw GuestAPIError.operationFailed("Could not inspect bootstrap root: \(root)")
+ }
+ if info.st_mode & mode_t(S_IFMT) == mode_t(S_IFDIR) { return (root, false) }
+ guard layout == "rootless", info.st_mode & mode_t(S_IFMT) == mode_t(S_IFLNK) else {
+ throw GuestAPIError.operationFailed("Bootstrap root is not a directory: \(root)")
+ }
+ var target = [CChar](repeating: 0, count: Int(PATH_MAX))
+ let count = readlink(root, &target, target.count - 1)
+ guard count > 0 else { throw GuestAPIError.operationFailed("Could not read bootstrap link: \(root)") }
+ guard let physicalPath = String(
+ bytes: target.prefix(count).map { UInt8(bitPattern: $0) }, encoding: .utf8,
+ ) else { throw GuestAPIError.operationFailed("Bootstrap link has an invalid path: \(root)") }
+ guard physicalPath.hasPrefix("/private/preboot/"),
+ physicalPath != "/private/preboot/",
+ physicalPath == (physicalPath as NSString).standardizingPath else {
+ throw GuestAPIError.operationFailed("Rootless bootstrap link has an unexpected target: \(physicalPath)")
+ }
+ return (physicalPath, true)
+ }
+
private static func setProgress(_ value: [String: Any]) {
progressLock.lock()
progress = value
diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/Localizable.xcstrings b/VPhoneExecutable/VPhoneVirtualization/Resources/Localizable.xcstrings
index 04aabc36..bc5152c7 100644
--- a/VPhoneExecutable/VPhoneVirtualization/Resources/Localizable.xcstrings
+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/Localizable.xcstrings
@@ -26791,6 +26791,244 @@
}
}
},
+ "Bootstrap removal failed" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Bootstrap removal failed"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "ブートストラップの削除に失敗しました"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "부트스트랩 제거 실패"
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Gỡ bootstrap thất bại"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "引导环境卸载失败"
+ }
+ }
+ }
+ },
+ "Bootstrap removed. The guest is restarting." : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Bootstrap removed. The guest is restarting."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "ブートストラップを削除しました。ゲストを再起動しています。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "부트스트랩을 제거했습니다. 게스트를 재시동합니다."
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Đã gỡ bootstrap. Máy khách đang khởi động lại."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "引导环境已卸载,客体正在重启。"
+ }
+ }
+ }
+ },
+ "Delete and Restart" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Delete and Restart"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "削除して再起動"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "삭제하고 재시동"
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Xóa và khởi động lại"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "删除并重启"
+ }
+ }
+ }
+ },
+ "No completed bootstrap installation was found." : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "No completed bootstrap installation was found."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "完了したブートストラップのインストールが見つかりません。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "완료된 부트스트랩 설치를 찾을 수 없습니다."
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Không tìm thấy bản cài đặt bootstrap đã hoàn tất."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "未找到已完成安装的引导环境。"
+ }
+ }
+ }
+ },
+ "Permanently delete the bootstrap at %@ and restart the guest?" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Permanently delete the bootstrap at %@ and restart the guest?"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ にあるブートストラップを完全に削除してゲストを再起動しますか?"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@에 있는 부트스트랩을 영구 삭제하고 게스트를 재시동하시겠습니까?"
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Xóa vĩnh viễn bootstrap tại %@ và khởi động lại máy khách?"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "确定要永久删除位于 %@ 的引导环境并重启客体吗?"
+ }
+ }
+ }
+ },
+ "Uninstall Bootstrap" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Uninstall Bootstrap"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "ブートストラップを削除"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "부트스트랩 제거"
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Gỡ bootstrap"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "卸载引导环境"
+ }
+ }
+ }
+ },
+ "Uninstall Bootstrap…" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Uninstall Bootstrap…"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "ブートストラップを削除…"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "부트스트랩 제거…"
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Gỡ bootstrap…"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "卸载引导环境…"
+ }
+ }
+ }
+ },
"Uninstall" : {
"localizations" : {
"ja" : {
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/GuestCommunication/VPhoneGuestControl.swift b/VPhoneExecutable/VPhoneVirtualization/UI/GuestCommunication/VPhoneGuestControl.swift
index 7a9aa96c..80962384 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/GuestCommunication/VPhoneGuestControl.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/GuestCommunication/VPhoneGuestControl.swift
@@ -323,6 +323,20 @@ final class VPhoneGuestControl {
return try await call("bootstrap.status")
}
+ func installedBootstrap() async throws -> [String: Any] {
+ guard guestCapabilities.contains("bootstrap_uninstall") else {
+ throw ControlError.unsupportedCapability("bootstrap_uninstall")
+ }
+ return try await call("bootstrap.inspect")
+ }
+
+ func uninstallBootstrap(at root: String) async throws -> [String: Any] {
+ guard guestCapabilities.contains("bootstrap_uninstall") else {
+ throw ControlError.unsupportedCapability("bootstrap_uninstall")
+ }
+ return try await call("bootstrap.uninstall", params: ["jbroot": root, "force": true])
+ }
+
func clipboardGet() async throws -> ClipboardContent {
let (info, image) = try await sendRequest(["t": "clipboard_get"])
return ClipboardContent(
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuBootstrap.swift b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuBootstrap.swift
index 29d20562..7154c8be 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuBootstrap.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuBootstrap.swift
@@ -1,12 +1,16 @@
import AppKit
-// MARK: - Bootstrap Installation
+// MARK: - Bootstrap Installation and Removal
/// Installs the Irisin bootstrap in the guest from the Guest menu and shows
/// vphoned's progress while it downloads, extracts and registers it.
extension VPhoneMenuController {
func updateBootstrapAvailability(available: Bool) {
- installBootstrapItem?.isEnabled = available && !isInstallingBootstrap
+ installBootstrapItem?.isEnabled = available && !isInstallingBootstrap && !isUninstallingBootstrap
+ }
+
+ func updateBootstrapUninstallAvailability(available: Bool) {
+ uninstallBootstrapItem?.isEnabled = available && !isInstallingBootstrap && !isUninstallingBootstrap
}
@objc func installBootstrap() {
@@ -29,6 +33,7 @@ extension VPhoneMenuController {
private func performBootstrapInstallation(layout: String) {
isInstallingBootstrap = true
installBootstrapItem?.isEnabled = false
+ uninstallBootstrapItem?.isEnabled = false
let alert = NSAlert()
alert.messageText = VPhoneLocalization.text("Install Bootstrap")
alert.informativeText = VPhoneLocalization.text("Installing the latest Irisin release in the guest.")
@@ -53,6 +58,9 @@ extension VPhoneMenuController {
updateBootstrapAvailability(
available: control.isConnected && control.guestCapabilities.contains("bootstrap_install"),
)
+ updateBootstrapUninstallAvailability(
+ available: control.isConnected && control.guestCapabilities.contains("bootstrap_uninstall"),
+ )
indicator.stopAnimation(nil)
close.isEnabled = true
}
@@ -86,6 +94,75 @@ extension VPhoneMenuController {
}
}
+ @objc func uninstallBootstrap() {
+ guard !isInstallingBootstrap && !isUninstallingBootstrap else { return }
+ isUninstallingBootstrap = true
+ updateBootstrapAvailability(available: false)
+ updateBootstrapUninstallAvailability(available: false)
+ Task {
+ do {
+ let installation = try await control.installedBootstrap()
+ guard installation["installed"] as? Bool == true,
+ let root = installation["jbroot"] as? String else {
+ VPhoneAlert.present(
+ title: "Uninstall Bootstrap",
+ message: "No completed bootstrap installation was found.",
+ style: .informational,
+ )
+ finishBootstrapUninstall()
+ return
+ }
+ VPhoneAlert.present(
+ title: "Uninstall Bootstrap",
+ message: VPhoneLocalization.format(
+ "Permanently delete the bootstrap at %@ and restart the guest?", root,
+ ),
+ style: .warning,
+ buttons: ["Delete and Restart", "Cancel"],
+ ) { response in
+ guard response == .alertFirstButtonReturn else {
+ self.finishBootstrapUninstall()
+ return
+ }
+ Task {
+ do {
+ _ = try await self.control.uninstallBootstrap(at: root)
+ VPhoneAlert.present(
+ title: "Uninstall Bootstrap",
+ message: "Bootstrap removed. The guest is restarting.",
+ style: .informational,
+ )
+ } catch {
+ VPhoneAlert.present(
+ title: "Bootstrap removal failed",
+ message: String(describing: error),
+ style: .warning,
+ )
+ }
+ self.finishBootstrapUninstall()
+ }
+ }
+ } catch {
+ VPhoneAlert.present(
+ title: "Bootstrap removal failed",
+ message: String(describing: error),
+ style: .warning,
+ )
+ finishBootstrapUninstall()
+ }
+ }
+ }
+
+ private func finishBootstrapUninstall() {
+ isUninstallingBootstrap = false
+ updateBootstrapAvailability(
+ available: control.isConnected && control.guestCapabilities.contains("bootstrap_install"),
+ )
+ updateBootstrapUninstallAvailability(
+ available: control.isConnected && control.guestCapabilities.contains("bootstrap_uninstall"),
+ )
+ }
+
private func updateBootstrapProgress(
_ status: [String: Any], label: NSTextField, indicator: NSProgressIndicator
) {
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuController.swift b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuController.swift
index 64e6e398..dbb5de7a 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuController.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuController.swift
@@ -21,7 +21,9 @@ class VPhoneMenuController {
var connectPingItem: NSMenuItem?
var connectGuestHashItem: NSMenuItem?
var installBootstrapItem: NSMenuItem?
+ var uninstallBootstrapItem: NSMenuItem?
var isInstallingBootstrap = false
+ var isUninstallingBootstrap = false
var installPackageItem: NSMenuItem?
var clipboardGetItem: NSMenuItem?
var clipboardSetItem: NSMenuItem?
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuGuest.swift b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuGuest.swift
index f45ac504..2ab641d8 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuGuest.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuGuest.swift
@@ -37,6 +37,11 @@ extension VPhoneMenuController {
installBootstrapItem = installBootstrap
menu.addItem(installBootstrap)
+ let uninstallBootstrap = makeItem("Uninstall Bootstrap…", action: #selector(uninstallBootstrap))
+ uninstallBootstrap.isEnabled = false
+ uninstallBootstrapItem = uninstallBootstrap
+ menu.addItem(uninstallBootstrap)
+
menu.addItem(NSMenuItem.separator())
let clipGet = makeItem(
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneVirtualMachineAppDelegate.swift b/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneVirtualMachineAppDelegate.swift
index 988e5318..314320b8 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneVirtualMachineAppDelegate.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneVirtualMachineAppDelegate.swift
@@ -199,6 +199,7 @@ class VPhoneVirtualMachineAppDelegate: NSObject, NSApplicationDelegate {
mc?.updateConnectAvailability(available: true)
mc?.updateInstallAvailability(available: caps.contains("ipa_install"))
mc?.updateBootstrapAvailability(available: caps.contains("bootstrap_install"))
+ mc?.updateBootstrapUninstallAvailability(available: caps.contains("bootstrap_uninstall"))
mc?.updateAppsAvailability(available: caps.contains("apps"))
mc?.updateURLAvailability(available: caps.contains("url"))
mc?.updateClipboardAvailability(available: caps.contains("clipboard"))
@@ -223,6 +224,7 @@ class VPhoneVirtualMachineAppDelegate: NSObject, NSApplicationDelegate {
mc?.updateConnectAvailability(available: false)
mc?.updateInstallAvailability(available: false)
mc?.updateBootstrapAvailability(available: false)
+ mc?.updateBootstrapUninstallAvailability(available: false)
mc?.updateAppsAvailability(available: false)
mc?.updateURLAvailability(available: false)
mc?.updateClipboardAvailability(available: false)