Set anisette URL from plist value

This commit is contained in:
Jackson Coxson
2022-11-13 21:58:28 -07:00
committed by Joseph Mattello
parent efabe7f536
commit 07d9a9f2c3
2 changed files with 10 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ class LaunchViewController: RSTLaunchViewController
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(true)
start_em_proxy(bind_addr: Consts.Proxy.serverURL)
setAnisetteServer()
guard let pf = fetchPairingFile() else {
displayError("Device pairing file not found.")
@@ -83,6 +84,14 @@ class LaunchViewController: RSTLaunchViewController
}
}
func setAnisetteServer() {
if let anisetteUrl = Bundle.main.object(forInfoDictionaryKey: "customAnisetteURL") as? String {
UserDefaults.standard.set(anisetteUrl, forKey: "customAnisetteURL")
} else {
UserDefaults.standard.set("https://sideloadly.io/anisette/irGb3Quww8zrhgqnzmrx", forKey: "customAnisetteURL")
}
}
func displayError(_ msg: String) {
print(msg)
// Create a new alert

View File

@@ -33,6 +33,7 @@ class FetchAnisetteDataOperation: ResultOperation<ALTAnisetteData>
}
let urlString = UserDefaults.standard.string(forKey: "customAnisetteURL") ?? "https://sideloadly.io/anisette/irGb3Quww8zrhgqnzmrx"
print("Anisette URL: " + urlString)
guard let url = URL(string: urlString) else { return }
let task = URLSession.shared.dataTask(with: url) { data, response, error in