Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature/ats-control] Add DISABLE_PLAIN_HTTP build flag #1136

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions doc/BUILD_CUSTOMIZATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Build Flags

## Description

Build Flags can be used to control the inclusion or exclusion of certain functionality or features at compile time.

## Usage in Branding

A **space-separated** list of flags can be specified in the `Branding.plist` with the key `build.flags`, f.ex.:

```xml
<key>build.flags</key>
<string>DISABLE_BACKGROUND_LOCATION</string>
```

## Flags

The following options can be used as `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

### `DISABLE_PLAIN_HTTP`

Removes the following from the app:
- the `NSAppTransportSecurity` dictionary from the app's `Info.plist`
- including the `NSAllowsArbitraryLoads` key that's needed to allow plain/unsecured HTTP connections
6 changes: 6 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,12 @@ end
sh "mv ../ownCloud/Resources/Info.plist.mod ../ownCloud/Resources/Info.plist"
end

# Special handling for app build flag DISABLE_PLAIN_HTTP (see above why this is needed)
if appBuildFlags.include? "DISABLE_PLAIN_HTTP"
sh "sed '/#ifndef DISABLE_PLAIN_HTTP/,/#endif/d' ../ownCloud/Resources/Info.plist >../ownCloud/Resources/Info.plist.mod"
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?
Expand Down
2 changes: 2 additions & 0 deletions ownCloud/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<false/>
#ifndef DISABLE_PLAIN_HTTP
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
#endif
<key>NSAppleMusicUsageDescription</key>
<string>This permission is needed for uploading media files to your server.</string>
<key>NSCameraUsageDescription</key>
Expand Down