libgourou/README.md

167 lines
4.1 KiB
Markdown
Raw Normal View History

2021-07-03 21:57:53 +02:00
Introduction
------------
2024-04-11 06:05:23 +02:00
libgourou is a free implementation of Adobe's ADEPT protocol used to add DRM on ePub/PDF files. It overcomes the lack of Adobe support for Linux platforms.
2021-07-03 21:57:53 +02:00
Architecture
------------
2024-04-11 06:05:23 +02:00
Like RMSDK, libgourou has a client/server scheme. All platform specific functions (crypto, network...) have to be implemented in a client class (that derives from DRMProcessorClient) while server implements ADEPT protocol.
2023-09-06 21:21:43 +02:00
A reference implementation using cURL, OpenSSL and libzip is provided (in _utils_ directory).
2021-07-03 21:57:53 +02:00
2024-04-11 06:05:23 +02:00
Main functions to use from gourou::DRMProcessor are:
2021-07-03 21:57:53 +02:00
* Get an ePub from an ACSM file : _fulfill()_ and _download()_
* Create a new device : _createDRMProcessor()_
* Register a new device : _signIn()_ and _activateDevice()_
2021-12-18 17:42:23 +01:00
* Remove DRM : _removeDRM()_
2022-04-03 09:47:47 +02:00
* Return loaned book : _returnLoan()_
2021-07-03 21:57:53 +02:00
2024-04-11 06:05:23 +02:00
You can import configuration from (at least):
2021-07-03 21:57:53 +02:00
2021-08-25 21:54:52 +02:00
* Kobo device : .adept/device.xml, .adept/devicesalt and .adept/activation.xml
2021-07-03 21:57:53 +02:00
* Bookeen device : .adobe-digital-editions/device.xml, root/devkey.bin and .adobe-digital-editions/activation.xml
2024-04-11 06:05:23 +02:00
Or create a new one. Be careful: there is a limited number of devices that can be created by one account.
2021-07-03 21:57:53 +02:00
2024-04-11 06:05:23 +02:00
ePub are encrypted using a shared key: one account / multiple devices, so you can create and register a device into your computer and read downloaded (and encrypted) ePub file with your eReader configured using the same AdobeID account.
2021-07-03 21:57:53 +02:00
2024-04-11 06:05:23 +02:00
For those who want to remove DRM without adept_remove, you can export your private key and import it within [Calibre](https://calibre-ebook.com/) an its DeDRM plugin.
2021-08-25 21:54:52 +02:00
2021-07-03 21:57:53 +02:00
Dependencies
------------
2024-04-11 06:05:23 +02:00
For libgourou:
2021-07-03 21:57:53 +02:00
2022-06-12 15:00:48 +02:00
_externals_ :
2023-01-08 21:02:59 +01:00
* libpugixml
2021-07-03 21:57:53 +02:00
2024-04-11 06:05:23 +02:00
_internals_:
2022-06-12 15:00:48 +02:00
* uPDFParser
2024-04-11 06:05:23 +02:00
For utils:
2021-07-03 21:57:53 +02:00
* libcurl
2021-07-03 21:57:53 +02:00
* OpenSSL
* libzip
* libpugixml
2021-07-03 21:57:53 +02:00
2022-06-12 15:00:48 +02:00
Internal libraries are automatically fetched and statically compiled during the first run.
2024-04-11 06:05:23 +02:00
When you update libgourou's repository, **don't forget to update internal libraries** with:
2022-06-12 15:00:48 +02:00
make update_lib
2021-07-03 21:57:53 +02:00
Compilation
-----------
2021-07-03 22:02:52 +02:00
Use _make_ command
2021-07-03 21:57:53 +02:00
2023-01-08 21:02:59 +01:00
make [CROSS=XXX] [DEBUG=(0*|1)] [STATIC_UTILS=(0*|1)] [BUILD_UTILS=(0|1*)] [BUILD_STATIC=(0*|1)] [BUILD_SHARED=(0|1*)] [all*|clean|ultraclean|build_utils|install|uninstall]
2021-07-03 21:57:53 +02:00
CROSS can define a cross compiler prefix (ie arm-linux-gnueabihf-)
DEBUG can be set to compile in DEBUG mode
2021-09-09 21:00:43 +02:00
BUILD_UTILS to build utils or not
2021-08-25 21:54:52 +02:00
2021-07-05 20:23:25 +02:00
STATIC_UTILS to build utils with static library (libgourou.a) instead of default dynamic one (libgourou.so)
2021-09-09 21:00:43 +02:00
BUILD_STATIC build libgourou.a if 1, nothing if 0, can be combined with BUILD_SHARED
2021-09-09 21:00:43 +02:00
BUILD_SHARED build libgourou.so if 1, nothing if 0, can be combined with BUILD_STATIC
2021-07-03 21:57:53 +02:00
2023-08-09 20:58:06 +02:00
other variables are DESTDIR and PREFIX to handle destination install directory
2021-09-09 21:00:43 +02:00
* Default value
2021-08-25 21:54:52 +02:00
2021-12-18 17:42:23 +01:00
2021-07-03 21:57:53 +02:00
Utils
-----
First, add libgourou.so to your LD_LIBRARY_PATH
2021-07-03 21:57:53 +02:00
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD
You can optionaly specify your .adept directory
export ADEPT_DIR=/home/XXX
2024-04-11 06:05:23 +02:00
Then, use utils as following:
2024-04-11 06:05:23 +02:00
You can import configuration from your eReader or create a new one with _utils/adept\_activate_:
2022-02-22 21:15:46 +01:00
./utils/adept_activate -u <AdobeID USERNAME>
2021-07-03 21:57:53 +02:00
Then a _/home/<user>/.config/adept_ directory is created with all configuration file
2021-07-03 21:57:53 +02:00
2024-04-11 06:05:23 +02:00
To download an ePub/PDF:
2021-07-03 21:57:53 +02:00
2023-01-08 21:02:59 +01:00
./utils/acsmdownloader <ACSM_FILE>
2021-07-03 21:57:53 +02:00
2024-04-11 06:05:23 +02:00
To export your private key (for DeDRM software):
2021-08-25 21:54:52 +02:00
./utils/acsmdownloader --export-private-key [-o adobekey_1.der]
2024-04-11 06:05:23 +02:00
To remove ADEPT DRM:
2021-12-18 17:42:23 +01:00
2023-01-08 21:02:59 +01:00
./utils/adept_remove <encryptedFile>
2021-12-18 17:42:23 +01:00
2024-04-11 06:05:23 +02:00
To list loaned books:
2022-04-03 09:47:47 +02:00
./utils/adept_loan_mgt [-l]
2024-04-11 06:05:23 +02:00
To return a loaned book:
2022-04-03 09:47:47 +02:00
./utils/adept_loan_mgt -r <id>
2022-02-22 21:15:46 +01:00
You can get utils full options description with -h or --help switch
2022-06-08 11:39:24 +02:00
Docker
------
A docker image (by bcliang) is available at [https://github.com/bcliang/docker-libgourou/](https://github.com/bcliang/docker-libgourou/)
2021-07-03 21:57:53 +02:00
Copyright
---------
Grégory Soutadé
License
-------
libgourou : LGPL v3 or later
utils : BSD
2021-07-12 21:26:53 +02:00
Special thanks
--------------
* _Jens_ for all test samples and utils testing
2022-02-22 21:15:46 +01:00
* _Milian_ for debug & code
2023-08-09 20:58:06 +02:00
* _Berwyn H_ for all test samples, feedbacks, patches and kind donation
2024-08-27 21:48:39 +02:00
Donation
--------
https://www.paypal.com/donate/?hosted_button_id=JD3U6XMZCPHKN
Donators
--------
* _Berwyn H_
* _bwitt_
2024-08-31 08:27:53 +02:00
* _Ismail_