mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Set anisette URL from plist value
This commit is contained in:
committed by
Joseph Mattello
parent
efabe7f536
commit
07d9a9f2c3
@@ -47,6 +47,7 @@ class LaunchViewController: RSTLaunchViewController
|
|||||||
override func viewDidAppear(_ animated: Bool) {
|
override func viewDidAppear(_ animated: Bool) {
|
||||||
super.viewDidAppear(true)
|
super.viewDidAppear(true)
|
||||||
start_em_proxy(bind_addr: Consts.Proxy.serverURL)
|
start_em_proxy(bind_addr: Consts.Proxy.serverURL)
|
||||||
|
setAnisetteServer()
|
||||||
|
|
||||||
guard let pf = fetchPairingFile() else {
|
guard let pf = fetchPairingFile() else {
|
||||||
displayError("Device pairing file not found.")
|
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) {
|
func displayError(_ msg: String) {
|
||||||
print(msg)
|
print(msg)
|
||||||
// Create a new alert
|
// Create a new alert
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class FetchAnisetteDataOperation: ResultOperation<ALTAnisetteData>
|
|||||||
}
|
}
|
||||||
|
|
||||||
let urlString = UserDefaults.standard.string(forKey: "customAnisetteURL") ?? "https://sideloadly.io/anisette/irGb3Quww8zrhgqnzmrx"
|
let urlString = UserDefaults.standard.string(forKey: "customAnisetteURL") ?? "https://sideloadly.io/anisette/irGb3Quww8zrhgqnzmrx"
|
||||||
|
print("Anisette URL: " + urlString)
|
||||||
guard let url = URL(string: urlString) else { return }
|
guard let url = URL(string: urlString) else { return }
|
||||||
|
|
||||||
let task = URLSession.shared.dataTask(with: url) { data, response, error in
|
let task = URLSession.shared.dataTask(with: url) { data, response, error in
|
||||||
|
|||||||
Reference in New Issue
Block a user