Lorenzo Villani

(╯°□°)╯︵ ┻━┻

Amazon Fire 5th Gen: Road To A Pure Google Experience

Dec 7, 2015

Update: The method described in this article is no longer valid due to recent bootloader updates. I have since removed my code from GitHub. If you have already updated FireOS to the latest version you won’t be able to root it as easily as before. If you have an older FireOS version, your best bet is to install a Cyanogenmod port.


You know that times have changed when you can get an Android tablet that actually works for just 50€. When Amazon launched the 5th generation Fire Tablet I knew that I had to get one.

Tablets are great consuming devices and this was the right time to get rid of a bulky iPad Air, get my Nexus 7 2013 back that I lent to a family member and replace it with a modest tablet that covers the basics and works well enough for her use case.

Me and a bunch of co-workers took the plunge and bought into Amazon’s crazy “get six tablets for 50€ each” discount pack. There you have it: the perfect recipe for a weekend of tinkering.

When I turned it on I was amazed that, while it was definitely not a premium device, the hardware actually felt solid in the hand.

Design-wise and spec-wise it reminded me of a 2012 Nexus 7 made slightly faster by updated hardware and not penalized by the slow-as-molasses eMMC that plagued Asus’ tablets nearly four years ago. There are some differences made in name of price, such as a lower 1024x600 screen instead of a 1280x800 one, but hey, for 50€ what did I expect anyway?

One huge drawback of all Fire devices in general is that they run Amazon’s fork of Android: Fire OS. Being a fork designed to be incompatible with Android compatibility standards, Amazon doesn’t include the Play Store, Play Services or any Google application. They are contractually forbidden from doing so. This means no Gmail, YouTube, Maps, and no Chromecast support. 1

I was faced with a dilemma: how can I get this incredibly cheap piece of hardware to run the incredibly good Google apps?

After a short trip to XDA-Developers’ forums I had the answer: I had to gain root on the device. Thankfully I didn’t have to find an exploit to escalate privileges.

In fact, the device comes with signed boot and recovery partitions, but the boot loader still allows you to upload a recovery image to the device’s RAM and run it from there. Which means that once you get a compatible recovery image you can then mount the system partition in read-write mode and do as you please.

Most automated scripts on XDA-Developers, however, are targeted at Windows users and come with sketchy ADB drivers and unknown binaries. While I have a Windows machine, I didn’t want to let that stuff touch my computer.

Since I’ve been completely out of the Android scene for the last two years, I had to update my knowledge on custom ROMs, recoveries, etc. Then I started to piece out a simple shell script that downloads everything needed from their original places and applies that to the device.

The end result is available at <https://github.com/lvillani/amazon-fire-tablet-pge> with some instructions to get you started. I've developed and tested the script only on OS X El Capitan but it should work also on the latest Ubuntu LTS and maybe some other Linux distribution.
  1. In fact, Amazon is not a member of the Open Handset Alliance and is contractually forbidden from adding Google stuff to its own distribution. OHA members are forbidden from selling devices with incompatible Android forks if they want to ship the Play Store or any Google application to their customer. It’s an all-or-nothing proposition. One that conditions which hardware manufacturers Amazon can choose to build its tablets. In this case they had to go to Quanta Computer, since they are not an OHA member. 

3-2-1, It's Time to Backup

Nov 4, 2015

November is the right time to define your New Year’s resolutions. There is nothing better than gifting you and your relatives an effective, yet simple, backup strategy. Start now before it’s too late. There’s nothing worse than waking up on the 1st of January and learning with horror that all of your data has vanished into thin air.

The simplest and most effective guideline to keep in mind is the so called “3-2-1 Backup Rule”:

  • At least three copies of every file you care about;
  • In two different formats;
  • With one of them off-site.

Keeping three copies of a files means keeping them in different places. So, mashing CTRL+C and CTRL+V on your computer keyboard does not count as a backup. Likewise, keeping your files in a secondary drive permanently attached to your computer doesn’t qualify as backup, either. You would still loose it all should someone steal your machine. The file you have on your work computer, however, counts as the first copy. What I call the “master copy”.

But why keep different copies? Why three? The answer to the first question is redundancy: you don’t want a single event to wipe out all of your memories and work files. The answer to the latter is: the more copies you have, the merrier. Three strikes a balance between having too few copies and being hard to manage.

You will also want to keep your backup in two different formats so that you are not subject to weaknesses of either of them. For example, magnetic hard drives, leave your data exposed to EMPs and mechanical deficiencies in the device itself. A good alternative is to leverage the SSD in your computer, a magnetic hard drive and a cloud storage service like Amazon Glacier or Google Nearline.

Last but not least, having one off-site backup will keep you safe in the event your house burns down or gets flooded by an hurricane.

Following the 3-2-1 rule will get you nowhere unless you also implement a good backup strategy. While the backup rule described before easily applies to computers, mobile devices and stuff stored in cloud services is entirely another matter.

There is a widespread misconception that data in the cloud is “safe” and that we don’t need to care for it or back it up explicitly, since the provider will usually have a backup system already in place. While that’s true, it’s designed to protect the provider from catastrophes on its own premises (e.g.: loosing a server, lightning strikes, etc). It won’t protect you from accidentally deleting stuff, loosing access keys or being denied access to the service. Having a safety net in this case especially important with companies like Google that have non-existing customer support.

One way you can balance that is to siphon all cloud data back to your computer so that it gets automatically propagated to all your other backup media. I do that with Gmail, Trello, RunKeeper, etc. I also pull my Mom’s emails and pictures to my computer so that they get backup up daily.

Diagram

The other important thing is that all data is encrypted at rest. All destinations only receive opaque blobs of data that can’t be opened without a decryption key. This makes restores a bit more cumbersome, since they involve a specialized tool that may not be readily available, but it greatly simplifies off-site backups since I can just sync the encrypted data without having to worry about third parties peeking into my data.

Further Reading

Apple Watch, The three months review

Oct 8, 2015

Countless words have been spent on reviewing the Apple Watch, I won’t pour more words to describe the hardware and the software. What follows is a collection of thoughts about the product.

I just “happened” to be around the Apple Store on day one (that was in the last days of June here in Italy) with the intention to turn around should a huge mass of people be there waiting to spend their hard-earned cash on “The Watch”.

But… lo-and-behold, almost nobody was there!

There were just around ten people waiting in queue and, since I didn’t want to wait, I scheduled a pickup later that day. After that, the web form went dark, telling people that no more stock was available. Phew.

By lunch I had the watch on my wrist, fully set-up and I began playing with it. Except that… there isn’t much to play with in the first place. The device doesn’t do much more than tracking activity and displaying notifications. For that, it’s excellent. For anything else it fades in the background. Unless you raise the wrist, it’s just like a regular watch with a screen that it’s oddly turned off.

Power management is probably the biggest issue of this first-gen product and Apple is perfectly aware of that, since they wouldn’t keep the screen off most of the time otherwise. Battery lasts around one day. One day and a half if you don’t use it that much. This means that unless you strategically schedule a recharge, you won’t be able to use it for, e.g., sleep tracking.

By doing some planning 1 you can, however, wear the watch during the night, with the added benefits that you can then enable silent alarms, so that the watch taps on your wrist instead of making an unpleasant audible sound that has the potential to wake up your neighbors.

I really, really like the fact that I can turn off all sounds and have the Taptic Engine 2 on the watch gently, and discretely, buzz on my wrist to notify me that I got an important message (and I know it is important because I generally turn off notifications for all apps except for email, messages, work and family IM).

Bluetooth range is decent and that gives me the freedom to leave the phone on my desk, while still being able to receive notifications while around the office. In some cases, I can even quickly respond right from the notification, except WhatsApp, since it hasn’t been updated to take advantage of this yet.

Another thing I like is activity tracking, which is probably the main reason I bought the Apple Watch in the first place.

The Activity app shows you three circular rings. The outer red one counts the active calories you have spent during the day and is the only one you have control of. The middle ringer is green and completes once you complete at least thirty minutes of light activity, such as a brisk walk. The inner circle requires you to move for at least one minute during each of at least twelve hours during the day.

Apple designed the thing in such a way that you feel compelled to complete all three rings every single day. It also gives you awards from time to time to keep you motivated. I am way more active than before and I lost a fair bit of weight and I guess I have to thank the Watch for that.

Another issue I found with the watch is that third party applications are really slow to load. When they load they seem to often have trouble communicating with the phone (remember that most applications are just thin shells that relay commands to the phone to perform any business logic). Even when they work properly, I found little reason to use them anyway (besides the Overcast app, which I use a ton).

As a developer I found the lack of reliability delivering commands to the phone to be maddening. Thankfully we have watchOS 2.0 now, that allows for applications to run on the watch and perform more functions over there, that should improve the situation quite a bit.

There are no killer apps for the apple watch and there is no strong reason to prefer it to other smart watches. The only discriminant is your phone. If you have an iPhone: get an Apple Watch, if you have an Android phone, get an Android Wear watch. Many higher ends Android Wear watches have an heart rate monitor and match (or slightly exceed) most of Apple Watch features (except for its user interface) but they all do mostly the same things: notifications and fitness tracking.

For a first gen product the Apple Watch is good, not exceptional, and it doesn’t do anything that your phone doesn’t. If you don’t mind getting your phone out of the pocket when a notification arrives, or don’t care about all-day fitness tracking, there’s really no reason to get it at the moment. It is an expensive toy that will surely trigger buyer’s remorse unless you are OK with the price and the lack of distinctive features.

  1. To wear it all day, and be useful to perform sleep tracking, you should follow David Smiths’ advice on an unobtrusive recharge pattern that allows for that. 

  2. The Taptic Engine on my watch is, however, fairly weak. Even on its strongest setting. I’m not sure if it’s a problem with my unit or it’s intended to be like that.