From e188e01ae3558d5d97a41ee400bb80ff9a22d661 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 30 Jan 2015 23:02:18 +0100 Subject: [PATCH] how to extract some stuff Signed-off-by: Nico Schottelius --- ...on-ebooks-from-the-android-kindle-app.mdwn | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 blog/how-to-extract-your-amazon-ebooks-from-the-android-kindle-app.mdwn diff --git a/blog/how-to-extract-your-amazon-ebooks-from-the-android-kindle-app.mdwn b/blog/how-to-extract-your-amazon-ebooks-from-the-android-kindle-app.mdwn new file mode 100644 index 00000000..0e836766 --- /dev/null +++ b/blog/how-to-extract-your-amazon-ebooks-from-the-android-kindle-app.mdwn @@ -0,0 +1,73 @@ +[[!meta title="How to extract your Amazon ebooks from the Android Kindle App"]] + +## TL;DR + +The ebooks of the Amazon Kindle app can be found on your +Android phone in PRC format below the folder +***/data/media/0/Android/data/com.amazon.kindle/files/***. + +## Download the books + +To be able to extract your books from your Android phone, you need to +synchronise the books first, so they are available on your device. + +To ensure they are local. turn of all network connections +(wifi, mobile data) and try to read them. + +## Finding the files + +At first I guessed the files I was looking for may be +ending in ***.azw***. Looking for these files, however +did not reveal any file. + +My second guess was to look for amazon files or folder +named amazon: + + % find / -name \*amazon\* 2>/dev/null + +I found **/data/data/com.amazon.kindle**, with the following content: + + % ls + app_com.amazon.device.syncHIGH app_metricsNORMAL databases + app_com.amazon.device.syncNORMAL app_web_cache files + app_dex app_web_database lib + app_dexopt app_webview shared_prefs + app_metricsHIGH cache + +Looking for books in this directory wasn't successful. +However, the databases directory looked interesting. + + % cd databases + % grep -ri mybookname * + Binary file databases/kindle_library.db matches + Binary file databases/kindle_library.db-journal matches + +I used sqlite to have a look at the database: + + % sqlite3 kindle_library.db + sqlite> .schema + ... + +This revealed one interesting table named ***LocalContent***. +Looking at it closer: + + sqlite> select * from LocalContent; + +This revealed the emulated path +***/storage/emulated/0/Android/data/com.amazon.kindle/files/*** +and referenced ***.prc*** files. + +I looked for them in the filesystem using ... + + % find / -name \*.prc 2>/dev/null + +... and found my books! + +To extract the books to your computer, you can use any file copy program. +The ***rsync*** utility however is suited for it very well, as it can +(re-)sychronise the whole folder: + + % rsync -av /data/media/0/Android/data/com.amazon.kindle/files/ mycomputer:mybooks/ + + +[[!tag amazon android kindle ebook hack]]