mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 15:22:39 +00:00
Fixes #4881 - Replaced InfoPlist.cfBundleDisplayName with AppInfo.current.displayName and removed the now unused InfoPlist generated class.
This commit is contained in:
parent
0848f66cdb
commit
388d828c2b
14 changed files with 19 additions and 123 deletions
|
@ -1,93 +0,0 @@
|
|||
// swiftlint:disable all
|
||||
// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen
|
||||
|
||||
import Foundation
|
||||
|
||||
// swiftlint:disable superfluous_disable_command
|
||||
// swiftlint:disable file_length
|
||||
|
||||
// MARK: - Plist Files
|
||||
|
||||
// swiftlint:disable identifier_name line_length type_body_length
|
||||
@objcMembers
|
||||
public class InfoPlist: NSObject {
|
||||
private static let _document = PlistDocument(path: "Info.plist")
|
||||
|
||||
public static let cfBundleDevelopmentRegion: String = _document["CFBundleDevelopmentRegion"]
|
||||
public static let cfBundleDisplayName: String = _document["CFBundleDisplayName"]
|
||||
public static let cfBundleExecutable: String = _document["CFBundleExecutable"]
|
||||
public static let cfBundleIdentifier: String = _document["CFBundleIdentifier"]
|
||||
public static let cfBundleInfoDictionaryVersion: String = _document["CFBundleInfoDictionaryVersion"]
|
||||
public static let cfBundleName: String = _document["CFBundleName"]
|
||||
public static let cfBundlePackageType: String = _document["CFBundlePackageType"]
|
||||
public static let cfBundleShortVersionString: String = _document["CFBundleShortVersionString"]
|
||||
public static let cfBundleSignature: String = _document["CFBundleSignature"]
|
||||
public static let cfBundleURLTypes: [[String: Any]] = _document["CFBundleURLTypes"]
|
||||
public static let cfBundleVersion: String = _document["CFBundleVersion"]
|
||||
public static let itsAppUsesNonExemptEncryption: Bool = _document["ITSAppUsesNonExemptEncryption"]
|
||||
public static let itsEncryptionExportComplianceCode: String = _document["ITSEncryptionExportComplianceCode"]
|
||||
public static let lsApplicationQueriesSchemes: [String] = _document["LSApplicationQueriesSchemes"]
|
||||
public static let lsRequiresIPhoneOS: Bool = _document["LSRequiresIPhoneOS"]
|
||||
public static let nsAppTransportSecurity: [String: Any] = _document["NSAppTransportSecurity"]
|
||||
public static let nsCalendarsUsageDescription: String = _document["NSCalendarsUsageDescription"]
|
||||
public static let nsCameraUsageDescription: String = _document["NSCameraUsageDescription"]
|
||||
public static let nsContactsUsageDescription: String = _document["NSContactsUsageDescription"]
|
||||
public static let nsFaceIDUsageDescription: String = _document["NSFaceIDUsageDescription"]
|
||||
public static let nsMicrophoneUsageDescription: String = _document["NSMicrophoneUsageDescription"]
|
||||
public static let nsPhotoLibraryUsageDescription: String = _document["NSPhotoLibraryUsageDescription"]
|
||||
public static let nsSiriUsageDescription: String = _document["NSSiriUsageDescription"]
|
||||
public static let uiBackgroundModes: [String] = _document["UIBackgroundModes"]
|
||||
public static let uiLaunchStoryboardName: String = _document["UILaunchStoryboardName"]
|
||||
public static let uiRequiredDeviceCapabilities: [String] = _document["UIRequiredDeviceCapabilities"]
|
||||
public static let uiStatusBarHidden: Bool = _document["UIStatusBarHidden"]
|
||||
public static let uiStatusBarTintParameters: [String: Any] = _document["UIStatusBarTintParameters"]
|
||||
public static let uiSupportedInterfaceOrientations: [String] = _document["UISupportedInterfaceOrientations"]
|
||||
public static let uiSupportedInterfaceOrientationsIpad: [String] = _document["UISupportedInterfaceOrientations~ipad"]
|
||||
public static let uiViewControllerBasedStatusBarAppearance: Bool = _document["UIViewControllerBasedStatusBarAppearance"]
|
||||
public static let userDefaults: String = _document["UserDefaults"]
|
||||
public static let applicationGroupIdentifier: String = _document["applicationGroupIdentifier"]
|
||||
public static let baseBundleIdentifier: String = _document["baseBundleIdentifier"]
|
||||
public static let keychainAccessGroup: String = _document["keychainAccessGroup"]
|
||||
}
|
||||
// swiftlint:enable identifier_name line_length type_body_length
|
||||
|
||||
// MARK: - Implementation Details
|
||||
|
||||
private func arrayFromPlist<T>(at path: String) -> [T] {
|
||||
guard let url = BundleToken.bundle.url(forResource: path, withExtension: nil),
|
||||
let data = NSArray(contentsOf: url) as? [T] else {
|
||||
fatalError("Unable to load PLIST at path: \(path)")
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
private struct PlistDocument {
|
||||
let data: [String: Any]
|
||||
|
||||
init(path: String) {
|
||||
guard let url = BundleToken.bundle.url(forResource: path, withExtension: nil),
|
||||
let data = NSDictionary(contentsOf: url) as? [String: Any] else {
|
||||
fatalError("Unable to load PLIST at path: \(path)")
|
||||
}
|
||||
self.data = data
|
||||
}
|
||||
|
||||
subscript<T>(key: String) -> T {
|
||||
guard let result = data[key] as? T else {
|
||||
fatalError("Property '\(key)' is not of type \(T.self)")
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
// swiftlint:disable convenience_type
|
||||
private final class BundleToken {
|
||||
static let bundle: Bundle = {
|
||||
#if SWIFT_PACKAGE
|
||||
return Bundle.module
|
||||
#else
|
||||
return Bundle(for: BundleToken.self)
|
||||
#endif
|
||||
}()
|
||||
}
|
||||
// swiftlint:enable convenience_type
|
|
@ -12,9 +12,9 @@ import Foundation
|
|||
internal enum RiotDefaults {
|
||||
private static let _document = PlistDocument(path: "Riot-Defaults.plist")
|
||||
|
||||
internal static let createConferenceCallsWithJitsi: Bool = _document["createConferenceCallsWithJitsi"]
|
||||
internal static let enableBotCreation: Bool = _document["enableBotCreation"]
|
||||
internal static let enableRageShake: Bool = _document["enableRageShake"]
|
||||
internal static let enableRingingForGroupCalls: Bool = _document["enableRingingForGroupCalls"]
|
||||
internal static let matrixApps: Bool = _document["matrixApps"]
|
||||
internal static let maxAllowedMediaCacheSize: Int = _document["maxAllowedMediaCacheSize"]
|
||||
internal static let pinRoomsWithMissedNotif: Bool = _document["pinRoomsWithMissedNotif"]
|
||||
|
@ -34,8 +34,7 @@ internal enum RiotDefaults {
|
|||
// MARK: - Implementation Details
|
||||
|
||||
private func arrayFromPlist<T>(at path: String) -> [T] {
|
||||
let bundle = BundleToken.bundle
|
||||
guard let url = bundle.url(forResource: path, withExtension: nil),
|
||||
guard let url = BundleToken.bundle.url(forResource: path, withExtension: nil),
|
||||
let data = NSArray(contentsOf: url) as? [T] else {
|
||||
fatalError("Unable to load PLIST at path: \(path)")
|
||||
}
|
||||
|
@ -46,8 +45,7 @@ private struct PlistDocument {
|
|||
let data: [String: Any]
|
||||
|
||||
init(path: String) {
|
||||
let bundle = BundleToken.bundle
|
||||
guard let url = bundle.url(forResource: path, withExtension: nil),
|
||||
guard let url = BundleToken.bundle.url(forResource: path, withExtension: nil),
|
||||
let data = NSDictionary(contentsOf: url) as? [String: Any] else {
|
||||
fatalError("Unable to load PLIST at path: \(path)")
|
||||
}
|
||||
|
@ -65,7 +63,11 @@ private struct PlistDocument {
|
|||
// swiftlint:disable convenience_type
|
||||
private final class BundleToken {
|
||||
static let bundle: Bundle = {
|
||||
Bundle(for: BundleToken.self)
|
||||
#if SWIFT_PACKAGE
|
||||
return Bundle.module
|
||||
#else
|
||||
return Bundle(for: BundleToken.self)
|
||||
#endif
|
||||
}()
|
||||
}
|
||||
// swiftlint:enable convenience_type
|
||||
|
|
|
@ -2536,7 +2536,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
|||
{
|
||||
MXLogDebug(@"WARNING: The user has no device. Prompt for login again");
|
||||
|
||||
NSString *msg = [VectorL10n e2eEnablingOnAppUpdate:InfoPlist.cfBundleDisplayName];
|
||||
NSString *msg = [VectorL10n e2eEnablingOnAppUpdate:AppInfo.current.displayName];
|
||||
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[_errorNotification dismissViewControllerAnimated:NO completion:nil];
|
||||
|
|
|
@ -651,7 +651,7 @@
|
|||
default:
|
||||
{
|
||||
// Because the user didn't allow the app to access local contacts
|
||||
tableViewCell.textLabel.text = [VectorL10n contactsAddressBookPermissionDenied:InfoPlist.cfBundleDisplayName];
|
||||
tableViewCell.textLabel.text = [VectorL10n contactsAddressBookPermissionDenied:AppInfo.current.displayName];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,10 +70,10 @@ class VersionCheckCoordinator: Coordinator, VersionCheckBannerViewDelegate, Vers
|
|||
|
||||
if Constants.hasOSVersionBeenDropped {
|
||||
versionCheckBannerView.configureWithDetails(VersionCheckBannerViewDetails(title: VectorL10n.versionCheckBannerTitleDeprecated(String(Constants.osVersionToBeDropped)),
|
||||
subtitle: VectorL10n.versionCheckBannerSubtitleDeprecated(InfoPlist.cfBundleDisplayName, String(Constants.osVersionToBeDropped), InfoPlist.cfBundleDisplayName)))
|
||||
subtitle: VectorL10n.versionCheckBannerSubtitleDeprecated(AppInfo.current.displayName, String(Constants.osVersionToBeDropped), AppInfo.current.displayName)))
|
||||
} else {
|
||||
versionCheckBannerView.configureWithDetails(VersionCheckBannerViewDetails(title: VectorL10n.versionCheckBannerTitleSupported(String(Constants.osVersionToBeDropped)),
|
||||
subtitle: VectorL10n.versionCheckBannerSubtitleSupported(InfoPlist.cfBundleDisplayName, String(Constants.osVersionToBeDropped), InfoPlist.cfBundleDisplayName)))
|
||||
subtitle: VectorL10n.versionCheckBannerSubtitleSupported(AppInfo.current.displayName, String(Constants.osVersionToBeDropped), AppInfo.current.displayName)))
|
||||
}
|
||||
|
||||
bannerPresenter.presentBannerView(versionCheckBannerView, animated: true)
|
||||
|
@ -93,11 +93,11 @@ class VersionCheckCoordinator: Coordinator, VersionCheckBannerViewDelegate, Vers
|
|||
|
||||
if Constants.hasOSVersionBeenDropped {
|
||||
versionCheckAlertViewController.configureWithDetails(VersionCheckAlertViewControllerDetails(title: VectorL10n.versionCheckModalTitleDeprecated(String(Constants.osVersionToBeDropped)),
|
||||
subtitle: VectorL10n.versionCheckModalSubtitleDeprecated(InfoPlist.cfBundleDisplayName, InfoPlist.cfBundleDisplayName),
|
||||
subtitle: VectorL10n.versionCheckModalSubtitleDeprecated(AppInfo.current.displayName, AppInfo.current.displayName),
|
||||
actionButtonTitle: VectorL10n.versionCheckModalActionTitleDeprecated))
|
||||
} else {
|
||||
versionCheckAlertViewController.configureWithDetails(VersionCheckAlertViewControllerDetails(title: VectorL10n.versionCheckModalTitleSupported(String(Constants.osVersionToBeDropped)),
|
||||
subtitle: VectorL10n.versionCheckModalSubtitleSupported(InfoPlist.cfBundleDisplayName, InfoPlist.cfBundleDisplayName),
|
||||
subtitle: VectorL10n.versionCheckModalSubtitleSupported(AppInfo.current.displayName, AppInfo.current.displayName),
|
||||
actionButtonTitle: VectorL10n.versionCheckModalActionTitleSupported))
|
||||
}
|
||||
|
||||
|
|
|
@ -123,12 +123,12 @@ final class KeyVerificationSelfVerifyWaitViewController: UIViewController {
|
|||
|
||||
self.title = VectorL10n.deviceVerificationSelfVerifyWaitTitle
|
||||
|
||||
self.informationLabel.text = VectorL10n.deviceVerificationSelfVerifyWaitInformation(InfoPlist.cfBundleDisplayName)
|
||||
self.informationLabel.text = VectorL10n.deviceVerificationSelfVerifyWaitInformation(AppInfo.current.displayName)
|
||||
|
||||
self.desktopClientImageView.image = Asset.Images.monitor.image.withRenderingMode(.alwaysTemplate)
|
||||
self.mobileClientImageView.image = Asset.Images.smartphone.image.withRenderingMode(.alwaysTemplate)
|
||||
|
||||
self.additionalInformationLabel.text = VectorL10n.deviceVerificationSelfVerifyWaitAdditionalInformation(InfoPlist.cfBundleDisplayName)
|
||||
self.additionalInformationLabel.text = VectorL10n.deviceVerificationSelfVerifyWaitAdditionalInformation(AppInfo.current.displayName)
|
||||
|
||||
self.recoverSecretsAdditionalInformationLabel.text = VectorL10n.deviceVerificationSelfVerifyWaitRecoverSecretsAdditionalInformation
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ final class MajorUpdateViewController: UIViewController {
|
|||
self.disclosureImageView.image = Asset.Images.disclosureIcon.image
|
||||
self.newLogoImageView.image = Asset.Images.launchScreenLogo.image
|
||||
|
||||
self.titleLabel.text = VectorL10n.majorUpdateTitle(InfoPlist.cfBundleDisplayName)
|
||||
self.titleLabel.text = VectorL10n.majorUpdateTitle(AppInfo.current.displayName)
|
||||
self.informationLabel.text = VectorL10n.majorUpdateInformation
|
||||
|
||||
self.learnMoreButton.setTitle(VectorL10n.majorUpdateLearnMoreAction, for: .normal)
|
||||
|
|
|
@ -5653,7 +5653,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
|||
|
||||
// Show the explanation dialog
|
||||
alert = [UIAlertController alertControllerWithTitle:VectorL10n.rerequestKeysAlertTitle
|
||||
message:[VectorL10n e2eRoomKeyRequestMessage:InfoPlist.cfBundleDisplayName]
|
||||
message:[VectorL10n e2eRoomKeyRequestMessage:AppInfo.current.displayName]
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
currentAlert = alert;
|
||||
|
||||
|
|
|
@ -853,7 +853,7 @@ TableViewSectionsDelegate>
|
|||
|
||||
- (void)displayComingSoon
|
||||
{
|
||||
[[AppDelegate theDelegate] showAlertWithTitle:nil message:[VectorL10n securitySettingsComingSoon:InfoPlist.cfBundleDisplayName :InfoPlist.cfBundleDisplayName]];
|
||||
[[AppDelegate theDelegate] showAlertWithTitle:nil message:[VectorL10n securitySettingsComingSoon:AppInfo.current.displayName :AppInfo.current.displayName]];
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ targets:
|
|||
- path: ../Config/CommonConfiguration.swift
|
||||
- path: ../Riot/Managers/PushNotification/PushNotificationStore.swift
|
||||
- path: ../Riot/Modules/SetPinCode/PinCodePreferences.swift
|
||||
- path: ../Riot/Generated/InfoPlist.swift
|
||||
- path: ../Riot/Managers/KeyValueStorage/Extensions/Keychain.swift
|
||||
- path: ../Riot/Modules/SetPinCode/SetupBiometrics/BiometricsAuthenticationPresenter.swift
|
||||
- path: ../Riot/Categories/UNUserNotificationCenter.swift
|
||||
|
|
|
@ -41,7 +41,6 @@ targets:
|
|||
- path: ../Riot/Categories/Bundle.swift
|
||||
- path: ../Riot/Managers/Theme/
|
||||
- path: ../Riot/Utils/AvatarGenerator.m
|
||||
- path: ../Riot/Generated/InfoPlist.swift
|
||||
- path: ../Config/BuildSettings.swift
|
||||
- path: ../Riot/Categories/Character.swift
|
||||
- path: ../Riot/Categories/MXRoom+Riot.m
|
||||
|
|
|
@ -60,7 +60,6 @@ targets:
|
|||
- path: ../Config/AppConfiguration.swift
|
||||
- path: ../Config/CommonConfiguration.swift
|
||||
- path: ../Riot/Categories/Bundle.swift
|
||||
- path: ../Riot/Generated/InfoPlist.swift
|
||||
- path: ../Riot/Managers/Settings/RiotSettings.swift
|
||||
- path: ../Riot/Managers/EncryptionKeyManager/EncryptionKeyManager.swift
|
||||
- path: ../Riot/Managers/KeyValueStorage/
|
||||
|
|
|
@ -40,7 +40,6 @@ targets:
|
|||
|
||||
sources:
|
||||
- path: .
|
||||
- path: ../Riot/Generated/InfoPlist.swift
|
||||
- path: ../Riot/Categories/Bundle.swift
|
||||
- path: ../Config/CommonConfiguration.swift
|
||||
- path: ../Config/BuildSettings.swift
|
||||
|
|
|
@ -30,12 +30,3 @@ plist:
|
|||
output: RiotDefaults.swift
|
||||
params:
|
||||
enumName: RiotDefaults
|
||||
|
||||
plist:
|
||||
inputs: SupportingFiles/Info.plist
|
||||
outputs:
|
||||
templatePath: Templates/Plist/runtime-swift5.stencil
|
||||
output: InfoPlist.swift
|
||||
params:
|
||||
className: InfoPlist
|
||||
publicAccess: true
|
||||
|
|
Loading…
Reference in a new issue