Compare commits

..

3 Commits

Author SHA1 Message Date
nicokosi f60abf04d8 Fix typos in README.md 2024-04-11 06:05:23 +02:00
soutade 0d77cf55e1 Update version 2024-03-28 21:58:07 +01:00
soutade 86a79cc381 Remove whole EBX objects for PDF when removing DRM 2024-03-28 21:54:23 +01:00
3 changed files with 26 additions and 22 deletions
+18 -18
View File
@@ -1,16 +1,16 @@
Introduction Introduction
------------ ------------
libgourou is a free implementation of Adobe's ADEPT protocol used to add DRM on ePub/PDF files. It overcome the lacks of Adobe support for Linux platforms. 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.
Architecture Architecture
------------ ------------
Like RMSDK, libgourou has a client/server scheme. All platform specific functions (crypto, network...) has to be implemented in a client class (that derives from DRMProcessorClient) while server implements ADEPT protocol. 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.
A reference implementation using cURL, OpenSSL and libzip is provided (in _utils_ directory). A reference implementation using cURL, OpenSSL and libzip is provided (in _utils_ directory).
Main fucntions to use from gourou::DRMProcessor are : Main functions to use from gourou::DRMProcessor are:
* Get an ePub from an ACSM file : _fulfill()_ and _download()_ * Get an ePub from an ACSM file : _fulfill()_ and _download()_
* Create a new device : _createDRMProcessor()_ * Create a new device : _createDRMProcessor()_
@@ -18,32 +18,32 @@ Main fucntions to use from gourou::DRMProcessor are :
* Remove DRM : _removeDRM()_ * Remove DRM : _removeDRM()_
* Return loaned book : _returnLoan()_ * Return loaned book : _returnLoan()_
You can import configuration from (at least) : You can import configuration from (at least):
* Kobo device : .adept/device.xml, .adept/devicesalt and .adept/activation.xml * Kobo device : .adept/device.xml, .adept/devicesalt and .adept/activation.xml
* Bookeen device : .adobe-digital-editions/device.xml, root/devkey.bin and .adobe-digital-editions/activation.xml * Bookeen device : .adobe-digital-editions/device.xml, root/devkey.bin and .adobe-digital-editions/activation.xml
Or create a new one. Be careful : there is a limited number of devices that can be created bye one account. Or create a new one. Be careful: there is a limited number of devices that can be created by one account.
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. 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.
For those who wants 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. 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.
Dependencies Dependencies
------------ ------------
For libgourou : For libgourou:
_externals_ : _externals_ :
* libpugixml * libpugixml
_internals_ : _internals_:
* uPDFParser * uPDFParser
For utils : For utils:
* libcurl * libcurl
* OpenSSL * OpenSSL
@@ -52,7 +52,7 @@ For utils :
Internal libraries are automatically fetched and statically compiled during the first run. Internal libraries are automatically fetched and statically compiled during the first run.
When you update libgourou's repository, **don't forget to update internal libraries** with : When you update libgourou's repository, **don't forget to update internal libraries** with:
make update_lib make update_lib
@@ -92,31 +92,31 @@ You can optionaly specify your .adept directory
export ADEPT_DIR=/home/XXX export ADEPT_DIR=/home/XXX
Then, use utils as following : Then, use utils as following:
You can import configuration from your eReader or create a new one with _utils/adept\_activate_ : You can import configuration from your eReader or create a new one with _utils/adept\_activate_:
./utils/adept_activate -u <AdobeID USERNAME> ./utils/adept_activate -u <AdobeID USERNAME>
Then a _/home/<user>/.config/adept_ directory is created with all configuration file Then a _/home/<user>/.config/adept_ directory is created with all configuration file
To download an ePub/PDF : To download an ePub/PDF:
./utils/acsmdownloader <ACSM_FILE> ./utils/acsmdownloader <ACSM_FILE>
To export your private key (for DeDRM software) : To export your private key (for DeDRM software):
./utils/acsmdownloader --export-private-key [-o adobekey_1.der] ./utils/acsmdownloader --export-private-key [-o adobekey_1.der]
To remove ADEPT DRM : To remove ADEPT DRM:
./utils/adept_remove <encryptedFile> ./utils/adept_remove <encryptedFile>
To list loaned books : To list loaned books:
./utils/adept_loan_mgt [-l] ./utils/adept_loan_mgt [-l]
To return a loaned book : To return a loaned book:
./utils/adept_loan_mgt -r <id> ./utils/adept_loan_mgt -r <id>
+1 -1
View File
@@ -37,7 +37,7 @@
#define ACS_SERVER "http://adeactivate.adobe.com/adept" #define ACS_SERVER "http://adeactivate.adobe.com/adept"
#endif #endif
#define LIBGOUROU_VERSION "0.8.5" #define LIBGOUROU_VERSION "0.8.6"
namespace gourou namespace gourou
{ {
+7 -3
View File
@@ -1317,6 +1317,7 @@ namespace gourou
std::vector<uPDFParser::Object*> objects = parser.objects(); std::vector<uPDFParser::Object*> objects = parser.objects();
std::vector<uPDFParser::Object*>::iterator it; std::vector<uPDFParser::Object*>::iterator it;
std::vector<uPDFParser::Object*>::reverse_iterator rIt; std::vector<uPDFParser::Object*>::reverse_iterator rIt;
std::vector<uPDFParser::Object*> ebxObjects;
unsigned char decryptedKey[16]; unsigned char decryptedKey[16];
int ebxId; int ebxId;
@@ -1327,7 +1328,7 @@ namespace gourou
{ {
EBXHandlerFound = true; EBXHandlerFound = true;
uPDFParser::Object* ebx = *rIt; uPDFParser::Object* ebx = *rIt;
ebxVersion = (uPDFParser::Integer*)(*ebx)["V"]; ebxVersion = (uPDFParser::Integer*)(*ebx)["V"];
if (ebxVersion->value() != 4) if (ebxVersion->value() != 4)
{ {
@@ -1338,7 +1339,7 @@ namespace gourou
{ {
EXCEPTION(DRM_ERR_ENCRYPTION_KEY, "No ADEPT_LICENSE found"); EXCEPTION(DRM_ERR_ENCRYPTION_KEY, "No ADEPT_LICENSE found");
} }
uPDFParser::String* licenseObject = (uPDFParser::String*)(*ebx)["ADEPT_LICENSE"]; uPDFParser::String* licenseObject = (uPDFParser::String*)(*ebx)["ADEPT_LICENSE"];
std::string value = licenseObject->value(); std::string value = licenseObject->value();
@@ -1375,7 +1376,7 @@ namespace gourou
if (object->objectId() == ebxId) if (object->objectId() == ebxId)
{ {
// object->deleteKey("Filter"); ebxObjects.push_back(object);
continue; continue;
} }
@@ -1485,6 +1486,9 @@ namespace gourou
} }
} }
for(it = ebxObjects.begin(); it != ebxObjects.end(); it++)
parser.removeObject(*it);
uPDFParser::Object& trailer = parser.getTrailer(); uPDFParser::Object& trailer = parser.getTrailer();
trailer.deleteKey("Encrypt"); trailer.deleteKey("Encrypt");