Compare commits

..
10 Commits
Author SHA1 Message Date
soutade 906b8a3733 Update libgourou version to v0.8.10 2026-09-02 16:41:29 +02:00
soutade c32230f27d Remove warning about _XOPEN_SOURCE 2026-09-02 16:41:29 +02:00
soutade 06297aa6f0 Add warning about new device activation (now require a ByteBooks account) 2026-09-02 16:37:57 +02:00
soutade 2d4a5c992c Get ca-certificates.crt path from SSL_CERT_FILE env var if available 2026-09-02 16:21:52 +02:00
benoitperrin 1abb470819 Fix adept_remove -O placing result in a nested sub-directory
With -O <dir>, the output path was built from the full input path
instead of its base name:

    filename = std::string(inputFile);
    if (outputDir)
        filename = std::string(outputDir) + "/" + filename;

So `adept_remove -O /out /tmp/x/book.epub` wrote the result to
/out/tmp/x/book.epub (createPath() silently creating the intermediate
directories) instead of /out/book.epub.

-O is documented as the directory "were to put result", so only the
input's base name should be appended. acsmdownloader is unaffected
because it derives its output name from the title metadata, not from
the input path.

Reduce the input to its base name before prefixing it with -O.
2026-07-01 11:14:30 +02:00
soutade 324c566756 Fix help of adept_load_mgt 2026-04-12 19:44:11 +02:00
soutade 334aa4dae5 Update version to 0.8.9 2026-04-12 19:42:11 +02:00
teymour 2265b1d710 new working adobe's ade activate url 2026-04-07 17:35:50 +02:00
soutade eed5be06c0 fix regression in 76cab18667 2026-04-03 14:38:34 +02:00
raxod502 d7bd98e719 Use -fmacro-prefix-map for utils
The __FILE__ macro is used in the EXCEPTION macro to report the file
name alongside error messages. This macro reports the file name
exactly as it is passed to the compiler. For most source files in
libgourou this is a nice relative path such as "src/libgourou.cpp".
However, for EXCEPTION instances in libgourou_common.h, the compiler
flag is "-I$(ROOT)/include", where $(ROOT) is an absolute path passed
from the higher Makefile. This results in an absolute path to the
build directory being hardcoded into the utils shared library and
binaries, and reported in error messages. Besides being less readable
than the more common relative paths, this triggers warnings from
packaging tools that detect inadvertent references to temporary build
directories that end up in compiled binaries and might indicate a bug.

There is a GCC feature -fmacro-prefix-map which allows to perform
substition on the values that are used for __FILE__. Use that option
to strip out the absolute path component, without changing any
functionality.

The feature was added to GCC on 2018-01-18 and released in GCC 8.1.0.

https://github.com/gcc-mirror/gcc/commit/7365279fca30371b07e49bfa83a23ddc44cc3860
2026-03-14 13:51:40 +01:00
7 changed files with 25 additions and 10 deletions
+2
View File
@@ -86,6 +86,8 @@ other variables are DESTDIR and PREFIX to handle destination install directory
Utils
-----
!!Warning!! : When activating a new device (with _adept\_activate_), Adobe ID accounts are deprecated. You need to sign in with a (dts) ByteBooks account.
First, add libgourou.so to your LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD
+2 -2
View File
@@ -34,10 +34,10 @@
#endif
#ifndef ACS_SERVER
#define ACS_SERVER "http://adeactivate.adobe.com/adept"
#define ACS_SERVER "https://adeactivate.adobe.com/adept"
#endif
#define LIBGOUROU_VERSION "0.8.8"
#define LIBGOUROU_VERSION "0.8.10"
namespace gourou
{
+10 -3
View File
@@ -1513,7 +1513,8 @@ namespace gourou
}
}
/* Delete objects that reference EBX objects, except in trailer */
/* Delete objects that reference EBX objects,
except in trailer and objects that references Info */
for(it = objects.begin(); it != objects.end(); it++)
{
uPDFParser::Object* object = *it;
@@ -1522,12 +1523,18 @@ namespace gourou
{
uPDFParser::Reference* encrypt = (uPDFParser::Reference*)(*object)["Encrypt"];
if (object->hasKey("Info"))
{
object->deleteKey("Encrypt");
continue;
}
/* Delete EBX objects */
for(ebxIt = ebxObjects.begin(); ebxIt != ebxObjects.end(); ebxIt++)
{
if (encrypt->value() == (*ebxIt)->objectId())
{
GOUROU_LOG(ERROR, "Delete stream id " << object->objectId());
GOUROU_LOG(DEBUG, "Delete stream id " << object->objectId());
parser.removeObject(object);
break;
@@ -1540,7 +1547,7 @@ 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");
parser.write(filenameOut);
+1 -1
View File
@@ -6,7 +6,7 @@ TARGETS=$(TARGET_BINARIES) launcher
MAN_PAGES=acsmdownloader adept_activate adept_remove adept_loan_mgt
CXXFLAGS=-Wall -fPIC -I$(ROOT)/include -fdata-sections -ffunction-sections
CXXFLAGS=-Wall -fPIC -I$(ROOT)/include -fmacro-prefix-map=$(ROOT)/= -fdata-sections -ffunction-sections
STATIC_DEP=
# LDFLAGS += -Wl,--gc-sections
+2 -3
View File
@@ -31,7 +31,6 @@
#include <iostream>
#include <algorithm>
#define _XOPEN_SOURCE 700
#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
@@ -355,7 +354,7 @@ static void usage(const char* cmd)
std::cout << " " << "-l|--list" << "\t\t" << "List all loaned books" << std::endl;
std::cout << " " << "-r|--return" << "\t\t" << "Return a loaned book" << std::endl;
std::cout << " " << "-d|--delete" << "\t\t" << "Delete a loan entry without returning it" << std::endl;
std::cout << " " << "-N|--no-notify" << "\t\t" << "Don't notify server, even if requested" << std::endl;
std::cout << " " << "-N|--no-notify" << "\t" << "Don't notify server, even if requested" << std::endl;
std::cout << " " << "-v|--verbose" << "\t\t" << "Increase verbosity, can be set multiple times" << std::endl;
std::cout << " " << "-V|--version" << "\t\t" << "Display libgourou version" << std::endl;
std::cout << " " << "-h|--help" << "\t\t" << "This help" << std::endl;
@@ -396,7 +395,7 @@ int main(int argc, char** argv)
{0, 0, 0, 0 }
};
c = getopt_long(argc, argv, "d:lr:D:vVh",
c = getopt_long(argc, argv, "d:lr:D:NvVh",
long_options, &option_index);
if (c == -1)
break;
+5 -1
View File
@@ -88,7 +88,11 @@ public:
filename = std::string(inputFile);
if (outputDir)
filename = std::string(outputDir) + "/" + filename;
{
char* basepath = strdup(inputFile);
filename = std::string(outputDir) + "/" + basename(basepath);
free(basepath);
}
}
if (endsWith(filename, ".epub"))
+3
View File
@@ -261,6 +261,9 @@ std::string DRMProcessorClientImpl::sendHTTPRequest(const std::string& URL, cons
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, list);
curl_easy_setopt(curl, CURLOPT_COOKIEJAR, cookiejar);
if (getenv("SSL_CERT_FILE") != NULL)
curl_easy_setopt(curl, CURLOPT_CAINFO, getenv("SSL_CERT_FILE"));
if (POSTData.size())
{
curl_easy_setopt(curl, CURLOPT_POST, 1L);