Skip to content
This repository was archived by the owner on Jan 24, 2026. It is now read-only.
/ libgourou Public archive
forked from SamuelMarks/libgourou

Convert ACSM files to DRM-free EPUB/PDF on macOS. Fork of libgourou patched for macOS

License

Notifications You must be signed in to change notification settings

swap357/libgourou

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

116 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libgourou for macOS

This fork is patched to build and run on macOS.

Includes acsm2epub - a one-command wrapper to convert ACSM files to DRM-free EPUB/PDF.


Introduction

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.

macOS Quick Start

Install dependencies

brew install curl openssl libzip pugixml

Build

./scripts/setup.sh
make BUILD_STATIC=1 BUILD_SHARED=0 BUILD_UTILS=1

Install the wrapper

cp acsm2epub ~/.local/bin/
chmod +x ~/.local/bin/acsm2epub
# Add to PATH if needed:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc

Usage

acsm2epub book.acsm [output_dir]

First run will prompt for Adobe ID registration (or anonymous auth).

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. A reference implementation using Qt, OpenSSL and libzip is provided (in utils directory).

Main fucntions to use from gourou::DRMProcessor are :

  • Get an ePub from an ACSM file : fulfill() and download()
  • Create a new device : createDRMProcessor()
  • Register a new device : signIn() and activateDevice()
  • Remove DRM : removeDRM()
  • Return loaned book : returnLoan()

You can import configuration from (at least) :

  • 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

Or create a new one. Be careful : there is a limited number of devices that can be created bye 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.

For those who wants to remove DRM without adept_remove, you can export your private key and import it within Calibre an its DeDRM plugin.

Dependencies

For libgourou :

externals :

  • None

internals :

  • PugiXML
  • uPDFParser

For utils :

  • libcurl
  • OpenSSL
  • libzip

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 :

make update_lib

Compilation

Use make command

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]

CROSS can define a cross compiler prefix (ie arm-linux-gnueabihf-)

DEBUG can be set to compile in DEBUG mode

BUILD_UTILS to build utils or not

STATIC_UTILS to build utils with static library (libgourou.a) instead of default dynamic one (libgourou.so)

BUILD_STATIC build libgourou.a if 1, nothing if 0, can be combined with BUILD_SHARED

BUILD_SHARED build libgourou.so if 1, nothing if 0, can be combined with BUILD_STATIC

  • Default value

Utils

You can import configuration from your eReader or create a new one with utils/adept_activate :

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD
./utils/adept_activate -u <AdobeID USERNAME>

Then a ./.adept directory is created with all configuration file

To download an ePub/PDF :

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD
./utils/acsmdownloader -f <ACSM_FILE>

To export your private key (for DeDRM software) :

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD
./utils/acsmdownloader --export-private-key [-o adobekey_1.der]

To remove ADEPT DRM :

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD
./utils/adept_remove -f <encryptedFile>

To list loaned books :

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD
./utils/adept_loan_mgt [-l]

To return a loaned book :

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD
./utils/adept_loan_mgt -r <id>

You can get utils full options description with -h or --help switch

Docker

A docker image (by bcliang) is available at https://github.com/bcliang/docker-libgourou/

Copyright

Grégory Soutadé

License

libgourou : LGPL v3 or later

utils : BSD

Special thanks

  • Jens for all test samples and utils testing
  • Milian for debug & code

About

Convert ACSM files to DRM-free EPUB/PDF on macOS. Fork of libgourou patched for macOS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 92.1%
  • CMake 4.4%
  • Shell 1.2%
  • C 1.2%
  • Makefile 1.1%