Contact

Subscribe via Email

Subscribe via RSS/JSON

Categories

Creative Commons Attribution 4.0 International License
© Rakhesh Sasidharan

Elsewhere

Steps to root OnePlus One (Bacon)

Not a comprehensive post, just a note to myself on what I need to do every time the device is updated and loses root + recovery (though the latter can be avoided by disabling the option to update recovery during system upgrades in Developer Options).

  1. Get the Bacon Root Toolkit (BRT), cousin of the wonderful Nexus Root Toolkit.
  2. Enable ADB on the device (it’s under Developer Options).
  3. Connect device, confirm BRT has detected it as an ADB device.
    1. This doesn’t always happen. In such cases (a) try a different port, (b) try a different cable, and (c) check that the ADB device appears in Device Manager. If it does not, reinstall the Google drivers using BRT.
  4. Flash Custom Recovery (my choice is TWRP) from BRT. This is needed to root the device. Default Cyanogen Recovery can’t do this. This requires a couple of reboots. 
  5. Reboot into the Recovery and exit. I use TWRP, and when existing it checks whether the device is rooted and offers to root it. Go ahead and do that.
  6. SuperSU (and SuperSU Pro) are what one uses to manage root. (Apparently CM 12 allows one to do this using the in-built Privacy Guard but I couldn’t find any options for that. Another option is Superuser, but that doesn’t work on Android 5.0 yet I think). 
    1. CM 12 also apparently has an option to enable/ disable root under Developer Options but I couldn’t find that on my device (before or after rooting).

That’s it! One of the reasons I went with OnePlus One and Cyanogen is the hope that the device will stay rooted after updates, but that isn’t the case. I guess this is so the OS and stay compliant with Google. So each time I do a major update I need to repeat these steps. This doesn’t happen often so by the time I get around to doing this I have usually forgotten what I did last time around. Hopefully I can come back and refer to this post the next time!

OnePlus One first impressions

Big phone! :) I thought the BlackBerry Z3 was big, this is bigger! But not in an uncomfortable way. Maybe it’s because of the Android UI, I don’t find the size that bad. In contrast when I tested the iPhone 6 Plus at a shop the other day I was put off by the size (mind you that could also be because all these shop demo pieces have an attachment at the back that pulls the phone down). 

Performance is good though there are occasional lags. Not that I am complaining – I mean, for this price, wow! Just a bit surprising that a high spec Android phone still isn’t as buttery smooth as a last year iPhone (the iPhone 5S). The OnePlus One has 3 GB RAM and a 2.5GHz CPU I believe. In contrast the iPhone 5S has 1 GB RAM  and a 1.3 GHz CPU. Sure there maybe other differences between the two which I am not aware of, still I sort of expected the two to be on par at least. I think it all comes down to the fact that Android uses Java and so requires more RAM, whereas iOS is simply more efficient. Anyhow, like I said it’s not a big deal and it’s only an occasional lag, so I am not complaining merely mentioning. 

The camera seems to be fine. But launching it seems to take 5-6 seconds, and that I don’t like! Once launched it clicks photos fast enough though. And I can set the size to 9.7 MP to click 16:9 resolution widescreen photos. That’s cool!

I love the back of the phone. I absolutely love it! I got the Sandstone Black version and the back has this rough texture sort of thing. I love it because that gives me a firm feel of the phone. In fact, maybe that’s why the large size doesn’t affect me much – the phone feels more stable in my hand due to the material I think. I love it!

The back isn’t removable. So there’s no removable battery, no microSD slot. There’s a slot on the side for the SIM tray. The device comes with both a micro-SIM and nano-SIM tray! So I could put my iPhone 5S SIM into this. That’s very thoughtful of OnePlus to support both. (Disclosure: It looks like a nano-SIM tray. And I checked Google and others too report it as a nano-SIM tray. So I am guessing it is a nano-SIM tray. I haven’t actually put my nano-SIM into it yet. :))

What else? CyanogenMod is good. Already got a couple of updates since yesterday. And I like being able to tweak bits and pieces. The phone comes with hardware keys for the navigation panel – not physical click type keys, but LED keys that light up. That’s cool because the keys don’t take up screen space and are below the screen. CyanogenMod lets you disable these and use the regular Android soft-keys. CyanogenMod also lets you customize what long press, single press, double tap, etc does to these keys (not all actions are available to all keys). I like that. By default the key that one usually uses for the app switcher – like on Nexus phones – doesn’t behave like that. It behave like the open/ close menu button we have on Samsung phones and such, so I remapped that to the app switcher and set long press to open / close the menu.

The lock screen too can be customized. And the keys can be modified to launch the torch or play music etc. For instance, I can double tap the screen to wake it up. Or long press the home key to put it back to sleep. 

I am trying the Yahoo! Aviate launcher on this. Once upon a time I was (still am) a huge fan of the Nova Launcher. Then I started using Action Launcher on my Nexus 7 tablet and slowly got using that on the Galaxy Nexus phone. I started off with Action Launcher on the OnePlus One but then thought of trying new launchers and so Aviate it is now. Spent a little bit of the morning customizing it to my liking. 

That’s it so far I think! Once again, I am pleased with the big screen size surprisingly! Never thought I’d like it. Who knows, maybe I’ll do more InstaPaper reading on this phone. 

Update: Turns out Aviate doesn’t do notification badges for non-default apps such as WhatsApp. Neither does Action launcher. I don’t mind these on a tablet as I don’t use WhatApp etc there. So I am with Nova launcher now. That has a plugin which does WhatsApp (and experimentally all other apps by monitoring the notification area). I am also using Fleksy as my keyboard now. I had forgotten how crappy the default Android keyboard is. Not only is it ugly, I keep making typos with it. Fleksy is awesome! :) Good themes too. Initially I was wary about using a 3rd party toolbar and them being able to snoop my private info, but soon I got over it. Had to! It’s all about trust after all. I am in a way trusting Google/ CyanogenMod/ OnePlus to not snoop with the existing keyboard, so why not trust Fleksy too. 

CyanogenMod with ParanoidAndroid GApps

If you are using the CyanogenMod firmware instead of your phone’s stock firmware, I’d suggest using GApps (Google Apps) from the Paranoid Android project.

There’s two advantages to using the PA Gapps:

  1. Unlike the CM GApps, the PA GApps has all the Google Apps that come on Nexus devices by default. The CM GApps, for instance, does not include the PhotoSphere version of the Camera – which is how I stumbled upon the PA GApps in the first place. I am a fan of most Google Apps so I like to have all the stock apps in whatever custom ROM I use.
  2. One could potentially install a minimal version of the GApps and then download the additional apps from the Play Store. But this has the disadvantage in that the downloaded apps are installed to the data partition of the phone leaving less space for your data.

Nowadays I use the CM 10.2 nightlies along with the PA GApps. I am impressed with CM. It seems to be a conservative ROM, focusing on stability and patiently introducing new features, unlike PA which is more bleeding edge. I found PA slower too on my Galaxy Nexus phone, and I didn’t like Halo add-on either. Too confusing. Thanks goodness the CM developers too feel the same so Halo won’t be making an appearance in CM any time soon.

CyanogenMod includes an updater too. For some reason that updater didn’t work today – maybe it’s something to do with the fact that CM has now formed a company and possibly did some some changes to their update mechanism. It was working fine up to last week, which is when I last updated my phone; but when I tried today it would keep looping while searching for updates. (Tried this on both the Galaxy Nexus and Nexus 7 – same results). Not a biggie – I downloaded the latest nightly manually and updated. Post update it does not loop when searching for updates, so looks like the new nightly is fixed.

Even if you don’t use the CM updater you can download the nightly manually, reboot into recovery, and flash it. But it’s more convenient having the updater do the work for you. You can also skip the CM updater and use ROM Manager or Goo Manager. I used ROM Manager today to flash the downloaded nightly – it is neat in that along with flashing the new ROM it offers to backup the existing one. Useful in case the updated ROM has any issues.

My workflow for updating the ROM regularly is to (1) check for updates and download, (2) take a backup of the existing ROM (needs a reboot and you can either do it via apps such as ROM Manager or reboot into a custom recovery such as TWRP or Clockwork Mod), (3) flash the updated ROM. No need to download a GApps update – that happens automatically for each individual app via the Play Store.

Before running CM 10.2, I was a Carbon ROM user. That’s a good ROM. No slowness like PA. I was on Carbon ROM 1.7 for many months, then upgraded to 1.8 but didn’t take a backup before updating. Something wen’t wrong post update because the phone app kept crashing and so the phone was unusable. I got it working by erasing the user data, but once I did that I thought of trying other ROMs and checked out PA and CM. Must try the Carbon ROM 4.3 nightlies sometime. Carbon ROM includes Goo Manager – that’s what you can use for getting newer versions of the ROM. Goo Manager can be configured to automatically check for updates too.

Today I changed the kernel on my Galaxy Nexus to leankernel. It’s a minimalistic kernel – good for battery life and lean & fast – and I had read good reviews of it somewhere. Installing the kernel is pretty easy: just download the kernel (it’s a zip file) and flash it as you would a ROM.

There’s also an app called Franco Kernel updater (free as well as paid, with the latter having many more useful features) which lets you download both the leankernel as well as another popular kernel called Franco. The paid version of the app also lets you tweak various kernel configs. CM by default does not include such features. On the other hand, Carbon included some of these by default.

A post on Android, AOSP, Custom ROMs, Bootloader, Recovery, etc

While not sysadmin related, this is a long post I wrote today on Google+ and figured I must put a copy of it elsewhere too.


Been meaning to write a post on Android past few days, so here goes …

Modern phones are like computers. Similar to how computers have an OS (Windows, Linux, Mac etc) phones have a firmware (also called ROM). The names firmware and ROM are misleading. They are just legacy hangups from an era when the phone OS was basic and you rarely flashed (installed) a new OS or updated it. So although we still call it firmware or ROM, it’s actually an OS. In the case of Android, an OS based on Linux.

The Android OS is built by Google. Each release is named after a pastry. So you have Jelly Bean, Ice Cream Sandwich, Gingerbread, Eclair, and so on. With each new release Google usually also releases the source code to the OS. This open source release is called the Android Open Source Project (AOSP). Enthusiasts around the world take this AOSP release and make their own modifications. Since these are custom Android OSes, they are usually simply called custom ROM. The result is AOSP based firmware such as CyanogenMod, Carbon, AOKP, Paranoid Android, and so on. Most of these contain many more features than stock Android, as well as performance hacks and such. So they are quite popular among Android geeks.

Apart from the AOSP Google also releases its OS to partners such as Samsung, Sony Ericsson, LG, HTC, etc. They take the OS, add their own customization and tweaks, drivers for their hardware, additional software that differentiates their products from others, and (in the past but not so much now) useless “bloatware” software. Once upon a time this was the only way to get Android. You buy a phone from these partners and use their modified version of Android. So Google started creating its own brand of hardware, under the name Nexus. These are devices made by a partner such as HTC, Samsung, or LG, but built according to specs from Google (I think) and more importantly they come with “pure” Android. That is, Android the way Google intended it to be – without any additions or subtractions from the hardware partners. USually you have one Nexus phone a year.

Nexus devices are thus popular with those who want a pure Android experience. They are also not so popular with the general public as most people like the extra software and features provided by the non-Nexus-but-modified-Android phones. Plus Google doesn’t market the Nexus device much (though in recent past it has) and they are usually low in specs compared to the competition (though that too has changed in the recent past). Nexus devices have an advantage over other devices in that since they run pure Android they are the first to get Google’s new Android releases. Other phones take longer as Samsung or Sony or what-have-you must take the released Android, make their changes, customize the UI, test, etc before releasing to the public. Moreover, it is not in their best interests to let you have the greatest and latest Android release on their yesteryear handsets – even though it may work perfectly well – and so they may not even release the latest Android for the phone you have. (A good example being the Samsung Galaxy S II which can easily run Android 4.2 – as seen by the fact that it runs CyanogenMod 10 – but Samsung hasn’t officially released Android 4.2 for this device).

Yet another advantage of the Nexus devices is that since they are designed to run pure Android, they will run all AOSP based firmwares without any issue. On the other hand, devices created by other manufacturers could be made to run – provided the volunteers have the time and inclination to do so, and there’s enough demand for it, etc. Thus, for instance, you do have CyanogenMod builds for Samsung Galaxy S II, but you don’t have the latest CyanogenMod builds for Sony Ericsson Xperia Arc S (even though both were released around the same time). Some custom firmware may have builds for one device, but not for another – it all depends on the interest of the volunteers and demand from their target audience.

The reason devices by other manufacturers have sketchy support is to do with drivers. Drivers are blobs of code that tell the OS how to interact with a piece of hardware. The OS talks to the hardware through drivers, and that in turns depends on the phone manufacturer (whether they provide drivers, whether people know what hardware is being used, etc).

Back to the OS. As I said above Android is the OS that runs on your phone. Now, an OS is something that’s stored on the phone’s “disk” (not exactly the correct term here, hence the double quotes, but you get the point). When the phone is off and you power it on, something has to load this OS into the phone’s memory so it run and be “self initialized”. This “something” is required in the case of computers too – when you turn on your machine, there is a piece of software that loads first and asks you whether you want to load Windows 8 or Windows XP – assuming you have both OSes installed on your machine – or just goes ahead and launches one of these OSes if you only have one installed. This software is called a bootloader and the process of loading an OS via a bootloader is known as bootstrapping. (It comes from the idea that say you are sitting on a floor and want to get up but you can’t just push your hands down and lift yourself up. (Just assume you can’t for this example sakes. That’s how a phone/ computer OS is. It is sitting in the disk and needs to get up, but can’t do it on its own). What would you do? You are wearing boots (coz that’s how you are!) and these boots have bootstraps (the little piece sticking out at the top back of the boot) so you hold these bootstraps and pull yourself up – thus getting up on your own without any external help. Thus came about the name bootstrapping. And from there came the word bootloader).

So anyways, phones have a bootloader, which is what loads the OS into phone memory when you power it on. On computers (typically) bootloaders are free to load whatever OS you tell it to – so that’s why you can multiboot Windows, Linux, multiple versions of these, etc pretty easily. But on Android phones the bootloader is typically locked. Why? Coz that’s how phone manufacturers are. They don’t want you booting other OSes on their phones and writing to protected parts of the system (and maybe they have some others reasons too based on how the contract system of phones work in the US and other parts of the world, I don’t know) – so if you have a Samsung Galaxy S II (say) you can’t just go ahead and install CyanogenMod on it as the bootloader is locked and it won’t be able to boot CyanogenMod for you! I am not very familiar how one used to unlock bootloaders in the past, but nowadays most phone manufacturers let you request for an unlock key from their website and then you can use a piece of software provided by Google to unlock the bootloader. (Another advantage of using Nexus devices is that unlocking their bootloader is a straightforward process – just type a command and you are done!)

Apart from the ROM and bootloader, another piece of software Android phones have is called recovery. Think of it like your computers’ BIOS, though it is not really like that. Or maybe a better way to think of it would be like a separate partition/ disk on your computer that contains a bare minimum OS that only lets you do basic stuff like backup/ restore your data and install/ upgrade your main OS. Most computers don’t have such a software as computers have CD-drives and USB disks and geeky chaps who want to do similar operations on computers just put in a Live-CD or USB and boot into an alternate OS to do their deeds. But phones don’t have such a luxury and so come with the recovery software installed onto it.

The recovery that usually comes with phones is pretty bare. There exist third party recovery software – notably ClockworkMod Recovery (and its touch enabled variant ClockworkMod Recovery Touch) and TeamWin Recovery Project (TWRP) (which is touch enabled by default). If you want to install a new ROM on your phone, you definitely need one of these recovery software. There are couple of ways to install a custom recovery and the process is pretty straightfoward. You don’t even need an unlocked bootloader to install a custom recovery, though if you plan on installing a custom ROM later you do need an unlocked bootloader. Some methods of installing a custom recovery require an unlocked bootloader, while others require a rooted phone.

Which brings us to the question of what is a rooted phone. You see, by default your phone OS lets you do things on it as a regular user. Again, it’s similar to how computers operate. Taking the case of Windows for instance: in the past, with Windows XP, when you logged in to the system chances are you had full rights to the OS and could do pretty much anything with it – install software, devices, and even viruses. Nowadays, though, Windows (Vista onwards) logs you in as a regular user and usually prompts you for an administrator username/ password when you are trying to do things like install apps. This is because Windows is more security conscious nowadays and doesn’t give you full rights by default. It logs you in as a user and only gives you elevated rights if you are authorized for it. Phone OSes are similar. By default they log you in as a user and you can do most tasks – including install apps – but if you want to tamper with the OS itself (such as install software that installs a custom recovery!) you need elevated rights. Problem is, Android and its variants (and also iOS etc) usually actively deny giving you elevated rights and so you need to do things to break the locks that prevent you from doing so. This process is known as rooting, and a phone that is thus “broken” is known as a rooted phone. (The term comes from Unix, where the user with full control over the system has username “root”. Since Android and iOS and based on Linux and BSD, which have Unix roots, the name stuck on. As an aside, on Windows the user with full access is known as “administrator”. And it’s as a homage to these that Harold Finch, of the TV show “Person of Interest”, worked under the username “admin” (short of “administrator”) while the girl who was trying to hack into the machine worked under the username “root”).

There is no one-size-fits-all method for rooting your Android phone. Since rooting depends on exploiting bugs in the OS to give you more rights, it depends on the version of the OS on the phone and also whether its pure Android or modifed by the phone manufacturers, etc. Nexus phones usually have it very easy – and there’s even a “Nexus Root Toolkit” software that easily roots the phone for you. For other phones a quick Google search usually turns up ways to root them. (By the way, this is what “jailbreaking” an iPhone entails. You exploit bugs in iOS to gain root access, and then you modify the OS to let you install your tweaks etc. That word is a homage to FreeBSD, a branch of BSD that the Mac OS X is based on).

Custom ROMs such as CyanogenMod etc are rooted by default. So once you install one of these there’s no separate need to root the phone. And if your aim is to replace the stock firmware with a custom one, there’s no need to root it either. Simply unlock the bootloader, install a custom recovery, and install the custom ROM. A good thing about Android is that you don’t need to root the phone or unlock the bootloader (or install a custom ROM) if all you are interested in is general customizing. You can easily theme the phone, make changes to your notification bar, install non-Play Store apps – all by default. This is unlike iOS where you can’t even change the theme or install non-App Store apps and so jail breaking is necessary even for those “basic” things. On Android you do all this only if you really like to play around with your phone (or your phone manufacturer isn’t updating it with newer firmware and so you want to switch to a custom ROM).

The rabbit hole doesn’t stop here actually. Most people go ahead and change the kernel too of their ROM. The kernel – as its name suggests (a kernel is the seed inside the nut of most plants, so it’s like the core-most thing of a plant) – is the core component of an OS. It is the actual bit of code in the OS that interfaces with the hardware (via drivers) on one side, and the OS & user applications on the other. With Android, you can change the kernel too – many people do this to get better performance out of their phone or for some feature only offered by a custom kernel. Installing a new kernel is quite straightforward – similar to how you would install a custom ROM.

And that’s it.

This post should have given you a high level overview of custom ROMS and rooting etc in terms of Android. One last thing to keep in mind is that if you are installing a custom ROM you must also install Google Apps (Gapps) separately. Once upon a time custom ROMs included the “Google for Android” software such as Gmail, Calendar, Search, Google+, Play Store, etc. Then due to licensing issues they stopped including these by default, so nowadays one must download the Gapps package separately, along with the custom ROM. They are usually found in the same place one downloads a custom ROM from, as there is (usually) a version of Gapps for each version of the custom ROM. In theory you can install a custom ROM without Gapps – leaving you unable to install any Google for Android apps or even access the Play Store – but it’s possible if you want it that way (just download the install files for packages you want and install yourself).