From 0aed6c0e61349ff9246729da45ebc5a56698b5f6 Mon Sep 17 00:00:00 2001 From: Felix Schwarz Date: Fri, 15 Oct 2021 22:31:37 +0200 Subject: [PATCH 1/9] - add support and documentation for DISABLE_APPSTORE_LICENSING build flag --- doc/APP_BUILD_FLAGS.md | 6 ++++++ ownCloud/Client/Actions/Action+UserInterface.swift | 2 ++ ownCloud/Licensing/Offers/LicenseOfferButton.swift | 4 ++++ ownCloud/Licensing/Offers/LicenseOfferView.swift | 4 ++++ ownCloud/Licensing/Offers/LicenseOffersViewController.swift | 6 ++++++ .../LicenseInAppProductListViewController.swift | 4 ++++ .../Product List/LicenseInAppPurchaseFeatureView.swift | 4 ++++ ownCloud/Licensing/Tools/OCLicenseManager+AppStore.swift | 5 ++++- .../Transactions/LicenseTransactionsViewController.swift | 4 ++++ ownCloud/Settings/PurchasesSettingsSection.swift | 2 ++ ownCloud/Settings/SettingsViewController.swift | 2 ++ .../Providers/App Store/Items/OCLicenseAppStoreItem.h | 4 ++++ .../Providers/App Store/Items/OCLicenseAppStoreItem.m | 4 ++++ .../Providers/App Store/OCLicenseAppStoreProvider.h | 3 +++ .../Providers/App Store/OCLicenseAppStoreProvider.m | 4 ++++ .../Licensing/Providers/App Store/Parser Support/OCASN1.h | 4 ++++ .../Licensing/Providers/App Store/Parser Support/OCASN1.m | 4 ++++ .../Providers/App Store/Receipt/OCLicenseAppStoreReceipt.h | 4 ++++ .../Providers/App Store/Receipt/OCLicenseAppStoreReceipt.m | 4 ++++ .../Receipt/OCLicenseAppStoreReceiptInAppPurchase.h | 4 ++++ .../Receipt/OCLicenseAppStoreReceiptInAppPurchase.m | 4 ++++ ownCloudAppShared/Intent/OCLicenseManager+Setup.swift | 2 ++ 22 files changed, 83 insertions(+), 1 deletion(-) diff --git a/doc/APP_BUILD_FLAGS.md b/doc/APP_BUILD_FLAGS.md index a29056c94..7aa76ff4f 100644 --- a/doc/APP_BUILD_FLAGS.md +++ b/doc/APP_BUILD_FLAGS.md @@ -24,3 +24,9 @@ Removes the following from the app: - the location description keys from the app's `Info.plist` Not used by default. + +### `DISABLE_APPSTORE_LICENSING` + +Removes the following from the app: +- App Store integration for OCLicense +- App Store related view controllers and settings section diff --git a/ownCloud/Client/Actions/Action+UserInterface.swift b/ownCloud/Client/Actions/Action+UserInterface.swift index 9e3f3be29..8613c82d7 100644 --- a/ownCloud/Client/Actions/Action+UserInterface.swift +++ b/ownCloud/Client/Actions/Action+UserInterface.swift @@ -94,6 +94,7 @@ extension Action { if !isLicensed { if let core = core, let requirements = type(of:self).licenseRequirements { OnMainThread { + #if !DISABLE_APPSTORE_LICENSING OCLicenseManager.appStoreProvider?.refreshProductsIfNeeded(completionHandler: { (error) in OnMainThread { if error != nil { @@ -107,6 +108,7 @@ extension Action { } } }) + #endif } } diff --git a/ownCloud/Licensing/Offers/LicenseOfferButton.swift b/ownCloud/Licensing/Offers/LicenseOfferButton.swift index a95dd2ffb..02dc0ee5e 100644 --- a/ownCloud/Licensing/Offers/LicenseOfferButton.swift +++ b/ownCloud/Licensing/Offers/LicenseOfferButton.swift @@ -16,6 +16,8 @@ * */ +#if !DISABLE_APPSTORE_LICENSING + import UIKit import ownCloudAppShared @@ -61,3 +63,5 @@ class LicenseOfferButton: ThemeButton { fatalError("init(coder:) has not been implemented") } } + +#endif diff --git a/ownCloud/Licensing/Offers/LicenseOfferView.swift b/ownCloud/Licensing/Offers/LicenseOfferView.swift index d766d631f..b5ad9de7c 100644 --- a/ownCloud/Licensing/Offers/LicenseOfferView.swift +++ b/ownCloud/Licensing/Offers/LicenseOfferView.swift @@ -16,6 +16,8 @@ * */ +#if !DISABLE_APPSTORE_LICENSING + import UIKit import ownCloudApp import ownCloudAppShared @@ -288,3 +290,5 @@ class LicenseOfferView: UIView, Themeable { } } } + +#endif diff --git a/ownCloud/Licensing/Offers/LicenseOffersViewController.swift b/ownCloud/Licensing/Offers/LicenseOffersViewController.swift index df5449bde..d3f2c1168 100644 --- a/ownCloud/Licensing/Offers/LicenseOffersViewController.swift +++ b/ownCloud/Licensing/Offers/LicenseOffersViewController.swift @@ -16,6 +16,8 @@ * */ +#if !DISABLE_APPSTORE_LICENSING + import UIKit import ownCloudApp import ownCloudAppShared @@ -116,6 +118,7 @@ class LicenseOffersViewController: StaticTableViewController { sections.append(subSection) } + #if !DISABLE_APPSTORE_LICENSING let restoreSection = StaticTableViewSection() restoreSection.add(row: StaticTableViewRow(rowWithAction: { (_, _) in @@ -125,6 +128,7 @@ class LicenseOffersViewController: StaticTableViewController { }, title: "Restore purchases".localized, alignment: .center)) sections.append(restoreSection) + #endif // Set sections self.sections = sections @@ -153,3 +157,5 @@ class LicenseOffersViewController: StaticTableViewController { self.tableView.contentInsetAdjustmentBehavior = .never } } + +#endif diff --git a/ownCloud/Licensing/Product List/LicenseInAppProductListViewController.swift b/ownCloud/Licensing/Product List/LicenseInAppProductListViewController.swift index a2845702e..fb1d4e84c 100644 --- a/ownCloud/Licensing/Product List/LicenseInAppProductListViewController.swift +++ b/ownCloud/Licensing/Product List/LicenseInAppProductListViewController.swift @@ -16,6 +16,8 @@ * */ +#if !DISABLE_APPSTORE_LICENSING + import UIKit import ownCloudApp import ownCloudAppShared @@ -132,3 +134,5 @@ class LicenseInAppProductListViewController: StaticTableViewController { } } + +#endif diff --git a/ownCloud/Licensing/Product List/LicenseInAppPurchaseFeatureView.swift b/ownCloud/Licensing/Product List/LicenseInAppPurchaseFeatureView.swift index 37f7afd61..d1fda2fac 100644 --- a/ownCloud/Licensing/Product List/LicenseInAppPurchaseFeatureView.swift +++ b/ownCloud/Licensing/Product List/LicenseInAppPurchaseFeatureView.swift @@ -16,6 +16,8 @@ * */ +#if !DISABLE_APPSTORE_LICENSING + import UIKit import ownCloudApp import ownCloudAppShared @@ -134,3 +136,5 @@ class LicenseInAppPurchaseFeatureView: UIView, Themeable { baseViewController?.present(asCard: FrameViewController(header: offersViewController.cardHeaderView!, viewController: offersViewController), animated: true) } } + +#endif diff --git a/ownCloud/Licensing/Tools/OCLicenseManager+AppStore.swift b/ownCloud/Licensing/Tools/OCLicenseManager+AppStore.swift index 51123047c..371f2ca2c 100644 --- a/ownCloud/Licensing/Tools/OCLicenseManager+AppStore.swift +++ b/ownCloud/Licensing/Tools/OCLicenseManager+AppStore.swift @@ -16,6 +16,8 @@ * */ +#if !DISABLE_APPSTORE_LICENSING + import UIKit import ownCloudApp import ownCloudAppShared @@ -52,5 +54,6 @@ extension OCLicenseManager { }) } } - } + +#endif diff --git a/ownCloud/Licensing/Transactions/LicenseTransactionsViewController.swift b/ownCloud/Licensing/Transactions/LicenseTransactionsViewController.swift index 74facdfe5..6bc5a8ad6 100644 --- a/ownCloud/Licensing/Transactions/LicenseTransactionsViewController.swift +++ b/ownCloud/Licensing/Transactions/LicenseTransactionsViewController.swift @@ -16,6 +16,8 @@ * */ +#if !DISABLE_APPSTORE_LICENSING + import UIKit import ownCloudApp import ownCloudAppShared @@ -111,3 +113,5 @@ class LicenseTransactionsViewController: StaticTableViewController { } } } + +#endif diff --git a/ownCloud/Settings/PurchasesSettingsSection.swift b/ownCloud/Settings/PurchasesSettingsSection.swift index c3aece033..d2b6936ad 100644 --- a/ownCloud/Settings/PurchasesSettingsSection.swift +++ b/ownCloud/Settings/PurchasesSettingsSection.swift @@ -20,6 +20,7 @@ import UIKit import ownCloudApp import ownCloudAppShared +#if !DISABLE_APPSTORE_LICENSING class PurchasesSettingsSection: SettingsSection { // MARK: - More Settings Cells @@ -62,3 +63,4 @@ class PurchasesSettingsSection: SettingsSection { add(rows: rows) } } +#endif diff --git a/ownCloud/Settings/SettingsViewController.swift b/ownCloud/Settings/SettingsViewController.swift index 0089eb349..9a4ef7c8e 100644 --- a/ownCloud/Settings/SettingsViewController.swift +++ b/ownCloud/Settings/SettingsViewController.swift @@ -41,6 +41,7 @@ class SettingsViewController: StaticTableViewController { self.addSection(DisplaySettingsSection(userDefaults: userDefaults)) self.addSection(MediaFilesSettingsSection(userDefaults: userDefaults)) + #if !DISABLE_APPSTORE_LICENSING if #available(iOS 13, *), // Require iOS 13 !OCLicenseEMMProvider.isEMMVersion, // Do not show purchases in the EMM version // Do only show purchases section if there's at least one non-Enterprise account @@ -48,6 +49,7 @@ class SettingsViewController: StaticTableViewController { { self.addSection(PurchasesSettingsSection(userDefaults: userDefaults)) } + #endif self.addSection(MoreSettingsSection(userDefaults: userDefaults)) } diff --git a/ownCloudAppFramework/Licensing/Providers/App Store/Items/OCLicenseAppStoreItem.h b/ownCloudAppFramework/Licensing/Providers/App Store/Items/OCLicenseAppStoreItem.h index 06452b1be..eace46430 100644 --- a/ownCloudAppFramework/Licensing/Providers/App Store/Items/OCLicenseAppStoreItem.h +++ b/ownCloudAppFramework/Licensing/Providers/App Store/Items/OCLicenseAppStoreItem.h @@ -16,6 +16,8 @@ * */ +#ifndef DISABLE_APPSTORE_LICENSING + #import #import #import "OCLicenseOffer.h" @@ -47,3 +49,5 @@ typedef NSString* OCLicenseAppStoreProductIdentifier; @end NS_ASSUME_NONNULL_END + +#endif /* DISABLE_APPSTORE_LICENSING */ diff --git a/ownCloudAppFramework/Licensing/Providers/App Store/Items/OCLicenseAppStoreItem.m b/ownCloudAppFramework/Licensing/Providers/App Store/Items/OCLicenseAppStoreItem.m index 449f68e47..748e15693 100644 --- a/ownCloudAppFramework/Licensing/Providers/App Store/Items/OCLicenseAppStoreItem.m +++ b/ownCloudAppFramework/Licensing/Providers/App Store/Items/OCLicenseAppStoreItem.m @@ -16,6 +16,8 @@ * */ +#ifndef DISABLE_APPSTORE_LICENSING + #import "OCLicenseAppStoreItem.h" @implementation OCLicenseAppStoreItem @@ -50,3 +52,5 @@ - (instancetype)initWithType:(OCLicenseType)type identifier:(OCLicenseAppStorePr } @end + +#endif /* DISABLE_APPSTORE_LICENSING */ diff --git a/ownCloudAppFramework/Licensing/Providers/App Store/OCLicenseAppStoreProvider.h b/ownCloudAppFramework/Licensing/Providers/App Store/OCLicenseAppStoreProvider.h index 4e13f61ed..eb349e971 100644 --- a/ownCloudAppFramework/Licensing/Providers/App Store/OCLicenseAppStoreProvider.h +++ b/ownCloudAppFramework/Licensing/Providers/App Store/OCLicenseAppStoreProvider.h @@ -16,6 +16,8 @@ * */ +#ifndef DISABLE_APPSTORE_LICENSING + #import #import "OCLicenseProvider.h" @@ -70,3 +72,4 @@ extern NSErrorDomain OCLicenseAppStoreProviderErrorDomain; NS_ASSUME_NONNULL_END +#endif /* DISABLE_APPSTORE_LICENSING */ diff --git a/ownCloudAppFramework/Licensing/Providers/App Store/OCLicenseAppStoreProvider.m b/ownCloudAppFramework/Licensing/Providers/App Store/OCLicenseAppStoreProvider.m index e2eb9535a..75a7bf723 100644 --- a/ownCloudAppFramework/Licensing/Providers/App Store/OCLicenseAppStoreProvider.m +++ b/ownCloudAppFramework/Licensing/Providers/App Store/OCLicenseAppStoreProvider.m @@ -16,6 +16,8 @@ * */ +#ifndef DISABLE_APPSTORE_LICENSING + #import #import @@ -936,3 +938,5 @@ + (OCLicenseAppStoreProvider *)appStoreProvider OCLicenseProviderIdentifier OCLicenseProviderIdentifierAppStore = @"app-store"; NSErrorDomain OCLicenseAppStoreProviderErrorDomain = @"OCLicenseAppStoreProviderError"; + +#endif /* DISABLE_APPSTORE_LICENSING */ diff --git a/ownCloudAppFramework/Licensing/Providers/App Store/Parser Support/OCASN1.h b/ownCloudAppFramework/Licensing/Providers/App Store/Parser Support/OCASN1.h index 62a6333b1..2155e0827 100644 --- a/ownCloudAppFramework/Licensing/Providers/App Store/Parser Support/OCASN1.h +++ b/ownCloudAppFramework/Licensing/Providers/App Store/Parser Support/OCASN1.h @@ -16,6 +16,8 @@ * */ +#ifndef DISABLE_APPSTORE_LICENSING + #import #import "OCLicenseAppStoreReceipt.h" @@ -39,3 +41,5 @@ NS_ASSUME_NONNULL_BEGIN @end NS_ASSUME_NONNULL_END + +#endif /* DISABLE_APPSTORE_LICENSING */ diff --git a/ownCloudAppFramework/Licensing/Providers/App Store/Parser Support/OCASN1.m b/ownCloudAppFramework/Licensing/Providers/App Store/Parser Support/OCASN1.m index ec8a2c861..1c09852c4 100644 --- a/ownCloudAppFramework/Licensing/Providers/App Store/Parser Support/OCASN1.m +++ b/ownCloudAppFramework/Licensing/Providers/App Store/Parser Support/OCASN1.m @@ -16,6 +16,8 @@ * */ +#ifndef DISABLE_APPSTORE_LICENSING + #import "OCASN1.h" #import "NSDate+RFC3339.h" @@ -217,3 +219,5 @@ - (OCLicenseAppStoreReceiptParseError)parseSetsOfSequencesWithContainerProvider: } @end + +#endif /* DISABLE_APPSTORE_LICENSING */ diff --git a/ownCloudAppFramework/Licensing/Providers/App Store/Receipt/OCLicenseAppStoreReceipt.h b/ownCloudAppFramework/Licensing/Providers/App Store/Receipt/OCLicenseAppStoreReceipt.h index 4fbf33e29..01062bc4a 100644 --- a/ownCloudAppFramework/Licensing/Providers/App Store/Receipt/OCLicenseAppStoreReceipt.h +++ b/ownCloudAppFramework/Licensing/Providers/App Store/Receipt/OCLicenseAppStoreReceipt.h @@ -16,6 +16,8 @@ * */ +#ifndef DISABLE_APPSTORE_LICENSING + #import #import "OCLicenseAppStoreItem.h" @@ -105,3 +107,5 @@ typedef NSNumber* OCLicenseAppStoreLineItemID; NS_ASSUME_NONNULL_END #import "OCLicenseAppStoreReceiptInAppPurchase.h" + +#endif /* DISABLE_APPSTORE_LICENSING */ diff --git a/ownCloudAppFramework/Licensing/Providers/App Store/Receipt/OCLicenseAppStoreReceipt.m b/ownCloudAppFramework/Licensing/Providers/App Store/Receipt/OCLicenseAppStoreReceipt.m index a99eb4fbd..e9174ef2d 100644 --- a/ownCloudAppFramework/Licensing/Providers/App Store/Receipt/OCLicenseAppStoreReceipt.m +++ b/ownCloudAppFramework/Licensing/Providers/App Store/Receipt/OCLicenseAppStoreReceipt.m @@ -16,6 +16,8 @@ * */ +#ifndef DISABLE_APPSTORE_LICENSING + #import #import @@ -243,3 +245,5 @@ - (NSString *)description } @end + +#endif /* DISABLE_APPSTORE_LICENSING */ diff --git a/ownCloudAppFramework/Licensing/Providers/App Store/Receipt/OCLicenseAppStoreReceiptInAppPurchase.h b/ownCloudAppFramework/Licensing/Providers/App Store/Receipt/OCLicenseAppStoreReceiptInAppPurchase.h index 29825dbc2..f6a7ac503 100644 --- a/ownCloudAppFramework/Licensing/Providers/App Store/Receipt/OCLicenseAppStoreReceiptInAppPurchase.h +++ b/ownCloudAppFramework/Licensing/Providers/App Store/Receipt/OCLicenseAppStoreReceiptInAppPurchase.h @@ -16,6 +16,8 @@ * */ +#ifndef DISABLE_APPSTORE_LICENSING + #import #import "OCLicenseAppStoreReceipt.h" @@ -46,3 +48,5 @@ NS_ASSUME_NONNULL_BEGIN @end NS_ASSUME_NONNULL_END + +#endif /* DISABLE_APPSTORE_LICENSING */ diff --git a/ownCloudAppFramework/Licensing/Providers/App Store/Receipt/OCLicenseAppStoreReceiptInAppPurchase.m b/ownCloudAppFramework/Licensing/Providers/App Store/Receipt/OCLicenseAppStoreReceiptInAppPurchase.m index 9197809dd..2414e1360 100644 --- a/ownCloudAppFramework/Licensing/Providers/App Store/Receipt/OCLicenseAppStoreReceiptInAppPurchase.m +++ b/ownCloudAppFramework/Licensing/Providers/App Store/Receipt/OCLicenseAppStoreReceiptInAppPurchase.m @@ -16,6 +16,8 @@ * */ +#ifndef DISABLE_APPSTORE_LICENSING + #import "OCLicenseAppStoreReceiptInAppPurchase.h" #import "OCASN1.h" @@ -78,3 +80,5 @@ - (NSString *)description } @end + +#endif /* DISABLE_APPSTORE_LICENSING */ diff --git a/ownCloudAppShared/Intent/OCLicenseManager+Setup.swift b/ownCloudAppShared/Intent/OCLicenseManager+Setup.swift index d1bf29ee6..ba2960158 100644 --- a/ownCloudAppShared/Intent/OCLicenseManager+Setup.swift +++ b/ownCloudAppShared/Intent/OCLicenseManager+Setup.swift @@ -66,6 +66,7 @@ public extension OCLicenseManager { register(OCLicenseProduct(identifier: .bundlePro, name: "Pro Features".localized, description: "Unlock all Pro Features.".localized, contents: [.documentScanner, .shortcuts, .documentMarkup, .photoProFeatures])) // Set up App Store License Provider + #if !DISABLE_APPSTORE_LICENSING if let disableAppStoreLicensing = classSetting(forOCClassSettingsKey: .disableAppStoreLicensing) as? Bool, disableAppStoreLicensing == false, // only add AppStore IAP provider (and IAPs) if IAP licernsing has not been disabled via ClassSettings !OCLicenseEMMProvider.isEMMVersion { // only add AppStore IAP provider (and IAPs) if this is not the EMM version (which is supposed to already include all of them) let appStoreLicenseProvider = OCLicenseAppStoreProvider(items: [ @@ -78,6 +79,7 @@ public extension OCLicenseManager { add(appStoreLicenseProvider) } + #endif // Set up Enterprise Provider if let disableEnterpriseLicensing = classSetting(forOCClassSettingsKey: .disableEnterpriseLicensing) as? Bool, disableEnterpriseLicensing == false { // only add Enterprise provider if not disabled via ClassSettings From 64023d534a6c3557d09a099d518f41acb40769c5 Mon Sep 17 00:00:00 2001 From: Felix Schwarz Date: Sat, 6 Nov 2021 12:40:06 +0100 Subject: [PATCH 2/9] - ReleaseNotesHostViewController: remove unused reference to StoreKit - OCLicenseDuration: make sure SKProductSubscriptionPeriod conversion code is excluded when using the DISABLE_APPSTORE_LICENSING build flag --- ownCloud/Release Notes/ReleaseNotesHostViewController.swift | 1 - ownCloudAppFramework/Licensing/Offer/OCLicenseDuration.h | 5 +++++ ownCloudAppFramework/Licensing/Offer/OCLicenseDuration.m | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ownCloud/Release Notes/ReleaseNotesHostViewController.swift b/ownCloud/Release Notes/ReleaseNotesHostViewController.swift index ef74a896d..e82f00fc2 100644 --- a/ownCloud/Release Notes/ReleaseNotesHostViewController.swift +++ b/ownCloud/Release Notes/ReleaseNotesHostViewController.swift @@ -19,7 +19,6 @@ import UIKit import ownCloudSDK import ownCloudAppShared -import StoreKit class ReleaseNotesHostViewController: UIViewController { diff --git a/ownCloudAppFramework/Licensing/Offer/OCLicenseDuration.h b/ownCloudAppFramework/Licensing/Offer/OCLicenseDuration.h index a7f31b221..7f580deb3 100644 --- a/ownCloudAppFramework/Licensing/Offer/OCLicenseDuration.h +++ b/ownCloudAppFramework/Licensing/Offer/OCLicenseDuration.h @@ -17,7 +17,10 @@ */ #import + +#ifndef DISABLE_APPSTORE_LICENSING #import +#endif /* DISABLE_APPSTORE_LICENSING */ typedef NS_ENUM(NSUInteger, OCLicenseDurationUnit) { @@ -48,10 +51,12 @@ NS_ASSUME_NONNULL_BEGIN @end +#ifndef DISABLE_APPSTORE_LICENSING @interface SKProductSubscriptionPeriod (OCLicenseDuration) @property(readonly,nonatomic,nullable) OCLicenseDuration *licenseDuration; @end +#endif /* DISABLE_APPSTORE_LICENSING */ NS_ASSUME_NONNULL_END diff --git a/ownCloudAppFramework/Licensing/Offer/OCLicenseDuration.m b/ownCloudAppFramework/Licensing/Offer/OCLicenseDuration.m index a570d3b55..59668db8e 100644 --- a/ownCloudAppFramework/Licensing/Offer/OCLicenseDuration.m +++ b/ownCloudAppFramework/Licensing/Offer/OCLicenseDuration.m @@ -191,6 +191,7 @@ - (NSDate *)dateWithDurationAddedTo:(NSDate *)date @end +#ifndef DISABLE_APPSTORE_LICENSING @implementation SKProductSubscriptionPeriod (OCLicenseDuration) @@ -226,3 +227,5 @@ - (nullable OCLicenseDuration *)licenseDuration } @end + +#endif /* DISABLE_APPSTORE_LICENSING */ From 4715d552ffffc0cf90e2009e3a3ca19f6b69fcb3 Mon Sep 17 00:00:00 2001 From: Felix Schwarz Date: Wed, 10 Nov 2021 11:54:45 +0100 Subject: [PATCH 3/9] - add support for app.custom-app-scheme and app.custom-auth-scheme to Fastfile - add documentation for new custom scheme Branding.plist parameters --- doc/APP_BUILD_FLAGS.md | 32 ---------- doc/BUILD_CUSTOMIZATION.md | 76 +++++++++++++++++++++++ fastlane/Fastfile | 26 ++++++++ ownCloud/Resources/Info.plist | 4 +- ownCloud/Resources/Theming/Branding.plist | 7 ++- 5 files changed, 110 insertions(+), 35 deletions(-) delete mode 100644 doc/APP_BUILD_FLAGS.md create mode 100644 doc/BUILD_CUSTOMIZATION.md diff --git a/doc/APP_BUILD_FLAGS.md b/doc/APP_BUILD_FLAGS.md deleted file mode 100644 index 7aa76ff4f..000000000 --- a/doc/APP_BUILD_FLAGS.md +++ /dev/null @@ -1,32 +0,0 @@ -# App Build Flags - -## Description - -App Build Flags can be used to control the inclusion or exclusion of certain functionality or features. - -## Usage in Branding - -A space-separated list of flags can be specified in the `Branding.plist` with the key `app.build-flags`, f.ex.: - -```xml -app.build-flags -DISABLE_BACKGROUND_LOCATION -``` - -## Flags - -The following options can be used as `APP_BUILD_FLAGS`: - -### `DISABLE_BACKGROUND_LOCATION` - -Removes the following from the app: -- the option for location-triggered background uploads from Settings -- the location description keys from the app's `Info.plist` - -Not used by default. - -### `DISABLE_APPSTORE_LICENSING` - -Removes the following from the app: -- App Store integration for OCLicense -- App Store related view controllers and settings section diff --git a/doc/BUILD_CUSTOMIZATION.md b/doc/BUILD_CUSTOMIZATION.md new file mode 100644 index 000000000..ede3a0db6 --- /dev/null +++ b/doc/BUILD_CUSTOMIZATION.md @@ -0,0 +1,76 @@ +# App Build Flags + +## Description + +App Build Flags can be used to control the inclusion or exclusion of certain functionality or features. + +## Usage in Branding + +A space-separated list of flags can be specified in the `Branding.plist` with the key `app.build-flags`, f.ex.: + +```xml +app.build-flags +DISABLE_BACKGROUND_LOCATION +``` + +## Flags + +The following options can be used as `APP_BUILD_FLAGS`: + +### `DISABLE_BACKGROUND_LOCATION` + +Removes the following from the app: +- the option for location-triggered background uploads from Settings +- the location description keys from the app's `Info.plist` + +Not used by default. + +### `DISABLE_APPSTORE_LICENSING` + +Removes the following from the app: +- App Store integration for OCLicense +- App Store related view controllers and settings section + + +# Custom Schemes + +## Description + +The app uses two URL schemes: +- `oc` for authentication +- `owncloud` for private links + +Both schemes are part of the app's `Info.plist`, which can only be changed at build time. + +## Usage in Branding + +### Private Links + +The default `owncloud` app URL scheme in `Info.plist` can be changed by providing an alternative scheme name in the `Branding.plist` with the key `app.custom-app-scheme`, f.ex.: + +```xml +app.custom-app-scheme +myscheme +``` + +### Authentication + +The default `oc` app URL scheme in `Info.plist` can be changed by providing an alternative scheme name in the `Branding.plist` with the key `app.custom-auth-scheme`, f.ex.: + +```xml +app.custom-auth-scheme +ms +``` + +The change in the `Info.plist` is only necessary when an external browser is used for authentication via OAuth2 or OIDC. In that case, the scheme must also be changed in the regular options for OIDC and OAuth2 authentication methods: + +```xml +authentication-oauth2.oa2-redirect-uri +ms://ios.owncloud.com +authentication-oauth2.oidc-redirect-uri +ms://ios.owncloud.com +``` + +Depending on OAuth2 and OIDC implementation on the server side: +- it may be necessary to also adapt the registered redirect URI on the server +- authentication could fail if not adapted on the server diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 501fd51d1..85d7a77db 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -468,6 +468,8 @@ end appName = "ownCloud" appBuildFlags = "" + appCustomAppScheme = "" + appCustomAuthScheme = "" themeFolder = "ownCloud/Resources/Theming/" themePath = themeFolder + "Branding.plist" if !values[:APP_NAME].nil? @@ -485,6 +487,16 @@ end appBuildFlags = tmpAppBuildFlags end + tmpAppCustomAppScheme = get_info_plist_value(path: themePath, key: "app.custom-app-scheme") + if tmpAppCustomAppScheme && !tmpAppCustomAppScheme.empty? + appCustomAppScheme = tmpAppCustomAppScheme + end + + tmpAuthCustomAuthScheme = get_info_plist_value(path: themePath, key: "app.custom-auth-scheme") + if tmpAuthCustomAuthScheme && !tmpAuthCustomAuthScheme.empty? + appCustomAuthScheme = tmpAuthCustomAuthScheme + end + # Set the Git commit hash for the ios-app and ios-sdk repository into the Branding.plist commit = sh "git rev-parse --short HEAD" sdkcommit = sh "git -C ../ios-sdk/ rev-parse --short HEAD" @@ -498,6 +510,8 @@ end puts "App Name: " + appName puts "App Build Flags: " + appBuildFlags + puts "Custom App Scheme: " + appCustomAppScheme + puts "Custom Auth Scheme: " + appCustomAuthScheme # Special handling for app build flag DISABLE_BACKGROUND_LOCATION needed: # calls to set_info_plist_value before building with xcodebuild @@ -510,6 +524,18 @@ end sh "mv ../ownCloud/Resources/Info.plist.mod ../ownCloud/Resources/Info.plist" end + # update_url_schemes can't seem to reach the second URL scheme ("oc") for authentication + # so using sed and a XML property instead + if !appCustomAppScheme.empty? + sh 'sed "s#owncloud#' + appCustomAppScheme + '#" ../ownCloud/Resources/Info.plist >../ownCloud/Resources/Info.plist.mod' + sh "mv ../ownCloud/Resources/Info.plist.mod ../ownCloud/Resources/Info.plist" + end + + if !appCustomAuthScheme.empty? + sh 'sed "s#oc#' + appCustomAuthScheme + '#" ../ownCloud/Resources/Info.plist >../ownCloud/Resources/Info.plist.mod' + sh "mv ../ownCloud/Resources/Info.plist.mod ../ownCloud/Resources/Info.plist" + end + set_info_plist_value(path: "ownCloud/Resources/Info.plist", key: "CFBundleDisplayName", value: appName) set_info_plist_value(path: "ownCloud/Resources/Info.plist", key: "CFBundleName", value: appName) diff --git a/ownCloud/Resources/Info.plist b/ownCloud/Resources/Info.plist index 55fd9a37f..ea8d3ca81 100644 --- a/ownCloud/Resources/Info.plist +++ b/ownCloud/Resources/Info.plist @@ -49,7 +49,7 @@ com.owncloud.com CFBundleURLSchemes - owncloud + owncloud @@ -59,7 +59,7 @@ com.owncloud.auth CFBundleURLSchemes - oc + oc diff --git a/ownCloud/Resources/Theming/Branding.plist b/ownCloud/Resources/Theming/Branding.plist index 0c67376eb..3ecc7f34d 100644 --- a/ownCloud/Resources/Theming/Branding.plist +++ b/ownCloud/Resources/Theming/Branding.plist @@ -1,5 +1,10 @@ - + + app.custom-app-scheme + custapp + app.custom-auth-scheme + custauth + From ad3e4e140d5121eb9700dca49bd1e8230337b6ab Mon Sep 17 00:00:00 2001 From: Felix Schwarz Date: Wed, 10 Nov 2021 12:35:03 +0100 Subject: [PATCH 4/9] - remove test values from Branding.plist --- ownCloud/Resources/Theming/Branding.plist | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ownCloud/Resources/Theming/Branding.plist b/ownCloud/Resources/Theming/Branding.plist index 3ecc7f34d..0c67376eb 100644 --- a/ownCloud/Resources/Theming/Branding.plist +++ b/ownCloud/Resources/Theming/Branding.plist @@ -1,10 +1,5 @@ - - app.custom-app-scheme - custapp - app.custom-auth-scheme - custauth - + From 99b398b58b74dd0c0708cdd4960bd2afdb76e308 Mon Sep 17 00:00:00 2001 From: Felix Schwarz Date: Mon, 15 Nov 2021 21:42:48 +0100 Subject: [PATCH 5/9] - move build options from `app.` space to `build.` space and rename options accordingly - add legacy support for previously used Branding.plist build customization option names - add `BuildOptions` class to `ownCloudApp` framework to make build customization options visible in documentation --- doc/BUILD_CUSTOMIZATION.md | 18 ++--- fastlane/Fastfile | 17 +++++ ownCloud.xcodeproj/project.pbxproj | 16 +++++ ownCloudAppFramework/Building/BuildOptions.h | 28 ++++++++ ownCloudAppFramework/Building/BuildOptions.m | 71 ++++++++++++++++++++ 5 files changed, 141 insertions(+), 9 deletions(-) create mode 100644 ownCloudAppFramework/Building/BuildOptions.h create mode 100644 ownCloudAppFramework/Building/BuildOptions.m diff --git a/doc/BUILD_CUSTOMIZATION.md b/doc/BUILD_CUSTOMIZATION.md index ede3a0db6..e758f3ef7 100644 --- a/doc/BUILD_CUSTOMIZATION.md +++ b/doc/BUILD_CUSTOMIZATION.md @@ -1,21 +1,21 @@ -# App Build Flags +# Build Flags ## Description -App Build Flags can be used to control the inclusion or exclusion of certain functionality or features. +Build Flags can be used to control the inclusion or exclusion of certain functionality or features. ## Usage in Branding -A space-separated list of flags can be specified in the `Branding.plist` with the key `app.build-flags`, f.ex.: +A space-separated list of flags can be specified in the `Branding.plist` with the key `build.flags`, f.ex.: ```xml -app.build-flags +build.flags DISABLE_BACKGROUND_LOCATION ``` ## Flags -The following options can be used as `APP_BUILD_FLAGS`: +The following options can be used as `build.flags`: ### `DISABLE_BACKGROUND_LOCATION` @@ -46,19 +46,19 @@ Both schemes are part of the app's `Info.plist`, which can only be changed at bu ### Private Links -The default `owncloud` app URL scheme in `Info.plist` can be changed by providing an alternative scheme name in the `Branding.plist` with the key `app.custom-app-scheme`, f.ex.: +The default `owncloud` app URL scheme in `Info.plist` can be changed by providing an alternative scheme name in the `Branding.plist` with the key `build.custom-app-scheme`, f.ex.: ```xml -app.custom-app-scheme +build.custom-app-scheme myscheme ``` ### Authentication -The default `oc` app URL scheme in `Info.plist` can be changed by providing an alternative scheme name in the `Branding.plist` with the key `app.custom-auth-scheme`, f.ex.: +The default `oc` app URL scheme in `Info.plist` can be changed by providing an alternative scheme name in the `Branding.plist` with the key `build.custom-auth-scheme`, f.ex.: ```xml -app.custom-auth-scheme +build.custom-auth-scheme ms ``` diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 85d7a77db..ac452aae4 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -482,6 +482,23 @@ end end if File.exist?("../" + themePath) + # Extract from Branding.plist + tmpAppBuildFlags = get_info_plist_value(path: themePath, key: "build.flags") + if tmpAppBuildFlags && !tmpAppBuildFlags.empty? + appBuildFlags = tmpAppBuildFlags + end + + tmpAppCustomAppScheme = get_info_plist_value(path: themePath, key: "build.custom-app-scheme") + if tmpAppCustomAppScheme && !tmpAppCustomAppScheme.empty? + appCustomAppScheme = tmpAppCustomAppScheme + end + + tmpAuthCustomAuthScheme = get_info_plist_value(path: themePath, key: "build.custom-auth-scheme") + if tmpAuthCustomAuthScheme && !tmpAuthCustomAuthScheme.empty? + appCustomAuthScheme = tmpAuthCustomAuthScheme + end + + # Fallback (legacy key name support) tmpAppBuildFlags = get_info_plist_value(path: themePath, key: "app.build-flags") if tmpAppBuildFlags && !tmpAppBuildFlags.empty? appBuildFlags = tmpAppBuildFlags diff --git a/ownCloud.xcodeproj/project.pbxproj b/ownCloud.xcodeproj/project.pbxproj index f72c6d8cb..1d66ffbb6 100644 --- a/ownCloud.xcodeproj/project.pbxproj +++ b/ownCloud.xcodeproj/project.pbxproj @@ -415,6 +415,8 @@ DCD1300A23A191C000255779 /* LicenseOfferButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD1300923A191C000255779 /* LicenseOfferButton.swift */; }; DCD1301123A23F4E00255779 /* OCLicenseManager+AppStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD1301023A23F4E00255779 /* OCLicenseManager+AppStore.swift */; }; DCD2D40622F06ECA0071FB8F /* DataSettingsSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD2D40522F06ECA0071FB8F /* DataSettingsSection.swift */; }; + DCD71E7F27427463001592C6 /* BuildOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = DCD71E7C2742745D001592C6 /* BuildOptions.h */; }; + DCD71E8027427463001592C6 /* BuildOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = DCD71E7D2742745D001592C6 /* BuildOptions.m */; }; DCD8109A23984AF2003B0053 /* OCLicenseDuration.h in Headers */ = {isa = PBXBuildFile; fileRef = DCD810922398492C003B0053 /* OCLicenseDuration.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCD8109B23984AF6003B0053 /* OCLicenseDuration.m in Sources */ = {isa = PBXBuildFile; fileRef = DCD810932398492C003B0053 /* OCLicenseDuration.m */; }; DCD954DF247D62FA00E184E6 /* MessageTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD954DE247D62FA00E184E6 /* MessageTableViewController.swift */; }; @@ -1400,6 +1402,8 @@ DCD2D40522F06ECA0071FB8F /* DataSettingsSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataSettingsSection.swift; sourceTree = ""; }; DCD344A5205BD0C000189B9A /* openssl.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = openssl.framework; sourceTree = BUILT_PRODUCTS_DIR; }; DCD344AF205BD0FA00189B9A /* openssl.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openssl.xcodeproj; path = "ios-sdk/ownCloudUI/openssl/framework/openssl.xcodeproj"; sourceTree = ""; }; + DCD71E7C2742745D001592C6 /* BuildOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BuildOptions.h; sourceTree = ""; }; + DCD71E7D2742745D001592C6 /* BuildOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BuildOptions.m; sourceTree = ""; }; DCD810922398492C003B0053 /* OCLicenseDuration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OCLicenseDuration.h; sourceTree = ""; }; DCD810932398492C003B0053 /* OCLicenseDuration.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OCLicenseDuration.m; sourceTree = ""; }; DCD954DE247D62FA00E184E6 /* MessageTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageTableViewController.swift; sourceTree = ""; }; @@ -2678,6 +2682,7 @@ DCC0855E2293F1FD008CC05C /* ownCloudApp.h */, DC774E5A22F44E2A000B11A1 /* Display Settings */, DC6A0E4F26EA9E2B0076B533 /* AppLock Settings */, + DCD71E7827427446001592C6 /* Building */, DCB2C05C250C1ECD001083CA /* Branding */, DCF2DA6F24C82C820026D790 /* File Provider Services */, DCC5E443232654C1002E5B84 /* Foundation Extensions */, @@ -2839,6 +2844,15 @@ path = Issues; sourceTree = ""; }; + DCD71E7827427446001592C6 /* Building */ = { + isa = PBXGroup; + children = ( + DCD71E7D2742745D001592C6 /* BuildOptions.m */, + DCD71E7C2742745D001592C6 /* BuildOptions.h */, + ); + path = Building; + sourceTree = ""; + }; DCDC208923991296003CFF5B /* Transactions */ = { isa = PBXGroup; children = ( @@ -3211,6 +3225,7 @@ DC66F3A523965A1400CF4812 /* NSDate+RFC3339.h in Headers */, DC0030C22350B1CE00BB8570 /* NSData+Encoding.h in Headers */, DCCD77792604C91600098573 /* NSDate+ComputedTimes.h in Headers */, + DCD71E7F27427463001592C6 /* BuildOptions.h in Headers */, DCB458ED2604A7D4006A02AB /* OCQueryCondition+SearchSegmenter.h in Headers */, DCC5E4472326564F002E5B84 /* NSObject+AnnotatedProperties.h in Headers */, DC66F3AB23965C9C00CF4812 /* OCLicenseAppStoreReceiptInAppPurchase.h in Headers */, @@ -4328,6 +4343,7 @@ DC0030C12350B1CE00BB8570 /* NSData+Encoding.m in Sources */, DC774E5F22F44E57000B11A1 /* ZIPArchive.m in Sources */, DCDBB60B2525306000FAD707 /* NotificationAuthErrorForwarder.m in Sources */, + DCD71E8027427463001592C6 /* BuildOptions.m in Sources */, DC080CE5238AE3F40044C5D2 /* OCLicenseAppStoreProvider.m in Sources */, DC6A0E5526EA9E740076B533 /* AppLockSettings.m in Sources */, DCC0857F2293F48D008CC05C /* DisplaySettings.m in Sources */, diff --git a/ownCloudAppFramework/Building/BuildOptions.h b/ownCloudAppFramework/Building/BuildOptions.h new file mode 100644 index 000000000..afed93620 --- /dev/null +++ b/ownCloudAppFramework/Building/BuildOptions.h @@ -0,0 +1,28 @@ +// +// BuildOptions.h +// ownCloud +// +// Created by Felix Schwarz on 15.11.21. +// Copyright © 2021 ownCloud GmbH. All rights reserved. +// + +/* + * Copyright (C) 2021, ownCloud GmbH. + * + * This code is covered by the GNU Public License Version 3. + * + * For distribution utilizing Apple mechanisms please see https://owncloud.org/contribute/iOS-license-exception/ + * You should have received a copy of this license along with this program. If not, see . + * + */ + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface BuildOptions : NSObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/ownCloudAppFramework/Building/BuildOptions.m b/ownCloudAppFramework/Building/BuildOptions.m new file mode 100644 index 000000000..b72b96662 --- /dev/null +++ b/ownCloudAppFramework/Building/BuildOptions.m @@ -0,0 +1,71 @@ +// +// BuildOptions.m +// ownCloud +// +// Created by Felix Schwarz on 15.11.21. +// Copyright © 2021 ownCloud GmbH. All rights reserved. +// + +/* + * Copyright (C) 2021, ownCloud GmbH. + * + * This code is covered by the GNU Public License Version 3. + * + * For distribution utilizing Apple mechanisms please see https://owncloud.org/contribute/iOS-license-exception/ + * You should have received a copy of this license along with this program. If not, see . + * + */ + +#import "BuildOptions.h" + +OCClassSettingsIdentifier OCClassSettingsIdentifierBuildOptions = @"build"; + +OCClassSettingsKey OCClassSettingsKeyBuildFlags = @"flags"; +OCClassSettingsKey OCClassSettingsKeyCustomAppScheme = @"custom-app-scheme"; +OCClassSettingsKey OCClassSettingsKeyCustomAuthScheme = @"custom-auth-scheme"; + +@implementation BuildOptions + ++ (OCClassSettingsIdentifier)classSettingsIdentifier +{ + return (OCClassSettingsIdentifierBuildOptions); +} + ++ (NSDictionary *)defaultSettingsForIdentifier:(OCClassSettingsIdentifier)identifier +{ + return(@{ + OCClassSettingsKeyCustomAppScheme : @"owncloud", + OCClassSettingsKeyCustomAuthScheme : @"oc" + }); +} + ++ (OCClassSettingsMetadataCollection)classSettingsMetadata +{ + return (@{ + // build.flags + OCClassSettingsKeyBuildFlags : @{ + OCClassSettingsMetadataKeyType : OCClassSettingsMetadataTypeString, + OCClassSettingsMetadataKeyDescription : @"A set of space separated flags to customize the build. Must be provided in Branding.plist at build time. For documentation, please see doc/BUILD_CUSTOMIZATION.md.", + OCClassSettingsMetadataKeyStatus : OCClassSettingsKeyStatusSupported, + OCClassSettingsMetadataKeyCategory : @"Build", + }, + + // build.custom-app-scheme + OCClassSettingsKeyCustomAppScheme : @{ + OCClassSettingsMetadataKeyType : OCClassSettingsMetadataTypeString, + OCClassSettingsMetadataKeyDescription : @"Name of the URL scheme to use for private links. Must be provided in Branding.plist at build time. For documentation, please see doc/BUILD_CUSTOMIZATION.md.", + OCClassSettingsMetadataKeyStatus : OCClassSettingsKeyStatusSupported, + OCClassSettingsMetadataKeyCategory : @"Build", + }, + + // build.custom-app-scheme + OCClassSettingsKeyCustomAuthScheme : @{ + OCClassSettingsMetadataKeyType : OCClassSettingsMetadataTypeString, + OCClassSettingsMetadataKeyDescription : @"Name of the URL scheme to use for OAuth2/OIDC authentication. Must be provided in Branding.plist at build time. The authentication redirect URI parameters must also be changed accordingly in Branding.plist and on the server side. For documentation, please see doc/BUILD_CUSTOMIZATION.md.", + OCClassSettingsMetadataKeyStatus : OCClassSettingsKeyStatusSupported, + OCClassSettingsMetadataKeyCategory : @"Build", + }, + }); +} + +@end From f24e3d76e50d3523a61e4d59515271809b766824 Mon Sep 17 00:00:00 2001 From: Felix Schwarz Date: Mon, 15 Nov 2021 21:50:55 +0100 Subject: [PATCH 6/9] - ensure BuildOptions class is actually loaded/initialized --- ownCloudAppFramework/Building/BuildOptions.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ownCloudAppFramework/Building/BuildOptions.m b/ownCloudAppFramework/Building/BuildOptions.m index b72b96662..1a1b366a0 100644 --- a/ownCloudAppFramework/Building/BuildOptions.m +++ b/ownCloudAppFramework/Building/BuildOptions.m @@ -26,6 +26,12 @@ @implementation BuildOptions ++ (void)load +{ + // Make sure the class is loaded + [self classSettingsIdentifier]; +} + + (OCClassSettingsIdentifier)classSettingsIdentifier { return (OCClassSettingsIdentifierBuildOptions); From b5c2064f18c74debbe0728bb918fcc42cddf876c Mon Sep 17 00:00:00 2001 From: Felix Schwarz Date: Mon, 15 Nov 2021 22:01:07 +0100 Subject: [PATCH 7/9] - update Xcode to 12.5.1 for GitHub workflow configuration-documentation.yml --- .github/workflows/configuration-documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/configuration-documentation.yml b/.github/workflows/configuration-documentation.yml index 2699a95a2..2a819d396 100644 --- a/.github/workflows/configuration-documentation.yml +++ b/.github/workflows/configuration-documentation.yml @@ -16,7 +16,7 @@ jobs: with: submodules: true - name: Select Xcode - run: sudo xcode-select -switch /Applications/Xcode_12.4.app + run: sudo xcode-select -switch /Applications/Xcode_12.5.1.app - name: Xcode version run: /usr/bin/xcodebuild -version - name: Install Cocoapods From c34dcd105020aa9a93b30a336d32be5363590459 Mon Sep 17 00:00:00 2001 From: Felix Schwarz Date: Mon, 15 Nov 2021 22:05:59 +0100 Subject: [PATCH 8/9] - adapt code in `ImportPasteboardAction.swift` to also compile in Xcode 12.4 --- .github/workflows/configuration-documentation.yml | 2 +- .../Actions+Extensions/ImportPasteboardAction.swift | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/configuration-documentation.yml b/.github/workflows/configuration-documentation.yml index 2a819d396..2699a95a2 100644 --- a/.github/workflows/configuration-documentation.yml +++ b/.github/workflows/configuration-documentation.yml @@ -16,7 +16,7 @@ jobs: with: submodules: true - name: Select Xcode - run: sudo xcode-select -switch /Applications/Xcode_12.5.1.app + run: sudo xcode-select -switch /Applications/Xcode_12.4.app - name: Xcode version run: /usr/bin/xcodebuild -version - name: Install Cocoapods diff --git a/ownCloud/Client/Actions/Actions+Extensions/ImportPasteboardAction.swift b/ownCloud/Client/Actions/Actions+Extensions/ImportPasteboardAction.swift index 6382d7a4a..134e71177 100644 --- a/ownCloud/Client/Actions/Actions+Extensions/ImportPasteboardAction.swift +++ b/ownCloud/Client/Actions/Actions+Extensions/ImportPasteboardAction.swift @@ -55,15 +55,15 @@ class ImportPasteboardAction : Action { // MARK: - Action implementation override func run() { - var rootItem : OCItem? + var importToRootItem : OCItem? if let root = context.query?.rootItem { - rootItem = root + importToRootItem = root } else if let root = context.preferences?["rootItem"] as? OCItem { // KeyCommands send the rootItem via Preferences, because if a table view cell is selected, we need the folder root item - rootItem = root + importToRootItem = root } - guard context.items.count > 0, let core = self.core, let rootItem = rootItem else { + guard context.items.count > 0, let core = self.core, let rootItem = importToRootItem else { completed(with: NSError(ocError: .insufficientParameters)) return } From 9eefbd606e2fd511ad21b71bc19b88cd5de28e7f Mon Sep 17 00:00:00 2001 From: felix-schwarz Date: Mon, 15 Nov 2021 21:14:23 +0000 Subject: [PATCH 9/9] Configuration documentation updated --- doc/CONFIGURATION.json | 120 +++++++++++++++++++- docs/modules/ROOT/pages/ios_mdm_tables.adoc | 103 ++++++++++++++++- 2 files changed, 217 insertions(+), 6 deletions(-) diff --git a/doc/CONFIGURATION.json b/doc/CONFIGURATION.json index 8f986c203..a84949d7d 100644 --- a/doc/CONFIGURATION.json +++ b/doc/CONFIGURATION.json @@ -1,4 +1,18 @@ [ + { + "autoExpansion" : "none", + "category" : "Account", + "categoryTag" : "account", + "classIdentifier" : "account", + "className" : "ownCloud.ServerListTableViewController", + "defaultValue" : false, + "description" : "Skip \"Account\" screen / automatically open \"Files\" screen after login", + "flatIdentifier" : "account.auto-connect", + "key" : "auto-connect", + "label" : "account.auto-connect", + "status" : "supported", + "type" : "bool" + }, { "autoExpansion" : "none", "category" : "Actions", @@ -462,6 +476,10 @@ "key" : "browser-session-class", "label" : "authentication.browser-session-class", "possibleValues" : [ + { + "description" : "Replace `http` with `awb` and `https` with `awbs` to delegate browser sessions to the AirWatch browser.", + "value" : "AWBrowser" + }, { "description" : "Replace http and https with custom schemes to delegate browser sessions to a different app.", "value" : "CustomScheme" @@ -645,6 +663,19 @@ "status" : "advanced", "type" : "string" }, + { + "autoExpansion" : "none", + "category" : "Branding", + "categoryTag" : "branding", + "classIdentifier" : "branding", + "className" : "Branding", + "description" : "URL to open when selecting the \"Send feedback\" option. Allows the use of all placeholders provided in `http.user-agent`.", + "flatIdentifier" : "branding.send-feedback-url", + "key" : "send-feedback-url", + "label" : "Feedback URL", + "status" : "advanced", + "type" : "string" + }, { "autoExpansion" : "none", "category" : "Branding", @@ -677,7 +708,7 @@ "categoryTag" : "branding", "classIdentifier" : "branding", "className" : "Branding", - "defaultValue" : "https://doc.owncloud.com/ios-app/", + "defaultValue" : "https://doc.owncloud.com/ios-app/latest/", "description" : "URL to documentation for the app. Opened when selecting \"Documentation\" in the settings.", "flatIdentifier" : "branding.url-documentation", "key" : "url-documentation", @@ -727,6 +758,19 @@ "status" : "advanced", "type" : "urlString" }, + { + "autoExpansion" : "none", + "category" : "Branding", + "categoryTag" : "branding", + "classIdentifier" : "branding", + "className" : "Branding", + "description" : "Default values for user defaults. Allows overriding default settings.", + "flatIdentifier" : "branding.user-defaults-default-values", + "key" : "user-defaults-default-values", + "label" : "branding.user-defaults-default-values", + "status" : "advanced", + "type" : "dictionary" + }, { "autoExpansion" : "none", "category" : "Browser Session", @@ -753,6 +797,47 @@ "status" : "advanced", "type" : "string" }, + { + "autoExpansion" : "none", + "category" : "Build", + "categoryTag" : "build", + "classIdentifier" : "build", + "className" : "BuildOptions", + "defaultValue" : "owncloud", + "description" : "Name of the URL scheme to use for private links. Must be provided in Branding.plist at build time. For documentation, please see doc/BUILD_CUSTOMIZATION.md.", + "flatIdentifier" : "build.custom-app-scheme", + "key" : "custom-app-scheme", + "label" : "build.custom-app-scheme", + "status" : "supported", + "type" : "string" + }, + { + "autoExpansion" : "none", + "category" : "Build", + "categoryTag" : "build", + "classIdentifier" : "build", + "className" : "BuildOptions", + "defaultValue" : "oc", + "description" : "Name of the URL scheme to use for OAuth2/OIDC authentication. Must be provided in Branding.plist at build time. The authentication redirect URI parameters must also be changed accordingly in Branding.plist and on the server side. For documentation, please see doc/BUILD_CUSTOMIZATION.md.", + "flatIdentifier" : "build.custom-auth-scheme", + "key" : "custom-auth-scheme", + "label" : "build.custom-auth-scheme", + "status" : "supported", + "type" : "string" + }, + { + "autoExpansion" : "none", + "category" : "Build", + "categoryTag" : "build", + "classIdentifier" : "build", + "className" : "BuildOptions", + "description" : "A set of space separated flags to customize the build. Must be provided in Branding.plist at build time. For documentation, please see doc/BUILD_CUSTOMIZATION.md.", + "flatIdentifier" : "build.flags", + "key" : "flags", + "label" : "build.flags", + "status" : "supported", + "type" : "string" + }, { "autoExpansion" : "none", "category" : "Connection", @@ -1207,8 +1292,7 @@ "categoryTag" : "connection", "classIdentifier" : "core", "className" : "OCCore", - "defaultValue" : 10, - "description" : "Minimum number of seconds until the next scan for changes, measured from the completion of the previous scan.", + "description" : "Minimum number of milliseconds until the next scan for changes, measured from the completion of the previous scan. If no value is provided, uses the poll interval provided in the server's capabilities (in milliseconds) if it is greater or equal 5 seconds. Defaults to 10 seconds otherwise.", "flatIdentifier" : "core.scan-for-changes-interval", "key" : "scan-for-changes-interval", "label" : "core.scan-for-changes-interval", @@ -1409,6 +1493,22 @@ "status" : "debugOnly", "type" : "bool" }, + { + "autoExpansion" : "none", + "category" : "Localization", + "categoryTag" : "localization", + "classIdentifier" : "locale", + "className" : "OCLocaleFilterClassSettings", + "defaultValue" : { + + }, + "description" : "Dictionary with localization overrides where the key is the English string whose localization should be overridden, and the value is a dictionary where the keys are the language codes (f.ex. \"en\", \"de\") and the values the translations to use.", + "flatIdentifier" : "locale.overrides", + "key" : "overrides", + "label" : "Localization Overrides", + "status" : "advanced", + "type" : "dictionary" + }, { "autoExpansion" : "none", "category" : "Logging", @@ -1731,6 +1831,20 @@ "status" : "advanced", "type" : "int" }, + { + "autoExpansion" : "none", + "category" : "Passcode", + "categoryTag" : "passcode", + "classIdentifier" : "passcode", + "className" : "AppLockSettings", + "defaultValue" : false, + "description" : "Controls wether the biometrical unlock will be enabled automatically.", + "flatIdentifier" : "passcode.use-biometrical-unlock", + "key" : "use-biometrical-unlock", + "label" : "passcode.use-biometrical-unlock", + "status" : "advanced", + "type" : "bool" + }, { "autoExpansion" : "none", "category" : "Release Notes", diff --git a/docs/modules/ROOT/pages/ios_mdm_tables.adoc b/docs/modules/ROOT/pages/ios_mdm_tables.adoc index e024de363..fe6fb3575 100644 --- a/docs/modules/ROOT/pages/ios_mdm_tables.adoc +++ b/docs/modules/ROOT/pages/ios_mdm_tables.adoc @@ -1,4 +1,24 @@ +tag::account[] +[cols="1,2,3,4a,5",options=header] +|=== +|Key +|Type +|Default +|Description +|Status + + +|account.auto-connect +|bool +|`false` +|Skip "Account" screen / automatically open "Files" screen after login +|supported `candidate` + +|=== +end::account[] + + tag::actions[] [cols="1,2,3,4a,5",options=header] |=== @@ -249,6 +269,9 @@ tag::authentication[] !=== ! Value ! Description +! `AWBrowser` +! Replace `http` with `awb` and `https` with `awbs` to delegate browser sessions to the AirWatch browser. + ! `CustomScheme` ! Replace http and https with custom schemes to delegate browser sessions to a different app. @@ -382,6 +405,14 @@ branding.send-feedback-address |Email address to send feedback to. Set to `null` to disable this feature. |advanced `candidate` +|**Feedback URL** + + + +branding.send-feedback-url +|string +| +|URL to open when selecting the "Send feedback" option. Allows the use of all placeholders provided in `http.user-agent`. +|advanced `candidate` + |branding.theme-definitions |dictionaryArray | @@ -398,7 +429,7 @@ branding.send-feedback-address + branding.url-documentation |urlString -|`https://doc.owncloud.com/ios-app/` +|`https://doc.owncloud.com/ios-app/latest/` |URL to documentation for the app. Opened when selecting "Documentation" in the settings. |advanced `candidate` @@ -426,6 +457,12 @@ branding.url-terms-of-use |URL to terms of use for the app. Opened when selecting "Terms Of Use" in the settings. |advanced `candidate` +|branding.user-defaults-default-values +|dictionary +| +|Default values for user defaults. Allows overriding default settings. +|advanced `candidate` + |`Profile` + **Allow URL configuration** + + @@ -597,6 +634,38 @@ tag::browsersession[] end::browsersession[] +tag::build[] +[cols="1,2,3,4a,5",options=header] +|=== +|Key +|Type +|Default +|Description +|Status + + +|build.custom-app-scheme +|string +|`owncloud` +|Name of the URL scheme to use for private links. Must be provided in Branding.plist at build time. For documentation, please see doc/BUILD_CUSTOMIZATION.md. +|supported `candidate` + +|build.custom-auth-scheme +|string +|`oc` +|Name of the URL scheme to use for OAuth2/OIDC authentication. Must be provided in Branding.plist at build time. The authentication redirect URI parameters must also be changed accordingly in Branding.plist and on the server side. For documentation, please see doc/BUILD_CUSTOMIZATION.md. +|supported `candidate` + +|build.flags +|string +| +|A set of space separated flags to customize the build. Must be provided in Branding.plist at build time. For documentation, please see doc/BUILD_CUSTOMIZATION.md. +|supported `candidate` + +|=== +end::build[] + + tag::connection[] [cols="1,2,3,4a,5",options=header] |=== @@ -673,8 +742,8 @@ The following placeholders can be used to make it dynamic: |core.scan-for-changes-interval |int -|`10` -|Minimum number of seconds until the next scan for changes, measured from the completion of the previous scan. +| +|Minimum number of milliseconds until the next scan for changes, measured from the completion of the previous scan. If no value is provided, uses the poll interval provided in the server's capabilities (in milliseconds) if it is greater or equal 5 seconds. Defaults to 10 seconds otherwise. |advanced `candidate` |connection.allow-background-url-sessions @@ -896,6 +965,28 @@ tag::licensing[] end::licensing[] +tag::localization[] +[cols="1,2,3,4a,5",options=header] +|=== +|Key +|Type +|Default +|Description +|Status + + +|**Localization Overrides** + + + +locale.overrides +|dictionary +|`map[]` +|Dictionary with localization overrides where the key is the English string whose localization should be overridden, and the value is a dictionary where the keys are the language codes (f.ex. "en", "de") and the values the translations to use. +|advanced `candidate` + +|=== +end::localization[] + + tag::logging[] [cols="1,2,3,4a,5",options=header] |=== @@ -1173,6 +1264,12 @@ tag::passcode[] |Controls how many passcode digits are at least required for passcode lock. |advanced `candidate` +|passcode.use-biometrical-unlock +|bool +|`false` +|Controls wether the biometrical unlock will be enabled automatically. +|advanced `candidate` + |=== end::passcode[]