forked from soutade/libgourou
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f01bf9e837 | |||
| c57aba8061 | |||
| 33ea9e7d65 | |||
| dc15fc7197 |
@@ -40,7 +40,7 @@
|
||||
#define ACS_SERVER "http://adeactivate.adobe.com/adept"
|
||||
#endif
|
||||
|
||||
#define LIBGOUROU_VERSION "0.4"
|
||||
#define LIBGOUROU_VERSION "0.4.1"
|
||||
|
||||
namespace gourou
|
||||
{
|
||||
|
||||
@@ -68,6 +68,7 @@ namespace gourou
|
||||
|
||||
enum DOWNLOAD_ERROR {
|
||||
DW_NO_ITEM = 0x1200,
|
||||
DW_NO_EBX_HANDLER,
|
||||
};
|
||||
|
||||
enum SIGNIN_ERROR {
|
||||
@@ -293,7 +294,7 @@ namespace gourou
|
||||
*/
|
||||
static inline void writeFile(std::string path, ByteArray& data)
|
||||
{
|
||||
writeFile(path, data.data(), data.length()-1);
|
||||
writeFile(path, data.data(), data.length());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,14 +37,14 @@ namespace gourou
|
||||
ByteArray::ByteArray(const char* data, int length)
|
||||
{
|
||||
if (length == -1)
|
||||
length = strlen(data) + 1;
|
||||
length = strlen(data);
|
||||
|
||||
initData((const unsigned char*)data, (unsigned int) length);
|
||||
}
|
||||
|
||||
ByteArray::ByteArray(const std::string& str)
|
||||
{
|
||||
initData((unsigned char*)str.c_str(), (unsigned int)str.length() + 1);
|
||||
initData((unsigned char*)str.c_str(), (unsigned int)str.length());
|
||||
}
|
||||
|
||||
void ByteArray::initData(const unsigned char* data, unsigned int length)
|
||||
|
||||
@@ -611,6 +611,7 @@ namespace gourou
|
||||
else if (res == PDF)
|
||||
{
|
||||
uPDFParser::Parser parser;
|
||||
bool EBXHandlerFound = false;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -631,6 +632,7 @@ namespace gourou
|
||||
// Update EBX_HANDLER with rights
|
||||
if ((*it)->hasKey("Filter") && (**it)["Filter"]->str() == "/EBX_HANDLER")
|
||||
{
|
||||
EBXHandlerFound = true;
|
||||
uPDFParser::Object* ebx = (*it)->clone();
|
||||
(*ebx)["ADEPT_ID"] = new uPDFParser::String(item->getResource());
|
||||
(*ebx)["EBX_BOOKID"] = new uPDFParser::String(item->getResource());
|
||||
@@ -642,7 +644,12 @@ namespace gourou
|
||||
}
|
||||
}
|
||||
|
||||
parser.write(path, true);
|
||||
if (EBXHandlerFound)
|
||||
parser.write(path, true);
|
||||
else
|
||||
{
|
||||
EXCEPTION(DW_NO_EBX_HANDLER, "EBX_HANDLER not found");
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
@@ -907,7 +914,7 @@ namespace gourou
|
||||
|
||||
ByteArray privateLicenseKey = ByteArray::fromBase64(user->getPrivateLicenseKey());
|
||||
/* In adobekey.py, we get base64 decoded data [26:] */
|
||||
write(fd, privateLicenseKey.data()+26, privateLicenseKey.length()-1-26);
|
||||
write(fd, privateLicenseKey.data()+26, privateLicenseKey.length()-26);
|
||||
|
||||
close(fd);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
TARGETS=acsmdownloader adept_activate
|
||||
|
||||
CXXFLAGS=-Wall `pkg-config --cflags Qt5Core Qt5Network` -fPIC -I$(ROOT)/include -I$(ROOT)/lib/pugixml/src/
|
||||
LDFLAGS=`pkg-config --libs Qt5Core Qt5Network` -L$(ROOT) -lcrypto -lzip -lz
|
||||
ifneq ($(STATIC_UTILS),)
|
||||
LDFLAGS=`pkg-config --libs Qt5Core Qt5Network` -L$(ROOT) $(ROOT)/libgourou.a -lcrypto -lzip
|
||||
LDFLAGS += $(ROOT)/libgourou.a
|
||||
else
|
||||
LDFLAGS=`pkg-config --libs Qt5Core Qt5Network` -L$(ROOT) -lgourou -lcrypto -lzip -lz
|
||||
LDFLAGS += -lgourou
|
||||
endif
|
||||
|
||||
ifneq ($(DEBUG),)
|
||||
|
||||
@@ -79,6 +79,8 @@ public:
|
||||
std::string filename;
|
||||
if (!outputFile)
|
||||
filename = std::string("Adobe_PrivateLicenseKey--") + user->getUsername() + ".der";
|
||||
else
|
||||
filename = outputFile;
|
||||
|
||||
if (outputDir)
|
||||
{
|
||||
@@ -173,7 +175,7 @@ static void usage(const char* cmd)
|
||||
{
|
||||
std::cout << "Download EPUB file from ACSM request file" << std::endl;
|
||||
|
||||
std::cout << "Usage: " << cmd << " [(-d|--device-file) device.xml] [(-a|--activation-file) activation.xml] [(-s|--device-key-file) devicesalt] [(-O|--output-dir) dir] [(-o|--output-file) output(.epub|.pdf|.der)] [(-v|--verbose)] [(-h|--help)] (-f|--acsm-file) file.acsm|(-e|--export-private-key)" << std::endl << std::endl;
|
||||
std::cout << "Usage: " << cmd << " [(-d|--device-file) device.xml] [(-a|--activation-file) activation.xml] [(-k|--device-key-file) devicesalt] [(-O|--output-dir) dir] [(-o|--output-file) output(.epub|.pdf|.der)] [(-v|--verbose)] [(-h|--help)] (-f|--acsm-file) file.acsm|(-e|--export-private-key)" << std::endl << std::endl;
|
||||
|
||||
std::cout << " " << "-d|--device-file" << "\t" << "device.xml file from eReader" << std::endl;
|
||||
std::cout << " " << "-a|--activation-file" << "\t" << "activation.xml file from eReader" << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user