Tag Archive for android

Grabbing Amazon books for reformatting, pleasure

Creative Commons euphoria

I was referred to a book called Storyteller Uprising earlier today. The book’s about page intrigued me: it’s about how people’s increasing distrust of the legacy media is leading them to create new media.

The book’s website helpfully tells me how to get it:

  • Buy the paper hardcopy through Amazon
  • Buy the paper hardcopy from the university he works for
  • Buy the paper hardcopy from a web store that I was previously unaware of
  • Acquire the digital Kindle version from Amazon

At the bottom of the list, it says that the book is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs license. He’s distributing it for free, in other words. To quote the license:

You are free: to Share — to copy, distribute and transmit the work
Under the following conditions:
Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
Noncommercial — You may not use this work for commercial purposes.
No Derivative Works — You may not alter, transform, or build upon this work.

Since the author is distributing it under those terms, I should be able to find it for free somewhere online, download it, read it and if I like it, buy it.

Hey, it worked for Cory Doctorow and <a href="http://www.antipope.org/"Charles Stross. If I like Storyteller Uprising, I might buy a hard copy of it.

Enter Digital Rights Management

I can’t find the full text of Storyteller Uprising online, though. Having Creative-Commons-licensed material be unavailable feels wrong somehow, like having to pay for access to federal court records.

It’s free on the Kindle today, so I go to Amazon’s store and open it in the Amazon Cloud Reader, a in-browser app that supposedly caches your downloads for offline reading. I want to pull it out of my browser’s cache, reformat it to fit on my rooted Nook Color and read it there at my leisure.

Fun fact: Cloud Reader transmits the book’s contents as a series of encrypted strings inside JSONP containers. Here’s a sample of what’s in gz_frag1.jsonp:

loadFragment1({"fragmentData":"encrypted_text","fragmentMetadata":{"compression":1,"encryption":1,"id":1},"imageData":null});

There are 76 book fragments in this novel, each one with several tens of kilobytes of encrypted data taking the place of encrypted_text in the above code. There’s also a gz_fragmap.jsonp and a gz_skeleton0.jsonp, which appear to provide structure and decoding information to the Cloud Reader. The former helpfully mentions at the end that the book is in the mobi7 format.

Discouraged, I consider loading the web app on my Nook. The web app is clunky, though, and doesn’t fit on my Nook, even though my Nook is running Ice Cream Sandwich.

(Side lesson: Cloud Reader is providing me with the plaintext and ciphertext of the book, the decryption engine and the decryption key. In theory, I have everything I need to not only decrypt the book but to create an automated Cloud Reader download tool. The only thing lacking is knowledge of JavaScript, time, effort, and a willingness to violate the Kindle ToS. For more on this topic, read this Doctorow speech.)

The web approach has failed me. What to try next?

Using alternate platforms

I have a Nook Color running a development build of Cyanogen Mod 9, a custom version of Android’s latest version Ice Cream Sandwich.

Ice Cream Sandwich isn’t written to allow users access to certain types of files. These forbidden files include core operating system files and password databases, but they also include things like apps and app-secured files. Users can’t access those files. Amazon’s Kindle application does not take advantage of those security protections.

Instead, Storyteller Uprising was stored on the unprotected SD card, in the folder Android/data/com.amazon.kindle. I opened it with the free, community-developed e-book program Calibre. From Calibre I am able to transcode it as I will.

What’s the upside of this? Free book, now free of DRM shackles.

Success.

Legal Note

Hanson Hosein, the author of Storyteller Uprising, has released it under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License. Transcoding the work in question is allowed under section 3 of the CC-BY-NC-ND license applied by the author, specifically “The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats…”

Installing CM9 on Nook Color microSD

An updated version of this post is available here.

Now updated with gapps instructions.

This aims to be a simple walkthrough for creating a bootable CyanogenMod 9 microSD card for the Nook Color, though it does assume familiarity with disk images, partitions, running text editors with administrative permissions and verygreen’s bootable SD card image.

  1. Acquire a microSD card compatible with verygreen’s size-agnostic image. Charge your Nook.
  2. Download generic-sdcard-v1.3.img.gzupdate-cm-9.0-0-encore-emmc-sneakpeek1-fullofbugs.zip, and the latest CM9 nightly from Samiam303.
  3. Write verygreen’s size-agnostic microSD image on your microSD card, following the instructions given by verygreen in the linked xda-developers thread. Do not put any CM7 image on the card.
  4. After you have written the image to you microSD card, eject the card and plug it back in. You should see a partition named ‘boot’.
  5. Put update-cm-9.0-0-encore-emmc-sneakpeek1-fullofbugs.zip into the folder labeled ‘boot’. Do not unzip the file. Safely eject the card from your computer and insert it into your Nook.
  6. Turn your Nook on and wait for verygreen’s installer to work its magic. When the Nook turns itself off, turn it on to make sure that everything works.
  7. If everything works, power your Nook off using the power button. Remove the microSD card from the Nook and insert it into your computer.
  8. Four partitions will appear. Put update-encore-YYYYMMDD.zip from Samiam303′s repository in the ‘boot’ partition. Do not unzip the file. Safely unmount the microSD card and insert it into your Nook.
  9. Read this step in its entirety before completing it. Boot your Nook into recovery mode by pressing the power button until the screen flashes, releasing the power button, then holding the power and ’n’ buttons until the message ‘Booting into Recovery…’ appears beneath the Cyanogen logo. If it fails to boot into recovery, wait for the nook to boot fully before powering it off and trying again.
  10. Once the nightly is installed, check that you are able to view wireless networks. Do not worry if you cannot connect. This will be fixed later. Power your Nook off and remove the microSD card. Insert the microSD card into  your computer.
  11. In the partition that has the ‘etc’ folder, go to etc/wifi/. Open ‘tiwlan.ini’ using a text editor running with administrative permissions. Find ‘WifiAdhoc = 1′ and change it to ‘WifiAdhoc = 0′. Save the file and exit the text editor. Reopen the file to check that it the ’0′ was saved. If it was not saved, then you need to figure out how to run a text editor in administrative mode. Credit for this fix goes to EAK128 on the XDA forums. This will allow you to connect to WPA- and WPA2-secured networks.
  12. Once it is correctly saved, safely eject the card and insert it in your Nook Color. Power on your Nook Color. Connect to WiFi.
  13.  If you want to install Google Apps, see sam’s readme.txt post in his CM9 build repository. You will have to rename gapps-ics-*.zip to gapps-gb-*.zip becauseverygreen hardcoded the updater to look for a file with ‘gb’ in it.
  14. If you have apps backed up as .apk from CM7, you may be able to install them with ‘adb install’. ADB access is not enabled by default. You must enable it by going into Settings > Developer options and checking ‘Android debugging’.
Simple, eh?

Specific Credits: