Skip to content

Commit d175758

Browse files
committed
Merge old repositories into the swift-toolkit monorepo
Former-commit-id: bcf0ab9
6 parents 8b1620e + e5c4c9d + 70cc848 + 28daa50 + 2757d6a + 8770155 commit d175758

File tree

653 files changed

+88846
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

653 files changed

+88846
-0
lines changed

lcp/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pbxproj merge=union
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## Bug Report
11+
12+
<!--
13+
IMPORTANT: Your issue might be closed if we are not able to reproduce the problem. Please take the time to describe how to reproduce it and give as much details as possible. The more effort you put in, the more chance of finding a solution.
14+
-->
15+
16+
### What happened?
17+
18+
<!--
19+
A clear and concise description of what the bug is.
20+
21+
If you can, drag and drop screenshots or a screencast to show the problem, they are super helpful to avoid misunderstandings.
22+
-->
23+
24+
### Expected behavior
25+
26+
<!-- Tell us what you think should happen. -->
27+
28+
### How to reproduce?
29+
30+
<!--
31+
If you can, drag and drop the publication used to reproduce the problem, after zipping it.
32+
33+
Then, explain the steps to reproduce the problem from the Test App (https://github.com/readium/r2-testapp-swift). For example:
34+
35+
1. Open book X
36+
2. Go to chapter Y
37+
3. Click on link Z
38+
4. See error
39+
-->
40+
41+
### Environment
42+
43+
<!-- Fill in the following information -->
44+
45+
#### Readium versions
46+
47+
<!-- Remove unused modules -->
48+
49+
* `r2-shared-swift`:
50+
* `r2-streamer-swift`:
51+
* `r2-navigator-swift`:
52+
* `r2-opds-swift`:
53+
* `r2-lcp-swift`:
54+
55+
#### Development environment
56+
57+
<!--
58+
Paste the output of these commands:
59+
60+
echo "macOS: `sw_vers -productVersion`"
61+
echo "platform: `uname -m`"
62+
echo "carthage: `carthage version`"
63+
xcodebuild -version
64+
65+
-->
66+
67+
#### Testing device
68+
69+
* iOS version:
70+
* Model (e.g. iPhone 11 Pro Max):
71+
* Is it an emulator? Yes or No
72+
73+
### Additional context
74+
75+
* Are you willing to fix the problem and contribute a pull request? Yes or No <!-- Help can be provided to guide you through the project -->
76+
77+
<!--
78+
Share additional code showing how you use Readium, if relevant.
79+
80+
Output logs are useful as well.
81+
82+
If you already went through the codebase to find the bug, you can explain your findings here.
83+
-->

lcp/.github/workflows/build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ develop, master ]
6+
pull_request:
7+
branches: [ develop, master ]
8+
9+
jobs:
10+
build:
11+
name: Build and test
12+
runs-on: macos-latest
13+
env:
14+
scheme: ${{ 'r2-lcp-swift' }}
15+
platform: ${{ 'iOS Simulator' }}
16+
device: ${{ 'iPhone 13' }}
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
- name: Install dependencies
22+
run: brew install xcodegen
23+
- name: Check Carthage project
24+
run: |
25+
# Check that the Carthage project is up to date.
26+
make carthage
27+
git diff --exit-code --name-only r2-lcp-swift.xcodeproj
28+
- name: Prepare build
29+
run: |
30+
# r2-lcp-swift.xcodeproj is only relevant for Carthage. We remove it otherwise xcodebuild will use it.
31+
rm -rf r2-lcp-swift.xcodeproj
32+
- name: Build
33+
run: |
34+
xcodebuild build-for-testing -scheme "$scheme" -destination "platform=$platform,name=$device"
35+
# Tests require R2LCPClient.framework which is private.
36+
# - name: Test
37+
# run: |
38+
# xcodebuild test-without-building -scheme "$scheme" -destination "platform=$platform,name=$device"
39+
- name: Analyze
40+
run: |
41+
xcodebuild analyze -scheme "$scheme" -destination "platform=$platform,name=$device"

lcp/.gitignore

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Xcode
2+
#
3+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4+
5+
## Build generated
6+
build/
7+
DerivedData/
8+
.build/
9+
10+
## Various settings
11+
*.pbxuser
12+
!default.pbxuser
13+
*.mode1v3
14+
!default.mode1v3
15+
*.mode2v3
16+
!default.mode2v3
17+
*.perspectivev3
18+
!default.perspectivev3
19+
xcuserdata/
20+
21+
## Other
22+
*.moved-aside
23+
*.xccheckout
24+
*.xcscmblueprint
25+
26+
###
27+
28+
# OS X Finder
29+
.DS_Store
30+
31+
## Obj-C/Swift specific
32+
*.hmap
33+
*.ipa
34+
*.dSYM.zip
35+
*.dSYM
36+
37+
## Playgrounds
38+
timeline.xctimeline
39+
playground.xcworkspace
40+
41+
# Build products
42+
build/
43+
*.o
44+
*.LinkFileList
45+
*.hmap
46+
47+
# Automatic backup files
48+
*~.nib/
49+
*.swp
50+
*~
51+
*.dat
52+
*.dep
53+
54+
# Carthage
55+
Carthage/Checkouts
56+
Carthage/Build

lcp/CHANGELOG.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
**Warning:** Features marked as *experimental* may change or be removed in a future release without notice. Use with caution.
6+
7+
<!--## [Unreleased]-->
8+
9+
## [2.1.1]
10+
11+
### Fixed
12+
13+
* Fix crash using the default `LCPDialogViewController` with CocoaPods.
14+
15+
16+
## [2.1.0]
17+
18+
### Added
19+
20+
* Support for Swift Package Manager (contributed by [@stevenzeck](https://github.com/readium/r2-lcp-swift/pull/121)).
21+
22+
23+
## [2.0.0]
24+
25+
### Deprecated
26+
27+
* All APIs deprecated in previous versions are now unavailable.
28+
29+
30+
## [2.0.0-beta.2]
31+
32+
### Changed
33+
34+
* We removed the dependency to the private `R2LCPClient.framework`, which means:
35+
* Now `r2-lcp-swift` works as a Carthage dependency, no need to use a submodule anymore.
36+
* You do not need to modify `r2-lcp-swift`'s `Cartfile` anymore to add the private `liblcp` dependency.
37+
* However, you must provide a facade to `LCPService` (see [README](README.md) for an example implementation).
38+
* The Renew Loan API got revamped to better support renewal through a web page.
39+
* You will need to implement `LCPRenewDelegate` to coordinate the UX interaction.
40+
* Readium ships with a default implementation `LCPDefaultRenewDelegate` to handle web page renewal with `SFSafariViewController`.
41+
42+
### Fixed
43+
44+
* Fixed really slow opening of large PDF documents.
45+
46+
47+
## [2.0.0-beta.1]
48+
49+
### Changed
50+
51+
* Upgraded shared dependencies.
52+
53+
54+
## [2.0.0-alpha.2]
55+
56+
### Added
57+
58+
* LCP implementation of the [Content Protection API](https://readium.org/architecture/proposals/006-content-protection) to work with the new [Streamer API](https://readium.org/architecture/proposals/005-streamer-api).
59+
* It is highly recommended that you upgrade to the new `Streamer` API to open publications, which will simplify DRM unlocking.
60+
* Two default implementations of `LCPAuthenticating`:
61+
* `LCPDialogAuthentication` to prompt the user for its passphrase with the official LCP dialog.
62+
* `LCPPassphraseAuthentication` to provide directly a passphrase, pulled for example from a database or a web service.
63+
* `LCPService.acquirePublication()` is a new API to acquire a publication from a standalone license. Compared to the former `importPublication()`:
64+
* It doesn't require the passphrase, to allow bulk imports.
65+
* It can be cancelled by calling `cancel()` on the returned `LCPAcquisition` object.
66+
* `LCPService.isLCPProtected()` provides a way to check if a file is protected with LCP.
67+
68+
### Changed
69+
70+
* `LCPAuthenticating` is now provided with more information and you will need to update your implementation.
71+
72+
### Fixed
73+
74+
* [Decrypting resources in some edge cases](https://github.com/readium/r2-lcp-swift/pull/94).
75+
76+
77+
## [2.0.0-alpha.1]
78+
79+
### Added
80+
81+
* Support for [PDF](https://readium.org/lcp-specs/notes/lcp-for-pdf.html) and [Readium Audiobooks](https://readium.org/lcp-specs/notes/lcp-for-audiobooks.html) protected with LCP.
82+
83+
### Changed
84+
85+
* `LCPAuthenticating` can now return hashed passphrases in addition to clear ones. [This can be used by reading apps](https://github.com/readium/r2-lcp-swift/pull/75) fetching hashed passphrases from a web service or [Authentication for OPDS](https://readium.org/lcp-specs/notes/lcp-key-retrieval.html), for example.
86+
* Provided `LCPAuthenticating` instances are now retained by the LCP service. Therefore, you can provide one without keeping a reference around in your own code.
87+
88+
89+
[unreleased]: https://github.com/readium/r2-lcp-swift/compare/master...HEAD
90+
[2.0.0-alpha.1]: https://github.com/readium/r2-lcp-swift/compare/1.2.3...2.0.0-alpha.1
91+
[2.0.0-alpha.2]: https://github.com/readium/r2-lcp-swift/compare/2.0.0-alpha.1...2.0.0-alpha.2
92+
[2.0.0-beta.1]: https://github.com/readium/r2-lcp-swift/compare/2.0.0-alpha.2...2.0.0-beta.1
93+
[2.0.0-beta.2]: https://github.com/readium/r2-lcp-swift/compare/2.0.0-beta.1...2.0.0-beta.2
94+
[2.0.0]: https://github.com/readium/r2-lcp-swift/compare/2.0.0-beta.2...2.0.0
95+
[2.1.0]: https://github.com/readium/r2-lcp-swift/compare/2.0.0...2.1.0
96+
[2.1.1]: https://github.com/readium/r2-lcp-swift/compare/2.1.0...2.1.1

lcp/Cartfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
github "krzyzanowskim/CryptoSwift" ~> 1.3.8
2+
github "readium/r2-shared-swift" ~> 2.2.0
3+
github "stephencelis/SQLite.swift" ~> 0.12.2
4+
github "weichsel/ZIPFoundation" == 0.9.11 # 0.9.12 requires iOS 12+

lcp/Cartfile.resolved

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
github "cezheng/Fuzi" "3.1.3"
2+
github "dexman/Minizip" "1.4.0"
3+
github "krzyzanowskim/CryptoSwift" "1.4.2"
4+
github "readium/r2-shared-swift" "2.2.0"
5+
github "scinfu/SwiftSoup" "2.3.3"
6+
github "stephencelis/SQLite.swift" "0.12.2"
7+
github "weichsel/ZIPFoundation" "0.9.11"

lcp/LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2018, Readium
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

lcp/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.PHONY: carthage
2+
carthage:
3+
xcodegen -s project-carthage.yml

0 commit comments

Comments
 (0)