Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41c215776e | ||
|
|
3892e75556 | ||
|
|
99eba91bad | ||
|
|
dfee862746 | ||
|
|
faaef84376 | ||
|
|
94f78c9f4e |
No files matched your search
@@ -281,7 +281,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 2.0.1;
|
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.1;
|
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)
|
||||||
}
|
}
|
||||||
|
|||||||
+2353
-49
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",
|
||||||
|
|||||||
@@ -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") {
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ struct ContentView: View {
|
|||||||
.buttonStyle(TintedButton(color: .blue, fullwidth: true))
|
.buttonStyle(TintedButton(color: .blue, fullwidth: true))
|
||||||
}
|
}
|
||||||
Button(action: {
|
Button(action: {
|
||||||
|
if #available(iOS 18.0, *) {
|
||||||
guard let lang = UserDefaults.standard.stringArray(forKey: "AppleLanguages")?.first else {
|
guard let lang = UserDefaults.standard.stringArray(forKey: "AppleLanguages")?.first else {
|
||||||
hideResetHelp = false // fallback to tutorial
|
hideResetHelp = false // fallback to tutorial
|
||||||
return
|
return
|
||||||
@@ -110,6 +111,9 @@ struct ContentView: View {
|
|||||||
UIApplication.shared.alert(body: "The API failed to call correctly.\nSystem Locale Code: \(lang)")
|
UIApplication.shared.alert(body: "The API failed to call correctly.\nSystem Locale Code: \(lang)")
|
||||||
}
|
}
|
||||||
}, noCancel: false)
|
}, noCancel: false)
|
||||||
|
} else {
|
||||||
|
hideResetHelp = false
|
||||||
|
}
|
||||||
}) {
|
}) {
|
||||||
Label("Reset Collections", systemImage: "arrow.clockwise.circle")
|
Label("Reset Collections", systemImage: "arrow.clockwise.circle")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,30 +23,16 @@ struct SettingsView: View {
|
|||||||
TextField("Enter App Hash", text: $pbHash)
|
TextField("Enter App Hash", text: $pbHash)
|
||||||
.textFieldStyle(RoundedBorderTextFieldStyle())
|
.textFieldStyle(RoundedBorderTextFieldStyle())
|
||||||
.font(.system(.body, design: .monospaced))
|
.font(.system(.body, design: .monospaced))
|
||||||
.onChange(of: pbHash) { _ in
|
|
||||||
var separator: String? = nil
|
|
||||||
if pbHash.contains(" ") {
|
|
||||||
separator = " "
|
|
||||||
} else if pbHash.contains("\n") {
|
|
||||||
separator = "\n"
|
|
||||||
}
|
|
||||||
if let separator = separator {
|
|
||||||
let items = pbHash.split(separator: separator)
|
|
||||||
if let pb = items.first {
|
|
||||||
pbHash = String(pb)
|
|
||||||
}
|
|
||||||
if items.count >= 2 {
|
|
||||||
cpHash = String(items[1])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HStack {
|
HStack {
|
||||||
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()) {
|
||||||
|
// don't show the alert because it is already there
|
||||||
|
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()
|
cancelWaitForHash()
|
||||||
}, noCancel: true)
|
}, noCancel: true)
|
||||||
|
}
|
||||||
startWaitForHash()
|
startWaitForHash()
|
||||||
}) {
|
}) {
|
||||||
Text("Detect")
|
Text("Detect")
|
||||||
@@ -151,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()
|
||||||
@@ -161,16 +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 {
|
||||||
var separator = " "
|
pbHash = contents
|
||||||
if contents.contains("\n") {
|
|
||||||
separator = "\n"
|
|
||||||
}
|
}
|
||||||
let items = contents.split(separator: separator)
|
// check for carplay hash
|
||||||
if let pb = items.first {
|
let carplayPath = SymHandler.getCarPlayHashURL()
|
||||||
pbHash = String(pb)
|
if FileManager.default.fileExists(atPath: carplayPath.path()) {
|
||||||
}
|
let carplayContents = try String(contentsOf: carplayPath)
|
||||||
if items.count >= 2 {
|
try? FileManager.default.removeItem(at: carplayPath)
|
||||||
cpHash = String(items[1])
|
await MainActor.run {
|
||||||
|
cpHash = carplayContents
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
Reference in new issue
Block a user