Skip to content

Commit 0403429

Browse files
committed
Merge old repositories into the kotlin-toolkit monorepo
6 parents aef55dc + 5488363 + 42764bd + cc97a1f + f7c8e35 + b620a82 commit 0403429

File tree

597 files changed

+52729
-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.

597 files changed

+52729
-0
lines changed

.gitignore

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
.DS_Store
2+
3+
# Built application files
4+
*.apk
5+
*.aar
6+
*.ap_
7+
*.aab
8+
9+
# Files for the ART/Dalvik VM
10+
*.dex
11+
12+
# Java class files
13+
*.class
14+
15+
# Generated files
16+
bin/
17+
gen/
18+
out/
19+
# Uncomment the following line in case you need and you don't have the release build type files in your app
20+
# release/
21+
22+
# Gradle files
23+
.gradle/
24+
build/
25+
26+
# Local configuration file (sdk path, etc)
27+
local.properties
28+
29+
# Proguard folder generated by Eclipse
30+
proguard/
31+
32+
# Log Files
33+
*.log
34+
35+
# Android Studio Navigation editor temp files
36+
.navigation/
37+
38+
# Android Studio captures folder
39+
captures/
40+
41+
# IntelliJ
42+
*.iml
43+
.idea/workspace.xml
44+
.idea/tasks.xml
45+
.idea/gradle.xml
46+
.idea/assetWizardSettings.xml
47+
.idea/dictionaries
48+
.idea/libraries
49+
.idea/jarRepositories.xml
50+
# Android Studio 3 in .gitignore file.
51+
.idea/caches
52+
.idea/modules.xml
53+
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
54+
.idea/navEditor.xml
55+
56+
# Keystore files
57+
*.jks
58+
*.keystore
59+
60+
# External native build folder generated in Android Studio 2.2 and later
61+
.externalNativeBuild
62+
.cxx/
63+
64+
# Version control
65+
vcs.xml
66+
67+
# lint
68+
lint/intermediates/
69+
lint/generated/
70+
lint/outputs/
71+
lint/tmp/
72+
lint/reports/
73+
74+
# Android Profiling
75+
*.hprof

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Readium Kotlin Toolkit
2+
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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-kotlin). 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-kotlin`:
50+
* `r2-streamer-kotlin`:
51+
* `r2-navigator-kotlin`:
52+
* `r2-opds-kotlin`:
53+
* `r2-lcp-kotlin`:
54+
55+
#### Development environment
56+
57+
* OS: <!-- e.g. macOS 10.3 -->
58+
* IDE: <!-- e.g. Android Studio 4.1.3 -->
59+
60+
#### Testing device
61+
62+
* Android version:
63+
* Model: <!-- e.g. Pixel 3a -->
64+
* Is it an emulator? Yes or No
65+
66+
### Additional context
67+
68+
* 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 -->
69+
70+
<!--
71+
Share additional code showing how you use Readium, if relevant.
72+
73+
Output logs are useful as well.
74+
75+
If you already went through the codebase to find the bug, you can explain your findings here.
76+
-->
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: r2-lcp-kotlin
2+
3+
on:
4+
push:
5+
branches: [ develop ]
6+
pull_request:
7+
branches: [ develop ]
8+
9+
jobs:
10+
build:
11+
name: Build and test
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
- name: Set up JDK 11
18+
uses: actions/setup-java@v2
19+
with:
20+
java-version: '11'
21+
distribution: 'adopt'
22+
- name: Build
23+
run: ./gradlew clean build -x test
24+
- name: Test
25+
run: ./gradlew test --continue

readium/lcp/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*.iml
2+
/local.properties
3+
/.idea/workspace.xml
4+
/.idea/libraries
5+
.DS_Store
6+
/build
7+
/captures
8+
.externalNativeBuild
9+
r2-lcp/build
10+
.gradle

readium/lcp/CHANGELOG.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
**Warning:** Features marked as *alpha* may change or be removed in a future release without notice. Use with caution.
6+
7+
<!--## [Unreleased]-->
8+
9+
## [2.1.0]
10+
11+
### Changed
12+
13+
* Upgraded to Kotlin 1.5.31 and Gradle 7.1.1.
14+
* Migrated to Jetpack Room for the SQLite database storing rights and passphrases (contributed by [@stevenzeck](https://github.com/readium/r2-lcp-kotlin/pull/116)).
15+
* Note that the internal SQL schema changed. You will need to update your app if you were querying the database manually.
16+
17+
18+
## [2.0.0]
19+
20+
### Fixed
21+
22+
* [#267](https://github.com/readium/r2-testapp-kotlin/issues/267) Prints and copy characters left are now properly reported (contributed by [@qnga](https://github.com/readium/r2-lcp-kotlin/pull/104)).
23+
24+
25+
## [2.0.0-beta.2]
26+
27+
### Added
28+
29+
* You can observe the progress of an acquisition by providing an `onProgress` closure to `LcpService.acquirePublication()`.
30+
* Extensibility in licenses' `Rights` model.
31+
32+
### Changed
33+
34+
* The Renew Loan API got revamped to better support renewal through a web page.
35+
* You will need to implement `LcpLicense.RenewListener` to coordinate the UX interaction.
36+
* If your application fits Material Design guidelines, take a look at `MaterialRenewListener` for a default implementation.
37+
* Removed dependency on Joda's `DateTime` in public APIs.
38+
* You can always create a `DateTime` from the standard `Date` objects if you relied on Joda's features in the callers.
39+
40+
### Fixed
41+
42+
* [#287](https://github.com/readium/r2-testapp-kotlin/issues/287) Make sure the passphrase input is visible on smaller devices in the authentication dialog.
43+
44+
45+
## [2.0.0-beta.1]
46+
47+
### Changed
48+
49+
* Upgraded to Kotlin 1.4.10.
50+
51+
### Fixed
52+
53+
* When acquiring a publication, falls back on the media type declared in the license link if the server returns an unknown media type.
54+
55+
56+
## [2.0.0-alpha.2]
57+
58+
### Added
59+
60+
* 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) (contributed by [@qnga](https://github.com/readium/r2-lcp-kotlin/pull/79)).
61+
* It is highly recommended that you upgrade to the new `Streamer` API to open publications, which will simplify DRM unlocking.
62+
* Two default implementations of `LcpAuthenticating`:
63+
* `LcpDialogAuthentication` to prompt the user for its passphrase with the official LCP dialog.
64+
* `LcpPassphraseAuthentication` to provide directly a passphrase, pulled for example from a database or a web service.
65+
* `LcpService::isLcpProtected()` provides a way to check if a file is protected with LCP.
66+
* All the `LcpException` errors are now implementing `UserException` and are suitable for user display. Use `getUserMessage()` to get the localized message.
67+
68+
### Changed
69+
70+
* The public API got modernized to be more Kotlin idiomatic (contributed by [@qnga](https://github.com/readium/r2-lcp-kotlin/pull/84)).
71+
* All asynchronous APIs are now suspending to take advantage of Kotlin's coroutines.
72+
* `LcpAuthenticating` is now provided with more information and you will need to update any implementation you may have.
73+
* If you copied the default authentication dialog, it's recommended to use `LcpDialogAuthentication` instead.
74+
* Publications are now downloaded to a temporary location, to make sure disk storage can be recovered automatically by the system. After acquiring the publication, you need to move the downloaded file to another permanent location.
75+
* The private `liblcp` dependency is now accessed through reflection, to allow switching LCP dynamically (contributed by [@qnga](https://github.com/readium/r2-lcp-kotlin/pull/87)).
76+
* You need to add `implementation "readium:liblcp:1.0.0@aar"` to your `build.gradle`.
77+
* `LcpService::create()` returns `null` if `lcplib` is not found.
78+
79+
### Fixed
80+
81+
* Decrypting resources in some edge cases (contributed by [@qnga](https://github.com/readium/r2-lcp-kotlin/pull/84))
82+
* Issues with LSD interactions:
83+
* Exceptions handling with `renew` and `return` interactions.
84+
* Presentation of the `renew` interaction through an HTML page.
85+
* The timeout of fetching the License Status Document is reduced to 5 seconds, to avoid blocking a publication opening in low Internet conditions.
86+
87+
88+
## [2.0.0-alpha.1]
89+
90+
### Added
91+
92+
* 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.
93+
94+
### Changed
95+
96+
* `LCPAuthenticating` can now return hashed passphrases in addition to clear ones. [This can be used by reading apps](https://github.com/readium/r2-lcp-kotlin/pull/64) fetching hashed passphrases from a web service or [Authentication for OPDS](https://readium.org/lcp-specs/notes/lcp-key-retrieval.html), for example.
97+
98+
### Fixed
99+
100+
* [`OutOfMemoryError` when downloading a large publication](https://github.com/readium/r2-lcp-kotlin/issues/70). This fix removed the dependency to [Fuel](https://github.com/kittinunf/fuel).
101+
* The `AndroidManifest.xml` is not forcing anymore `allowBackup` and `supportsRtl`, to let reading apps manage these features themselves (contributed by [@twaddington](https://github.com/readium/r2-lcp-kotlin/pull/63)).
102+
103+
104+
[unreleased]: https://github.com/readium/r2-lcp-kotlin/compare/master...HEAD
105+
[2.0.0-alpha.1]: https://github.com/readium/r2-lcp-kotlin/compare/1.1.3...2.0.0-alpha.1
106+
[2.0.0-alpha.2]: https://github.com/readium/r2-lcp-kotlin/compare/2.0.0-alpha.1...2.0.0-alpha.2
107+
[2.0.0-beta.1]: https://github.com/readium/r2-lcp-kotlin/compare/2.0.0-alpha.2...2.0.0-beta.1
108+
[2.0.0-beta.2]: https://github.com/readium/r2-lcp-kotlin/compare/2.0.0-beta.1...2.0.0-beta.2
109+
[2.0.0]: https://github.com/readium/r2-lcp-kotlin/compare/2.0.0-beta.2...2.0.0
110+
[2.1.0]: https://github.com/readium/r2-lcp-kotlin/compare/2.0.0...2.1.0
111+

readium/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) 2017, 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.

readium/lcp/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](/LICENSE)
2+
[![Release](https://jitpack.io/v/readium/r2-lcp-kotlin.svg)](https://jitpack.io/#readium/r2-lcp-kotlin)
3+
# r2-lcp-kotlin
4+
5+
[Changes and releases are documented in the Changelog](CHANGELOG.md)

readium/lcp/build.gradle

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
buildscript {
4+
ext.kotlin_version = '1.5.31'
5+
6+
repositories {
7+
google()
8+
mavenCentral()
9+
}
10+
dependencies {
11+
classpath 'com.android.tools.build:gradle:7.0.2'
12+
13+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14+
15+
// NOTE: Do not place your application dependencies here; they belong
16+
// in the individual module build.gradle files
17+
}
18+
}
19+
20+
allprojects {
21+
repositories {
22+
google()
23+
mavenCentral()
24+
maven { url 'https://jitpack.io' }
25+
}
26+
}
27+
28+
task clean(type: Delete) {
29+
delete rootProject.buildDir
30+
}

readium/lcp/gradle.properties

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Project-wide Gradle settings.
2+
3+
# IDE (e.g. Android Studio) users:
4+
# Gradle settings configured through the IDE *will override*
5+
# any settings specified in this file.
6+
7+
# For more details on how to configure your build environment visit
8+
# http://www.gradle.org/docs/current/userguide/build_environment.html
9+
10+
# Specifies the JVM arguments used for the daemon process.
11+
# The setting is particularly useful for tweaking memory settings.
12+
org.gradle.jvmargs=-Xmx1536m
13+
14+
# When configured, Gradle will run in incubating parallel mode.
15+
# This option should only be used with decoupled projects. More details, visit
16+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17+
org.gradle.parallel=true
18+
org.gradle.configureondemand=true
19+
android.useAndroidX=true
20+
android.enableJetifier=true

0 commit comments

Comments
 (0)