7 Commits
Author SHA1 Message Date
leminlimez 41c215776e update th and tr languages 2025-07-14 15:22:16 -04:00
leminlimez 3892e75556 update + add languages
New:
- Bulgarian
- French (LU)
- Italian
- Chinese (simplified)
2025-07-13 14:50:47 -04:00
leminlimez 99eba91bad fall back to the tutorial menu on ios 17 2025-07-13 14:43:11 -04:00
leminlimez dfee862746 change the name of the files 2025-07-12 11:49:37 -04:00
leminlimez faaef84376 handle carplay and pb hashes separately 2025-07-12 11:38:09 -04:00
leminlimez 94f78c9f4e checking for pocket poster update 2025-07-12 11:29:46 -04:00
leminlimez a6af03b98b fix pb and carplay app hash problems 2025-06-29 21:51:04 -04:00
8 changed files with 2480 additions and 74 deletions

No files matched your search

+2 -2
View File
@@ -281,7 +281,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 2.0; MARKETING_VERSION = 2.0.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.lemin.Pocket-Poster"; PRODUCT_BUNDLE_IDENTIFIER = "com.lemin.Pocket-Poster";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
@@ -313,7 +313,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 2.0; MARKETING_VERSION = 2.0.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.lemin.Pocket-Poster"; PRODUCT_BUNDLE_IDENTIFIER = "com.lemin.Pocket-Poster";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
@@ -35,6 +35,7 @@ class PosterBoardManager: ObservableObject {
guard let obj = objc_getClass("IPSettingsUtilities") as? NSObject else { return false } guard let obj = objc_getClass("IPSettingsUtilities") as? NSObject else { return false }
langManager = obj langManager = obj
} else { } else {
// TODO: Need to find the correct class for this on iOS 17
guard let obj = objc_getClass("PSLanguageSelector") as? NSObject else { return false } guard let obj = objc_getClass("PSLanguageSelector") as? NSObject else { return false }
langManager = obj langManager = obj
} }
@@ -23,6 +23,13 @@ class SymHandler {
return getDocumentsDirectory() return getDocumentsDirectory()
} }
static func getPosterBoardHashURL() -> URL {
return getLCDocumentsDirectory().appendingPathComponent("NuggetPosterBoardHash")
}
static func getCarPlayHashURL() -> URL {
return getLCDocumentsDirectory().appendingPathComponent("NuggetCarPlayWallpaperHash")
}
private static func getSymlinkURL() -> URL { private static func getSymlinkURL() -> URL {
return getLCDocumentsDirectory().appendingPathComponent(".Trash", conformingTo: .symbolicLink) return getLCDocumentsDirectory().appendingPathComponent(".Trash", conformingTo: .symbolicLink)
} }
File diff suppressed because it is too large. Load diff
@@ -23,6 +23,12 @@
"value" : "Pocket Poster" "value" : "Pocket Poster"
} }
}, },
"bg" : {
"stringUnit" : {
"state" : "translated",
"value" : "Pocket Poster"
}
},
"cs" : { "cs" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
@@ -71,12 +77,30 @@
"value" : "Pocket Poster" "value" : "Pocket Poster"
} }
}, },
"fr-CH" : {
"stringUnit" : {
"state" : "translated",
"value" : "Pocket Poster"
}
},
"fr-LU" : {
"stringUnit" : {
"state" : "translated",
"value" : "Pocket Poster"
}
},
"hu" : { "hu" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
"value" : "Pocket Poster" "value" : "Pocket Poster"
} }
}, },
"it" : {
"stringUnit" : {
"state" : "translated",
"value" : "Pocket Poster"
}
},
"ja" : { "ja" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
@@ -125,6 +149,12 @@
"value" : "Pocket Poster" "value" : "Pocket Poster"
} }
}, },
"zh-CN" : {
"stringUnit" : {
"state" : "translated",
"value" : "Pocket Poster"
}
},
"zh-Hant" : { "zh-Hant" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
@@ -153,6 +183,12 @@
"value" : "خلفيات Nugget" "value" : "خلفيات Nugget"
} }
}, },
"bg" : {
"stringUnit" : {
"state" : "translated",
"value" : "Nugget Wallpaper"
}
},
"cs" : { "cs" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
@@ -195,12 +231,30 @@
"value" : "Fond d'écran Nugget" "value" : "Fond d'écran Nugget"
} }
}, },
"fr-CH" : {
"stringUnit" : {
"state" : "translated",
"value" : "Nugget Wallpaper"
}
},
"fr-LU" : {
"stringUnit" : {
"state" : "translated",
"value" : "Nugget Wallpaper"
}
},
"hu" : { "hu" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
"value" : "Nugget Háttérkép" "value" : "Nugget Háttérkép"
} }
}, },
"it" : {
"stringUnit" : {
"state" : "translated",
"value" : "Sfondo di Nugget"
}
},
"ja" : { "ja" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
@@ -249,6 +303,12 @@
"value" : "Hình nền Nugget" "value" : "Hình nền Nugget"
} }
}, },
"zh-CN" : {
"stringUnit" : {
"state" : "translated",
"value" : "Nugget 墙纸"
}
},
"zh-Hant" : { "zh-Hant" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
+24
View File
@@ -14,6 +14,7 @@ struct Pocket_PosterApp: App {
@AppStorage("pbHash") var pbHash: String = "" @AppStorage("pbHash") var pbHash: String = ""
@State var downloadURL: String? = nil @State var downloadURL: String? = nil
@State var checkedForUpdate: Bool = false
var body: some Scene { var body: some Scene {
WindowGroup { WindowGroup {
@@ -26,6 +27,29 @@ struct Pocket_PosterApp: App {
} }
.transition(.opacity) .transition(.opacity)
.animation(.easeOut(duration: 0.5), value: finishedTutorial) .animation(.easeOut(duration: 0.5), value: finishedTutorial)
.onAppear {
// check for update
if !checkedForUpdate {
checkedForUpdate = true
if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String, let url = URL(string: "https://api.github.com/leminlimez/Pocket-Poster/releases/latest") {
let task = URLSession.shared.dataTask(with: url) {(data, response, error) in
guard let data = data else { return }
if let json = try? JSONSerialization.jsonObject(with: data, options: .mutableContainers) as? [String: Any] {
if (json["tag_name"] as? String)?.replacingOccurrences(of: "v", with: "").compare(version, options: .numeric) == .orderedDescending {
UIApplication.shared.confirmAlert(
title: NSLocalizedString("Update Available", comment: "app update available on GitHub"),
body: String(format: NSLocalizedString("Pocket Poster %@ is available, do you want to visit releases page?", comment: "app update available on GitHub"), json["tag_name"] as? String ?? "update"),
onOK: {
UIApplication.shared.open(URL(string: "https://github.com/leminlimez/Pocket-Poster/releases/latest")!)
}, noCancel: false)
}
}
}
task.resume()
}
}
}
.onOpenURL(perform: { url in .onOpenURL(perform: { url in
// Download URL // Download URL
if url.absoluteString.starts(with: "pocketposter://download") { if url.absoluteString.starts(with: "pocketposter://download") {
+14 -10
View File
@@ -99,17 +99,21 @@ struct ContentView: View {
.buttonStyle(TintedButton(color: .blue, fullwidth: true)) .buttonStyle(TintedButton(color: .blue, fullwidth: true))
} }
Button(action: { Button(action: {
guard let lang = UserDefaults.standard.stringArray(forKey: "AppleLanguages")?.first else { if #available(iOS 18.0, *) {
hideResetHelp = false // fallback to tutorial guard let lang = UserDefaults.standard.stringArray(forKey: "AppleLanguages")?.first else {
return hideResetHelp = false // fallback to tutorial
} return
UIApplication.shared.confirmAlert(title: NSLocalizedString("Reset Collections", comment: ""), body: NSLocalizedString("Do you want to reset collections?", comment: ""), onOK: {
if pbManager.setSystemLanguage(to: lang) {
UIApplication.shared.alert(title: NSLocalizedString("Collections Successfully Reset!", comment: ""), body: NSLocalizedString("Your PosterBoard will refresh automatically.", comment: ""))
} else {
UIApplication.shared.alert(body: "The API failed to call correctly.\nSystem Locale Code: \(lang)")
} }
}, noCancel: false) UIApplication.shared.confirmAlert(title: NSLocalizedString("Reset Collections", comment: ""), body: NSLocalizedString("Do you want to reset collections?", comment: ""), onOK: {
if pbManager.setSystemLanguage(to: lang) {
UIApplication.shared.alert(title: NSLocalizedString("Collections Successfully Reset!", comment: ""), body: NSLocalizedString("Your PosterBoard will refresh automatically.", comment: ""))
} else {
UIApplication.shared.alert(body: "The API failed to call correctly.\nSystem Locale Code: \(lang)")
}
}, noCancel: false)
} else {
hideResetHelp = false
}
}) { }) {
Label("Reset Collections", systemImage: "arrow.clockwise.circle") Label("Reset Collections", systemImage: "arrow.clockwise.circle")
} }
+16 -10
View File
@@ -27,9 +27,12 @@ struct SettingsView: View {
Spacer() Spacer()
// Run task to check until file exists from Nugget pc over AFC // Run task to check until file exists from Nugget pc over AFC
Button(action: { Button(action: {
UIApplication.shared.confirmAlert(title: "Waiting for app hash...", body: "Connect your device to Nugget and click the \"Pocket Poster Helper\" button.", confirmTitle: "Cancel", onOK: { if !FileManager.default.fileExists(atPath: SymHandler.getPosterBoardHashURL().path()) {
cancelWaitForHash() // don't show the alert because it is already there
}, noCancel: true) UIApplication.shared.confirmAlert(title: NSLocalizedString("Waiting for app hash...", comment: ""), body: NSLocalizedString("Connect your device to Nugget and click the \"Pocket Poster Helper\" button.", comment: ""), confirmTitle: NSLocalizedString("Cancel", comment: ""), onOK: {
cancelWaitForHash()
}, noCancel: true)
}
startWaitForHash() startWaitForHash()
}) { }) {
Text("Detect") Text("Detect")
@@ -134,7 +137,7 @@ struct SettingsView: View {
func startWaitForHash() { func startWaitForHash() {
checkingForHash = true checkingForHash = true
hashCheckTask = Task { hashCheckTask = Task {
let filePath = SymHandler.getLCDocumentsDirectory().appendingPathComponent("NuggetAppHash") let filePath = SymHandler.getPosterBoardHashURL()
while !FileManager.default.fileExists(atPath: filePath.path()) { while !FileManager.default.fileExists(atPath: filePath.path()) {
try? await Task.sleep(nanoseconds: 500_000_000) // Sleep 0.5s try? await Task.sleep(nanoseconds: 500_000_000) // Sleep 0.5s
try Task.checkCancellation() try Task.checkCancellation()
@@ -144,12 +147,15 @@ struct SettingsView: View {
let contents = try String(contentsOf: filePath) let contents = try String(contentsOf: filePath)
try? FileManager.default.removeItem(at: filePath) try? FileManager.default.removeItem(at: filePath)
await MainActor.run { await MainActor.run {
let items = contents.split(separator: "\n") pbHash = contents
if let pb = items.first { }
pbHash = String(pb) // check for carplay hash
} let carplayPath = SymHandler.getCarPlayHashURL()
if items.count >= 2 { if FileManager.default.fileExists(atPath: carplayPath.path()) {
cpHash = String(items[1]) let carplayContents = try String(contentsOf: carplayPath)
try? FileManager.default.removeItem(at: carplayPath)
await MainActor.run {
cpHash = carplayContents
} }
} }
} catch { } catch {