Fix icons

This commit is contained in:
Ali 2021-10-27 17:14:20 +04:00
parent 4190ba2ba6
commit 9c25f7f131

View File

@ -638,14 +638,14 @@ final class SharedApplicationContext {
}, getAvailableAlternateIcons: { }, getAvailableAlternateIcons: {
if #available(iOS 10.3, *) { if #available(iOS 10.3, *) {
var icons = [ var icons = [
PresentationAppIcon(name: "Blue", imageName: "BlueIcon", isDefault: buildConfig.isAppStoreBuild), PresentationAppIcon(name: "BlueIcon", imageName: "BlueIcon", isDefault: buildConfig.isAppStoreBuild),
PresentationAppIcon(name: "New2", imageName: "New2"), PresentationAppIcon(name: "New2", imageName: "New2"),
PresentationAppIcon(name: "New1", imageName: "New1"), PresentationAppIcon(name: "New1", imageName: "New1"),
PresentationAppIcon(name: "Black", imageName: "BlackIcon"), PresentationAppIcon(name: "BlackIcon", imageName: "BlackIcon"),
PresentationAppIcon(name: "BlueClassic", imageName: "BlueClassicIcon"), PresentationAppIcon(name: "BlueClassicIcon", imageName: "BlueClassicIcon"),
PresentationAppIcon(name: "BlackClassic", imageName: "BlackClassicIcon"), PresentationAppIcon(name: "BlackClassicIcon", imageName: "BlackClassicIcon"),
PresentationAppIcon(name: "BlueFilled", imageName: "BlueFilledIcon"), PresentationAppIcon(name: "BlueFilledIcon", imageName: "BlueFilledIcon"),
PresentationAppIcon(name: "BlackFilled", imageName: "BlackFilledIcon") PresentationAppIcon(name: "BlackFilledIcon", imageName: "BlackFilledIcon")
] ]
if buildConfig.isInternalBuild { if buildConfig.isInternalBuild {
icons.append(PresentationAppIcon(name: "WhiteFilled", imageName: "WhiteFilledIcon")) icons.append(PresentationAppIcon(name: "WhiteFilled", imageName: "WhiteFilledIcon"))
@ -701,70 +701,6 @@ final class SharedApplicationContext {
}) })
} }
#if ENABLE_WALLET
let tonKeychain: TonKeychain
#if targetEnvironment(simulator)
tonKeychain = TonKeychain(encryptionPublicKey: {
//return .single(nil)
//return .single("1".data(using: .utf8)!)
return .single(Data())
}, encrypt: { data in
return Signal { subscriber in
subscriber.putNext(TonKeychainEncryptedData(publicKey: Data(), data: data))
subscriber.putCompletion()
return EmptyDisposable
}
}, decrypt: { data in
return Signal { subscriber in
subscriber.putNext(data.data)
subscriber.putCompletion()
return EmptyDisposable
}
})
#else
tonKeychain = TonKeychain(encryptionPublicKey: {
return Signal { subscriber in
BuildConfig.getHardwareEncryptionAvailable(withBaseAppBundleId: baseAppBundleId, completion: { value in
subscriber.putNext(value)
subscriber.putCompletion()
})
return EmptyDisposable
}
}, encrypt: { data in
return Signal { subscriber in
BuildConfig.encryptApplicationSecret(data, baseAppBundleId: baseAppBundleId, completion: { result, publicKey in
if let result = result, let publicKey = publicKey {
subscriber.putNext(TonKeychainEncryptedData(publicKey: publicKey, data: result))
subscriber.putCompletion()
} else {
subscriber.putError(.generic)
}
})
return EmptyDisposable
}
}, decrypt: { encryptedData in
return Signal { subscriber in
BuildConfig.decryptApplicationSecret(encryptedData.data, publicKey: encryptedData.publicKey, baseAppBundleId: baseAppBundleId, completion: { result, cancelled in
if let result = result {
subscriber.putNext(result)
} else {
let error: TonKeychainDecryptDataError
if cancelled {
error = .cancelled
} else {
error = .generic
}
subscriber.putError(error)
}
subscriber.putCompletion()
})
return EmptyDisposable
}
})
#endif
#endif
let sharedContextSignal = accountManagerSignal let sharedContextSignal = accountManagerSignal
|> deliverOnMainQueue |> deliverOnMainQueue
|> take(1) |> take(1)
@ -816,15 +752,6 @@ final class SharedApplicationContext {
} }
}) })
/*self.mainWindow.debugAction = {
self.mainWindow.debugAction = nil
let presentationData = sharedContext.currentPresentationData.with { $0 }
let navigationController = NavigationController(mode: .single, theme: NavigationControllerTheme(presentationTheme: presentationData.theme))
navigationController.viewControllers = [debugController(sharedContext: sharedContext, context: nil)]
self.mainWindow.present(navigationController, on: .root)
}*/
presentationDataPromise.set(sharedContext.presentationData) presentationDataPromise.set(sharedContext.presentationData)
let rawAccounts = sharedContext.activeAccountContexts let rawAccounts = sharedContext.activeAccountContexts
@ -1490,7 +1417,6 @@ final class SharedApplicationContext {
} }
public func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType) { public func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType) {
if #available(iOS 9.0, *) {
/*guard var encryptedPayload = payload.dictionaryPayload["p"] as? String else { /*guard var encryptedPayload = payload.dictionaryPayload["p"] as? String else {
return return
} }
@ -1615,7 +1541,6 @@ final class SharedApplicationContext {
} }
}) })
} }
}
public func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) { public func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) {
Logger.shared.log("App \(self.episodeId)", "invalidated token for \(type)") Logger.shared.log("App \(self.episodeId)", "invalidated token for \(type)")