Skip to content

Instantly share code, notes, and snippets.

@vgmoose
Last active February 10, 2023 21:08
Show Gist options
  • Select an option

  • Save vgmoose/fcfebcfe04da30e7d2bd50f5d1a6bc7a to your computer and use it in GitHub Desktop.

Select an option

Save vgmoose/fcfebcfe04da30e7d2bd50f5d1a6bc7a to your computer and use it in GitHub Desktop.
How to remove DRM from ACSM files directly on the Remarkable 2 tablet (generate PDF or EPUB files), via the command line

This tutorial uses the following method to remove DRM from ebooks directly on the remarkable tablet (after installing toltec):

Download

If you don't want to bother self-compiling, for the armv7l remarkable 2, here is a prebuilt binary!

Usage

./knock-drm-removal [path to .acsm file]

Build Instructions

It relies on some software that is available on the internet archive, as well as using NixOS to build, which should have a platform independent installation. It also uses QEMU instead of cross compiling.

Dependencies (Ubuntu):

sudo apt-get update -q -y && sudo apt-get install -q -y qemu-system-aarch64 qemu-efi binfmt-support qemu-user-static

NixOS installation:

sh <(curl -L https://nixos.org/nix/install) --no-daemon

If you get an error, try re-running as a non-root user. You may have to create the /nix directory as root however: mkdir -m 0755 /nix && chown user /nix

After it finishes, log in again or run the command that it gives you to source new variables. For me, this command was: . /home/user/.nix-profile/etc/profile.d/nix.sh

wget "https://web.archive.org/web/20221010074002if_/https://codeload.github.com/BentonEdmondson/knock/zip/refs/heads/main"
unzip main
cd knock-main

Once in this folder, edit the flake.nix file, and replace: [ "x86_64-linux" "aarch64-linux" ] with [ "armv7l-linux" ], to target the Remarkable's CPU type. Then continue:

nix build --extra-experimental-features nix-command --extra-experimental-features flakes . --option system armv7l-linux --extra-platforms armv7l-linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment