Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
303 changes: 303 additions & 0 deletions mond/helpers/L10n.swift

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions mond/helpers/mg.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ let all_tweaks: [mg_tweak] = [
},
w_on: { dict in
guard let cache_extra = dict["CacheExtra"] as? NSMutableDictionary else { return }
Alertinator.shared.alert(title: "Warning!", body: "Please do not use this feature to bypass region restrictions that would equate to breaking regional laws (e.g. disabling the camera shutter sound). We will NOT be held responsible for enabling any illegal activites!")
Alertinator.shared.alert(title: L10n.shared.t("Warning!"), body: L10n.shared.t("Please do not use this feature to bypass region restrictions that would equate to breaking regional laws (e.g. disabling the camera shutter sound). We will NOT be held responsible for enabling any illegal activites!"))
cache_extra[region_code_key] = "LL"
cache_extra[region_info_key] = "LL/A"
},
Expand All @@ -200,8 +200,8 @@ let all_tweaks: [mg_tweak] = [
guard let cache_extra = dict["CacheExtra"] as? NSMutableDictionary else { return }
cache_extra["A62OafQ85EJAiiqKn4agtg"] = 1
Alertinator.shared.alert(
title: "Apple Intelligence Spoof",
body: "How to use this tweak:\n1. Spoof to the model next to the first one supported by Apple Intelligence.\n2. Spoof back to your model.\n3. Spoof to your final model and you should see the Apple Intelligence icon in Settings.\n4. Connect iPhone to power and leave the Settings > Storage tab open for ~1 hour.\n\nNOTE: Do not spoof back."
title: L10n.shared.t("Apple Intelligence Spoof"),
body: L10n.shared.t("How to use this tweak:\n1. Spoof to the model next to the first one supported by Apple Intelligence.\n2. Spoof back to your model.\n3. Spoof to your final model and you should see the Apple Intelligence icon in Settings.\n4. Connect iPhone to power and leave the Settings > Storage tab open for ~1 hour.\n\nNOTE: Do not spoof back.")
)
},
w_off: { dict in
Expand Down Expand Up @@ -503,7 +503,7 @@ func mg_load() {
is_valid = false
is_empty = (try? FileManager.default.attributesOfItem(atPath: mg_url_now.path))?[.size] as? UInt64 == 0
is_loading = false
Alertinator.shared.alert(title: "Failed to load current MobileGestalt!", body: "Restart the app and try again. Check logs for more detailed information.")
Alertinator.shared.alert(title: L10n.shared.t("Failed to load current MobileGestalt!"), body: L10n.shared.t("Restart the app and try again. Check logs for more detailed information."))
}
}
}
Expand All @@ -529,12 +529,12 @@ func mg_apply() {
enable_device_name = false

print("(mg) successfully overwrote mobilegestalt!")
Alertinator.shared.alert(title: "Successfully applied Gestalt tweaks!", body: "Respring your device for changes to take effect. Note that some tweaks may require a reboot for them to apply properly.", actionLabel: "Respring", action: {
Alertinator.shared.alert(title: L10n.shared.t("Successfully applied Gestalt tweaks!"), body: L10n.shared.t("Respring your device for changes to take effect. Note that some tweaks may require a reboot for them to apply properly."), actionLabel: L10n.shared.t("Respring"), action: {
state.respring()
})
} catch {
print("(mg) failed to apply mobilegestalt: \(error)")
Alertinator.shared.alert(title: "Failed to apply MobileGestalt!", body: "Restart the app and try again. Check logs for more detailed information.")
Alertinator.shared.alert(title: L10n.shared.t("Failed to apply MobileGestalt!"), body: L10n.shared.t("Restart the app and try again. Check logs for more detailed information."))
}
}

Expand All @@ -545,10 +545,10 @@ func mg_revert() {
try mg_write(backup_data)

print("(mg) successfully reverted mobilegestalt!)")
Alertinator.shared.alert(title: "Successfully reverted Gestalt tweaks!", body: "Reboot your device for changes to take effect.")
Alertinator.shared.alert(title: L10n.shared.t("Successfully reverted Gestalt tweaks!"), body: L10n.shared.t("Reboot your device for changes to take effect."))
} catch {
print("(mg) failed to revert mobilegestalt: \(error)")
Alertinator.shared.alert(title: "Failed to revert MobileGestalt!", body: "Check logs for error information.")
Alertinator.shared.alert(title: L10n.shared.t("Failed to revert MobileGestalt!"), body: L10n.shared.t("Check logs for error information."))
}
}

Expand Down Expand Up @@ -710,9 +710,9 @@ enum mg_view_err: Error, LocalizedError {
var errorDescription: String? {
switch self {
case .missing_artwork_st:
return "Failed to get ArtworkDeviceSubType!"
return L10n.shared.t("Failed to get ArtworkDeviceSubType!")
case .missing_artwork_device_name:
return "Failed to get ArtworkDeviceProductDescription!"
return L10n.shared.t("Failed to get ArtworkDeviceProductDescription!")
}
}
}
3 changes: 2 additions & 1 deletion mond/mond.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ struct mond: App {
WindowGroup {
ContentView()
.environmentObject(state)
.environmentObject(L10n.shared)
.onOpenURL { url in
guard is_pb_archive(url) else {
print("(mond) ignoring unsupported URL: \(url.lastPathComponent)")
Expand All @@ -65,7 +66,7 @@ struct mond: App {
}
.onAppear() {
if !is_supported() {
Alertinator.shared.alert(title: "Not supported!", body: "Your iOS version may not be supported by mond.\nMond only supports iOS 27.0 developer beta 1 - 4.")
Alertinator.shared.alert(title: L10n.shared.t("Not supported!"), body: L10n.shared.t("Your iOS version may not be supported by mond.\nMond only supports iOS 27.0 developer beta 1 - 4."))
}

grant_all(state: state)
Expand Down
28 changes: 22 additions & 6 deletions mond/views/app/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import PartyUI

struct ContentView: View {
@EnvironmentObject var state: AppState
@EnvironmentObject private var l10n: L10n
@AppStorage("method") private var method: String = "bad_query"
@AppStorage("ignore_failure") private var ignore_failure = false

Expand All @@ -19,11 +20,26 @@ struct ContentView: View {
var body: some View {
NavigationStack {
List {
Section {
Picker(selection: l10n.language_binding) {
ForEach(AppLanguage.allCases) { language in
Text(language.display_name).tag(language)
}
} label: {
Label(l10n.t("Language"), systemImage: "globe")
}
.pickerStyle(.segmented)
} header: {
Label(l10n.t("Language"), systemImage: "globe")
} footer: {
Text(l10n.t("Choose the language used by the app."))
}

Section {
LogView()
.modifier(TerminalPlatter())
} header: {
Label("Logs", systemImage: "apple.terminal")
Label(l10n.t("Logs"), systemImage: "apple.terminal")
}

Section {
Expand Down Expand Up @@ -69,23 +85,23 @@ struct ContentView: View {
}
.disabled((method == "cmg" || state.apps_granted != true) && !ignore_failure)
} header: {
Label("Tweaks", systemImage: "paintbrush")
Label(l10n.t("Tweaks"), systemImage: "paintbrush")
} footer: {
if method == "cmg" {
Text("Only MobileGestalt is available when method is set to cmg.")
Text(l10n.t("Only MobileGestalt is available when method is set to cmg."))
}
}

Section {
NavigationLink {
CEView()
} label: {
Text("CacheExtra Fields")
Text(l10n.t("CacheExtra Fields"))
}
} header: {
Label("Advanced", systemImage: "wrench.and.screwdriver")
Label(l10n.t("Advanced"), systemImage: "wrench.and.screwdriver")
} footer: {
Text("Only use these Tweaks if you know what you're doing.\nYou could break something irreversibly.")
Text(l10n.t("Only use these Tweaks if you know what you're doing.\nYou could break something irreversibly."))
}
}
.navigationTitle("mond")
Expand Down
4 changes: 2 additions & 2 deletions mond/views/app/LogView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import SwiftUI
import PartyUI

struct LogView: View {
@EnvironmentObject private var l10n: L10n
@State private var log = ""

var body: some View {
Expand Down Expand Up @@ -47,11 +48,10 @@ struct LogView: View {
Button {
UIPasteboard.general.string = log
} label: {
Label("Copy Output", systemImage: "doc.on.doc")
Label(l10n.t("Copy Output"), systemImage: "doc.on.doc")
}
}
}
}
}
}

63 changes: 33 additions & 30 deletions mond/views/app/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import PartyUI
struct SettingsView: View {
@Environment(\.dismiss) private var dismiss
@EnvironmentObject var state: AppState
@EnvironmentObject private var l10n: L10n

@AppStorage("method") private var method: String = "bad_query"
@AppStorage("ka_on") private var ka_on = true
Expand Down Expand Up @@ -70,7 +71,7 @@ struct SettingsView: View {
}

Section {
Picker("Method", selection: $method) {
Picker(l10n.t("Method"), selection: $method) {
Text("bad_query").tag("bad_query")
Text("cmg").tag("cmg")
}
Expand All @@ -79,52 +80,54 @@ struct SettingsView: View {
Button {
grant_all(state: state)
} label: {
Text("Run Exploit")
Text(l10n.t("Run Exploit"))
}
} header: {
Label("Exploit", systemImage: "wrench.and.screwdriver")
} footer: {
Text(method == "cmg" ? "**CMG:** Supports iOS 27.0 b1 - b4. Only MobileGestalt will work with this method. Only use this when bad_query isnt working for you." : "**bad_query:** Supports iOS 27.0 b1 - b4. By [forcequit](https://github.com/forcequitOS).")
Text(LocalizedStringKey(l10n.t(method == "cmg"
? "**CMG:** Supports iOS 27.0 b1 - b4. Only MobileGestalt will work with this method. Only use this when bad_query isnt working for you."
: "**bad_query:** Supports iOS 27.0 b1 - b4. By [forcequit](https://github.com/forcequitOS).")))
}

Section {
TextField("Sandbox Extension Token.", text: $token)
TextField(l10n.t("Sandbox Extension Token."), text: $token)
.contextMenu {
Text("Class: \(token.split(separator: ";").first { $0.contains("com.apple") }.map(String.init) ?? "N/A")")
Text("Path: \(token.split(separator: ";").last.map(String.init) ?? "N/A")")

Button {
UIPasteboard.general.string = token
} label: {
Label("Copy Token", systemImage: "doc.on.doc")
Label(l10n.t("Copy Token"), systemImage: "doc.on.doc")
}
}
.lineLimit(1)

Button {
token = sandbox_extension_issue_file(path: TweakPaths.gestalt_dir) ?? "Failed to get token."
token = sandbox_extension_issue_file(path: TweakPaths.gestalt_dir) ?? l10n.t("Failed to get token.")
} label: {
Text("Generate Token")
Text(l10n.t("Generate Token"))
}
.disabled(!state.exploit_succeeded)
} header: {
Label("Token", systemImage: "key")
} footer: {
if !token.isEmpty && token != "Failed to get token." {
if !token.isEmpty && token != l10n.t("Failed to get token.") {
if valid {
Text("Your sandbox token is valid.")
Text(l10n.t("Your sandbox token is valid."))
} else {
Text("Your sandbox token is invalid.")
Text(l10n.t("Your sandbox token is invalid."))
}
}

if !state.exploit_succeeded {
Text("Disabled because the exploit failed. Is your iOS version supported?")
Text(l10n.t("Disabled because the exploit failed. Is your iOS version supported?"))
}
}

Section {
PlainToggle(text: "Keep Alive", infoType: .info, infoMessage: "Keeps the app running in the background after you close it, allowing it to remain active.", isOn: $ka_on)
PlainToggle(text: l10n.t("Keep Alive"), infoType: .info, infoTitle: l10n.t("Information"), infoMessage: l10n.t("Keeps the app running in the background after you close it, allowing it to remain active."), isOn: $ka_on)
.onChange(of: ka_on) { _, enabled in
if enabled {
keep_alive()
Expand All @@ -133,59 +136,59 @@ struct SettingsView: View {
}
}

PlainToggle(text: "Dismiss after importing", infoType: .info, infoMessage: "When enabled, the Tendies explorer will close automatically after importing a .tendies file into PosterBoard.", isOn: $dismiss_after_import)
PlainToggle(text: l10n.t("Dismiss after importing"), infoType: .info, infoTitle: l10n.t("Information"), infoMessage: l10n.t("When enabled, the Tendies explorer will close automatically after importing a .tendies file into PosterBoard."), isOn: $dismiss_after_import)

PlainToggle(text: "Persist after reboot", infoType: .info, infoMessage: "When enabled, MobileGestalt is written in-place on the same inode, which (hopefully) prevents iOS from regenerating the cache on reboot. Disable to use atomic file replacement instead.", isOn: $atomic_write)
PlainToggle(text: l10n.t("Persist after reboot"), infoType: .info, infoTitle: l10n.t("Information"), infoMessage: l10n.t("When enabled, MobileGestalt is written in-place on the same inode, which (hopefully) prevents iOS from regenerating the cache on reboot. Disable to use atomic file replacement instead."), isOn: $atomic_write)

PlainToggle(text: "Ignore exploit failure", infoType: .info, infoMessage: "When enabled, All Tweaks will be accessible even if the exploit failed.", isOn: $ignore_failure)
PlainToggle(text: l10n.t("Ignore exploit failure"), infoType: .info, infoTitle: l10n.t("Information"), infoMessage: l10n.t("When enabled, All Tweaks will be accessible even if the exploit failed."), isOn: $ignore_failure)
} header: {
Label("Settings", systemImage: "gear")
Label(l10n.t("Settings"), systemImage: "gear")
}

Section {
Button {
show_confirm = true
} label: {
Text("Respring")
Text(l10n.t("Respring"))
}
} header: {
Label("Tools", systemImage: "wrench.and.screwdriver")
Label(l10n.t("Tools"), systemImage: "wrench.and.screwdriver")
} footer: {
Text("Respring method by [neon](https://github.com/neonmodder123), swift implementation by [skadz](https://github.com/skadz108).")
Text(LocalizedStringKey(l10n.t("Respring method by [neon](https://github.com/neonmodder123), swift implementation by [skadz](https://github.com/skadz108).")))
}

Section {
CreditsRow(name: "roooot", role: "Main developer", profile: URL(string: "https://github.com/rooootdev")!)
CreditsRow(name: "forcequit", role: "The bad_query exploit", profile: URL(string: "https://github.com/forcequitOS")!)
CreditsRow(name: "johnny", role: "His work on the MCM bug class", profile: URL(string: "https://github.com/0xjohnnydev")!)
CreditsRow(name: "roooot", role: l10n.t("Main developer"), profile: URL(string: "https://github.com/rooootdev")!)
CreditsRow(name: "forcequit", role: l10n.t("The bad_query exploit"), profile: URL(string: "https://github.com/forcequitOS")!)
CreditsRow(name: "johnny", role: l10n.t("His work on the MCM bug class"), profile: URL(string: "https://github.com/0xjohnnydev")!)
CreditsRow(name: "jailbreak.party", role: "PartyUI, GestaltView", profile: URL(string: "https://github.com/jailbreakdotparty")!)
CreditsRow(name: "SerStars", role: "Tendies repository", profile: URL(string: "https://github.com/SerStars")!)
CreditsRow(name: "SerStars", role: l10n.t("Tendies repository"), profile: URL(string: "https://github.com/SerStars")!)
} header: {
Label("Credits", systemImage: "person.3.fill")
Label(l10n.t("Credits"), systemImage: "person.3.fill")
}
}
.navigationTitle("Settings")
.navigationTitle(l10n.t("Settings"))
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
HStack {
Button {
dismiss()
} label: {
Text("Done")
Text(l10n.t("Done"))
}
}
}
}
.alert("Are you sure?", isPresented: $show_confirm) {
Button("Cancel") {
.alert(l10n.t("Are you sure?"), isPresented: $show_confirm) {
Button(l10n.t("Cancel")) {
show_confirm = false
}

Button("Confirm") {
Button(l10n.t("Confirm")) {
state.respring()
}
} message: {
Text("Confirm that you want to respring.")
Text(l10n.t("Confirm that you want to respring."))
}
}
}
Expand Down
Loading