Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

Show rootless as unavailable on Apple TV, and translate the debug session

Lakr23330ed1c1d1524
diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/Localizable.xcstrings b/VPhoneExecutable/VPhoneVirtualization/Resources/Localizable.xcstrings
index 60582a84..7a6c28e6 100644
--- a/VPhoneExecutable/VPhoneVirtualization/Resources/Localizable.xcstrings
+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/Localizable.xcstrings
@@ -12,6 +12,40 @@
}
},
"Change the search or filter to browse other defaults." : {},
+ "Debug Session" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Debug Session"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "デバッグセッション"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "디버그 세션"
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Phiên gỡ lỗi"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "调试会话"
+ }
+ }
+ }
+ },
"Default Value" : {},
"Discard Changes" : {},
"Discard Edit" : {},
@@ -33,8 +67,144 @@
"Requires reinitialization; restart SoundBoard after applying this change." : {},
"Reset to Default" : {},
"Restart SoundBoard" : {},
+ "rootless (unavailable)" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "rootless (unavailable)"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "rootless(利用不可)"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "rootless (사용할 수 없음)"
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "rootless (không khả dụng)"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "rootless(不可用)"
+ }
+ }
+ }
+ },
"Search names and descriptions" : {},
+ "Session ended on signal %lld" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Session ended on signal %lld"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "セッションはシグナル %lld で終了しました"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "세션이 시그널 %lld(으)로 종료되었습니다"
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Phiên đã kết thúc do tín hiệu %lld"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "会话因信号 %lld 结束"
+ }
+ }
+ }
+ },
+ "Session exited with status %lld" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Session exited with status %lld"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "セッションはステータス %lld で終了しました"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "세션이 상태 %lld(으)로 종료되었습니다"
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Phiên đã kết thúc với trạng thái %lld"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "会话已退出,状态码 %lld"
+ }
+ }
+ }
+ },
"Stored Override" : {},
+ "Terminal" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "ターミナル"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "터미널"
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "终端"
+ }
+ }
+ }
+ },
"This value type is available for browsing only." : {},
"User Defaults" : {},
"User Defaults…" : {},
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Browsers/Shell/VPhoneShellTerminalView.swift b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Browsers/Shell/VPhoneShellTerminalView.swift
index fe07e5fb..143d9262 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Browsers/Shell/VPhoneShellTerminalView.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Browsers/Shell/VPhoneShellTerminalView.swift
@@ -108,10 +108,10 @@ final class VPhoneShellTerminalLink: @unchecked Sendable {
let code: UInt32
switch ending {
case let .exited(status):
- session.receive("\r\n[session exited with status \(status)]\r\n")
+ session.receive("\r\n[\(VPhoneLocalization.format("Session exited with status %lld", status))]\r\n")
code = UInt32(truncatingIfNeeded: status)
case let .signalled(number):
- session.receive("\r\n[session ended on signal \(number)]\r\n")
+ session.receive("\r\n[\(VPhoneLocalization.format("Session ended on signal %lld", number))]\r\n")
code = UInt32(128 + number)
case let .failed(message):
session.receive("\r\n[\(message)]\r\n")
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuBootstrap.swift b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuBootstrap.swift
index 9fce7ca8..f40c4c37 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuBootstrap.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuBootstrap.swift
@@ -129,14 +129,20 @@ extension VPhoneMenuController {
} else {
VPhoneLocalization.text("Choose the bootstrap layout. This installs the latest Irisin release once in the guest.")
}
- // Irisin serves an Apple TV only as RootHide; vphoned refuses rootless there.
+ // Irisin serves an Apple TV only as RootHide; vphoned refuses rootless
+ // there, so the button stays visible but cannot be chosen.
let offersRootless = !showsTVControls
- VPhoneAlert.present(
- title: "Install Bootstrap",
- message: message,
- style: .informational,
- buttons: offersRootless ? ["roothide", "rootless (deprecated)", "Cancel"] : ["roothide", "Cancel"],
- ) { [weak self] response in
+ let alert = NSAlert()
+ alert.messageText = VPhoneLocalization.text("Install Bootstrap")
+ alert.informativeText = message
+ alert.alertStyle = .informational
+ alert.addButton(withTitle: VPhoneLocalization.text("roothide"))
+ let rootless = alert.addButton(
+ withTitle: VPhoneLocalization.text(offersRootless ? "rootless (deprecated)" : "rootless (unavailable)"),
+ )
+ rootless.isEnabled = offersRootless
+ alert.addButton(withTitle: VPhoneLocalization.text("Cancel")).keyEquivalent = "\u{1b}"
+ VPhoneAlert.present(alert) { [weak self] response in
let layout: String
switch response {
case .alertFirstButtonReturn: layout = "roothide"