Archive for the 'Android' Category

Removing Adobe DRM from Books

Sunday, May 10th, 2020

Digital Restrictions Management is an abomination. I try to avoid it, but ever so often you stumble upon something, and you need it in readable, unrestricted form. Turns out, the mechanisms for removing DRM are just as an unholy mess of outdated software and scripts for proprietary systems as the DRM systems themselves.

The first thing you get when stumbling upon Adobe DRM is an .acsm (Adobe Content Server Message) file. It’s an XML that tells Adobe Digital Editions (and Apps that implement it) where to download the data.

Apparently, there’s several versions of Adobe DRM, and you can enforce an earlier one with a downgrade attack, by using Adobe Digital Editions 2.01 for Windows, apparently still available from Adobe, as it’s the last version to run on Windows Vista and Windows 7.

And yes, you need to create an account at Adobe to use these.

I actually tried ot the newest one (4.5.11) as well. Installation is straightforward:

WINEPREFIX=~/.wine.ade4 winetricks corefonts dotnet40; \
WINEPREFIX=~/.wine.ade4 wine ADE_4.5_Installer.exe

According to winehq.org this should work, but upon trying to download anything with it, it returned E_ADEPT_DOCUMENT_TOO_SHORT.

ADE 2.01 is a bit trickier, it needs a 32bit wine prefix, and dotnet 3.5, servicepack 1. As 4.5.11 it needs corefonts too.

WINEARCH=win32 WINEPREFIX=~/.wine.ade2 winetricks corefonts dotnet35sp1; \
WINEPREFIX=~/.wine.ade2 wine ADE_2.0_Installer.exe

Again according to winehq.org this should work as well, but also returned E_ADEPT_DOCUMENT_TOO_SHORT, which might point to some network-problem, winbind-error, crypto-library too new or somesuch. In any case, you can’t find anything useful by searching for the error.

So I’ve been looking for other apps, some open source on github or somesuch, that could use .acsm files for download. And I found at least one: Aldiko, on Android. It’s apparently also abandoned, but it still can be found on Google Play. I got myself Aldiko Classic 3.1.3.

Upon loading a .acsm File in Aldiko (from anywhere, basically, I copied some I downloaded with the Browser on my Workstation into /sdcard/Download), you get prompted to enter your Adobe acocunt; after that it downloads the books to /sdcard/eBooks. And you can copy over these to any device that has the keys for your adobe account. Like your wine-prefix.

I initially tried to get DeDRM working standalone or with my Calibre on Linux, but it turned out this thing is a collection of dozens of scripts, which all demand python 2.7. Which is EOL, and which no sane person should use aynmore. As you can see from the pull-requests and issues, there’s some efforts of making these work on contemporary python, but these went nowhere so far (“Python tests (2.7) failed” — duh!).

Also, as it turned out, after I fixed one of the scripts to run with python 3, these things rely on the existence of ADE on your system; and you either need to somehow convert registry-entries or get files from MacOS to get the device key and the licence key. Which then are pumped through some assembler(!) to get a useful .der file. All in all, too complicated,

What I did instead was to install python-2.7.msi, pycrypto-2.6.win32-py2.7.exe and calibre-3.48.0.msi into the wine-prefix and run from there:

WINEPREFIX=~/.wine.ade2 wine msiexec /i python-2.7.msi; \
WINEPREFIX=~/.wine.ade2 wine pycrypto-2.6.win32-py2.7.exe; \
WINEPREFIX=~/.wine.ade2 wine msiexec /i calibre-3.48.0.msi

Within calibre, finally, in “preferences -> Plug-ins -> Load Plugin from file” I installed DeDRM_Plugin.zip from DeDRM_tools_6.7.0.zip.

The books downloaded with Aldiko on Android and copied over can now be added to the collection in calibre, and have their DRM removed automatically.

Android on LG GW620 – OpenEve

Friday, May 20th, 2011

After having tried OpenEtna 6.3-rc7 (which is essentially Cyanogen-mod 6.X (Froyo) modified for the LG Eve) and constantly having problems because of some weird Bugs I decided to install some other version. Besides, OpenEtna appears rather dormant.

Luckily I found OpenEve, which is a patched Cynogen-mod 7.x, which in turn is a patched Android 2.3.4 (Gingerbread), snapshot 20110514a. Which happens to work nicely.

Initially I had some problems with the keyboard special keys not working correctly, but I managed to find a workaround; and the maintainer is actually fixing bugs and commenting in the bugtracker, as opposed to the OpenEtna-project which seems to have died.

The keyboard-issues might even stem from my earlier OpenEtna-settings, because I did not flush them. But all the other settings posed no problems, so it’s kinda nice to not have to restore backups.

Most important binaries are there, like a bash, busybox and dropbear (altough I still have to find out how to turn on dropbear). Midnight Commander is missing and I still didn’t manage to compile it, but I found a binary which somehow works, and can be disciplined with some tinkering (something which probably gets its own blog-post).

Sadly OpenEve’s development pace isn’t exactly fast, but you get new releases every few months.

Unpack, Change and Repack Android Apps

Sunday, February 27th, 2011

Some time ago, I read Lock down your Android APK permissions by benn from Intrepidus Group.

I decided to automate the whole procedure, at least the unpacking, signing and repacking. Each app has to have it’s own key (lest the apps signed with the same key can access each others ressources!) which was the thing that most needed automation.

So I wrote some shell-scripts. The scripts are not only useful for changing the permissions of an app from any source (unpack, edit AndroidManifest.xml, resign), but also for android developers themselves. it’s much easier to manage keys and sign different apps with them.

So here they are:

  • android-unpack Stupid script to decode .apk-files, all of those in a directory, actually.
  • android-resign Script to pack .apk-files, and sign them. Each project with it’s own key.

Of course, if you re-sign foreign apps with your own key, they won’t be the same ones as on the Android Market, and thus not automatically upgradeable and will not use the same configuration.