-
Notifications
You must be signed in to change notification settings - Fork 61
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
Opening encrypted epubs on android devices. #135
Comments
Hi @rahulk11, Also, could you please rename your issue with a shorter title (e.g. Opening Readium LCP encrypted epubs), use a Github tag, not "Question" in the title, and provide a first comment with sufficient details? |
@llemeurfr I am sorry for the mistake. |
Firstly, you need to follow the EPUB specification to make sure that your publications "declare" which resources (i.e. files within the zip container) are encrypted, and with what algorithm / DRM scheme: Then, you should explore the notion of "Content Module" and "Content Filter" in the ReadiumSDK architecture, Daniel |
@danielweck thanks. i'll look into these |
Hi @danielweck , i've checked with the publication and they dont have any plan to include DRM. They just giving me an encrypted epub. Encryption is not done to individual files inside epub, instead, the epub file as a whole has been encrypted using conceal library from facebook. |
ReadiumSDK does not support decrypting the publication as a whole (i.e. the EPUB zip archive as a single cypher stream). The recommended ; and widely implemented ; practice in the electronic publishing industry is to encrypt individual resource within the EPUB package so that some resources remain available as plain text (e.g. essential metadata that reading systems can access prior to loading the full EPUB / prior to reading encrypted resources). Furthermore, depending on the cypher algorithm, encrypting the zip container as a whole makes it hard ; if not impossible ; to efficiently "stream" data out of the EPUB package (e.g. video/audio files). So I am afraid you use-case sits outside of the ReadiumSDK's scope. You can of course decrypt the entire zip file in a separate process, place the output somewhere in a hidden folder on the filesystem, and pass the new file location to ReadiumSDK (in which case we fallback to loading a regular plain-text publication). The problem with that approach is that unless the hidden filesystem location is well protected, this is a weak solution because malicious users could potentially have access to the fully-decrypted version. |
@danielweck thank you for your input. However i was thinking if it is possible to provide stream of epub to ReadiumSDK instead of giving it a file path. I've seen something similar in this library |
ReadiumSDK (the C++ lib) only support s loading EPUB files from filesystem locations. Behind the scenes, the zip library accesses a low-level system file handle. |
How does SDKLauncher-Android project integrate lcp? |
@xiaoxiaomuou have you tried compiling + running the The Git submodules should be:
|
@danielweck I have completely cloned https://github.com/readium/SDKLauncher-Android/tree/feature/lcp, but I encountered an error that I didn't know how to modify during compilation: <Error:error: 'E: /LcpSdkTest/SDKLauncher-Android/readium-sdk/Platform/Android/epub3/libs/DEBUG/armeabi-v7a/libepub3.so', needed by '../../../../build/intermediates/cmake /arm7/debug/obj/armeabi-v7a/liblcp.so', missing and no known rule to make it> Please advise me how to modify the project? Thank you again! |
@xiaoxiaomuou yes, sorry the AndroidStudio/Gradle/CMake build system is currently imperfect, you need to make sure that the build output from Try the following command line steps and let us know how it goes, please. The hierarchy of filesystem folders / git repositories should look like:
Steps 6 to 9 are essential, because building Note that steps 10, 11, 12 are actually optional, next time you can just use AndroidStudio directly. Make sure that the file This confusing situation is an unfortunate consequence of the evolving build system: originally Eclipse shell scripts, then AndroidStudio + Gradle and NDK Makefile invoked externally, then Gradle-experimental internal DSL for NDK/JNI, now Gradle and pure CMake which allows hybrid Java/C++ debugging without the need for Gradle-experimental ... ! Within the next couple of months there will be a refactoring of the build system to only use the latest recommended practice, instead of a combination of techniques. In the meantime, thank you for your understanding, and good luck with building! Let us know if this works for you. Thanks. Appendix "A1"
Appendix "A2"
Appendix "A3"
|
@danielweck my project works fine with "com.android.tools.build:gradle:2.2.3" but now because of playstore restriction i have upgraded project gradle to 'com.android.tools.build:gradle:3.2.1' it compiles fine but after this upgrade licence is not getting decrypted , if (mLicense.isDecrypted()) returns false. can you suggest something. |
Do you compile |
Pkg.Revision = 15.2.4203891 is this what you are asking? same ndk was working previously. |
Thanks. Would you mind trying with NDK |
PS: what other changes did you make to the Gradle config? You had to add build "flavors", right? Anything else? |
I tried with ndk 16b still same issue. yes i added flavorDimensions "default" in LCP gradle and removed following code from LCP manifest. |
The latest working Gradle (etc) configuration is available in these Pull Requests:
...or if not using |
General Instructions
Question
(choose ONE from the above list and delete the others)
Product
Choose one of the following (and delete the others)
Additional information
Please list any additional information that might help us
The text was updated successfully, but these errors were encountered: