Contact

Subscribe via Email

Subscribe via RSS

Categories

Recent Posts

Creative Commons Attribution 4.0 International License
© Rakhesh Sasidharan

Extract secret keys from Two-Factor Authentication (TFA) QR codes

Got me Pebble Time yesterday! Yay. Found a cool app for Two-Factor Authentication codes called QuickAuth (it’s open source too, amazing!). 

The app requires you to enter the secret keys for your Two-Factor Authentication sites. Unfortunately I never saved these when I set up TFA on my devices. I was smart enough to save the QR code for each site and this way I was always able to add new devices by just scanning the saved QR code, but now I had to enter the secret key and I was stuck. 

Enter another open source project Zebra Crossing (zxing). This is a library for processing QR codes and they have an Android app called Barcode Scanner. Get this app, scan the QR code, and you get an output that starts with otp://. That’s the secret key you want. Enter this into QuickAuth. 

If you don’t want to download the app there’s also an online interface to upload a QR code and decode. Nice!

p.s. In case it helps anyone – on the face of it there seems to be no easy way to delete a key/ site once you enter it into QuickAuth. Later I realized if I long press the select button on the pebble when it shows a code I get many options. One of these lets you delete the key/ site. 

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!

[Aside] Pocket Casts (web) Player

I use (and luuuuuv!) the excellent Pocket Casts podcasts app. I discovered it when I switched to the OnePlus One and it’s probably my number 1 used app on the phone. I have discovered so many new podcasts thanks to it (because it has a good discovery tab and also because I listen to more podcasts now so I try and discover new stuff).

I wouldn’t be too far from the truth in saying that one major reason why I am still with the OnePlus One rather than going back to my iPhone 5S is Pocket Casts. Not coz Pocket Casts isn’t available for iOS, but because the OnePlus One with its 64GB of storage lets me download tons of podcasts while my iPhone 5S is a measly 16GB and so I can’t download much stuff for offline use. Sure, the OnePlus One’s larger screen is good for reading, but I don’t do much reading on that nowadays. The OnePlus One has the advantage of 64GB storage and the ability to just copy movies and music to it via MTP, while the iPhone 5S has the disadvantage of low storage (in my case) and the inability to just copy stuff over it without iTunes. The iPhone 5S keyboard is way better though (I hate typing on the OnePlus One, even with custom keyboards like Flesky) and its camera is miles ahead of the OnePlus One too. 

Anyways, I digress …

Pocket Casts is an amazing podcasts and you must check it out if you are into podcasts. Apart from a ton of great features, it also has sync. This means all my subscriptions on the OnePlus One will easily be in sync on the iPhone 5S too. More importantly, not just the subscriptions, but also my progress with each podcast. Isn’t that cool! 

As if that wasn’t cool enough though, I discovered via the latest episode of All About Android (where one of the Pocket Casts developer was a guest) that they now have a web player version. W00t! You can view it at https://play.pocketcasts.com/ – as with the Android/ iOS apps it’s not free, there’s a one time purchase, but that’s fine in my opinion. Free doesn’t have a long term future so I am happy paying for apps & services as long as they are good and meet my needs. (Apparently the web player was released on their blog in October itself). The web player too syncs with the mobile apps.

A note about the sync: unlike Kindle syncing for books (which is what I am used to) the app/ web player does not prompt you that you are currently on a further location with another device. If you already have the podcast open and you click “play” it will continue from where you are. But if you re-open the episode it will continue from where you are on the other device. 

Update: Some blog posts from Russell Ivanovic (one of the creators of Pocket Casts; he was the guest in the All About Android podcast). The first post was mentioned on the podcast so I checked out his blog:

p.s. I began using the iOS version of Pocket Casts the other day, and boy, is the Android version much better designed! Wow. This is the first app where I feel the Android version is much better designed than iOS. Most other apps have it the other way around. In the podcast Russell too mentioned something similar – that they are giving priority to Android over iOS nowadays. 

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. 

Unlocking the OnePlus One without wiping data (or at least trying to!)

Unboxed my new OnePlus One and immediately installed the usual apps etc. Then I realized that the device bootloader isn’t unlocked! I don’t know why, but I assumed the OnePlus One came unlocked and rooted. Silly me! All I want to do is root the device (an update file for SuperSU can be downloaded from here), but to do that I can’t use the stock recovery as that performs signature checking and so the update will fail). Option 1 is to install a custom recovery, option 2 is to temporarily boot into a custom recovery. Either of these options will then let me root the device. I prefer the second option, but it doesn’t matter really because to install/ temporarily boot a custom recovery the device must be unlocked! And unlocking means my data will be wiped. 

So … here’s what I did to unlock the device and trying not to lose the data. Note that if you are looking for a tutorial sort of post there are better places on the Internet. This is more of a rambling on what I did. I didn’t succeed in what I set out to, so this could be a waste of your time too. :) Also, I have an older post that explains boot loaders, custom recovery, etc. That’s worth a read.  

First I downloaded the Android SDK on my laptop. I didn’t download the ADT, only the SDK tools. Specifically, I downloaded the zip version of the SDK tools so I can put it in my Dropbox for future use. (The zip version can be found under “View All Downloads and Sizes”).

Downloaded the zip file. Extracted the contents to Dropbox. Ran SDK Manager.exe. This had “Android SDk Tools”, “Android SDK Platform-tools”, and “Android SDK Build-tools” selected as well as a bunch of items under the folder called “Android 5.0 (API 21)”. Plus under the “Extras” folder the “Google USB Driver” and “Android Support Library” too were selected. I un-selected the “Android 5.0” folder and “Android SDK Build-tools” as I don’t need these. I need the “Android SDK Platform-tools” as that contains the tools I want. And the USB driver is good to have too. 

selectionsAfter installing these I went to the Dropbox folder where I had extracted everything, went into the android-sdk-windows\platform-tools sub-folder, pressed the SHIFT key and right clicked within the folder, and selected the option to “Open a command window here”.

After this I went to the OnePlus One “Settings” menu > “About phone” > and tapped 7 times on the “Build number”. This enables the “Developer Options” menu under “Settings”. Went in here and enabled “Android debugging” (it’s unchecked in the screenshot below, I checked it).

Screenshot_2014-12-01-17-25-22

 

Now I connected the phone to my laptop. Maybe you’ll get prompted for a driver install in which case you should choose the one under android-sdk-windows\extras\google\usb_driver. If you don’t get prompted for anything then check the Device Manager. If an unknown device called “A001” is present, update its driver with the one in the above location. 

Assuming all goes well typing adb devices in the command prompt should show the OnePlus One:

ADB is pretty cool in that you can do a lot of stuff to your device with it. For example: boot into the boot loader, boot into recovery, take a device backup, sideload apps, and so on. 

The following command will reboot the OnePlus One into bootloader:

Unlike the Nexus devices I am used to, with the OnePlus One the bootloader doesn’t give any info. It has the Cyanogenmod mascot with the words “fastboot mode” beneath it. 

Once in fastboot mode we can ues a tool called fastboot to manage the device. Think of it as ADB but when in the bootloader mode. Assuming all went well before the following command should show the OnePlus One connected:

At this point I can follow either of the options I mentioned above – install a custom recovery or temporarily boot into a custom recovery. In my case this is where I would have issued a command like this to temporarily boot into a recovery image (after downloading a recovery image such as TWRP and specifying the downloaded path below):

If I wanted to flash the custom recovery over the stock recovery I would have typed the following instead:

If you do this without unlocking the device you will get an error along these lines: 

Unlocking is easy. Type the following command (before typing it read the next few paragraphs though):

At this point the device should be unlocked. I expected it to not reboot – because the first boot after unlocking is when the phone wipes all your data–  but mine rebooted! So I quickly powered it off, then powered it on by pressing the Volume UP & Power keys together. Give a minute and the phone will power on and go into the boot loader (fastboot mode). 

I confirmed that fastboot devices shows the phone, so I booted into a temporary recovery as before:

The fastboot screen icon turned white and after a minute TWRP booted. 

I chose the option to “Wipe”, followed by “Advanced Wipe”, and selected “Cache”. This wiped the cache, after which I rebooted the device. (Before rebooting TWRP pointed out that the device isn’t rooted so it can root for me. I chose to go with that). Unfortunately I think I was too late in powering off the phone before because it turns out everything was wiped! :(

Bummer!

Thankfully I was able to restore from the backup – sort off, because that seemed to break off midway – so finally I just recreated the phone. I had kind of expected this outcome as most data wiping as part of unlocking the bootloader is a pretty standard thing. I was hoping to avoid it through the trick above, but I guess it wasn’t my day. :)

(Note to self: If I try this again try flashing recovery and then unlocking. Maybe then the device won’t reboot).

Before I end, I’d like to point out this forum post. It’s from the OnePlus forum and goes into details of unlocking, rooting, etc. It’s a pretty good post, I discovered it while writing this blog post. 

Christmas comes early! New OnePlus One

Yay got my new OnePlus One today. Haven’t unboxed it yet.

IMG_5413.JPG

I ordered a pair of their JBL E1+ headphones too coz I have a headphone fetish.

The phone is Sandstone Black 64GB.

:)

New backup phone: Moto E, G, X, Nexus 5, or Android One

Idle mind, shopping mind!

I need a backup phone. To use when am travelling and such. Previously that role was fulfilled by my iPhone 4S but that phone’s become too slow since iOS 7 and now iOS 8.

I want something not too pricey. It should be micro SIM or regular SIM as these are easy to get everywhere. Dual SIM would be a plus. A good (not necessarily great) camera would be useful for taking pics etc. Also expandable storage would be preferred so I don’t have to worry abt storage.

Am in India currently and the new Android One phones are available here. Initially I thought of buying these. They are quite cheap (about INR 6500 ~ US$ 100) and tempting since they get updates from Google. But… their cameras are lousy, the internal storage is meagre (only 4GB!), and apparently the front facing camera can’t be used for selfies? Three different providers are selling these but all devices have the same specs, just different design and branding.

A comparable alternative to the Android One phones is the Moto E. This has dual SIM support and microSD support for up to 32GB. The internal storage is only 4GB, like the Android One phones, but it has no front facing camera. The back camera is similar to the Android One phones – slightly better maybe. The price of Moto E is comparable to the Android One phones. Just US$ 10 more!

Double the price of these is the Moto G. The Indian version has dual SIM support, an 8MP camera (good but not great), and microSD support for up to 32GB. The screen isn’t that great (but is better than the Android One phones & Moto E). Of course the CPU and other bits are better too, and the phone comes with 8GB or 16GB internal storage. The price doubling is justified and overall this seems to be a great device.

Two other phones I have in mind are last year’s Nexus 5 and this year’s Moto X. The Moto Maker website is amazing – you can design your own device! Of course the price of the Moto X starts at US$ 500, more than double the Moto G and way more than the Moto E and/ or Android One phones. That’s a silly point to make really because the Moto X has way better specs and performance than these phones and a much better camera too, but price is a factor for me as I don’t want to spend too much on the phone. It’s a secondary phone after all.

Three other points against the Moto X for me are that it uses nano SIM, has no microSD support (and the internal storage is only 16GB or 32GB), and no dual SIM support. All these pretty much rule out the Moto X for me.

Last year’s Nexus 5 looks to be a good phone. This year’s Nexus 6 is rumoured to be a pricier device so I won’t probably like that. The Nexus 5 takes a micro SIM but has no dual SIM or microSD support. It’s camera is good and it comes in 16GB or 32GB internal storage capacities. Google has stopped selling it but you can get it from Amazon or Google India (as well as FlipKart etc). The Amazon price is about US$ 400 (nearly double the price of Moto G) while the Indian prices are even more. I could buy the Nexus 5 – and I am tempted because it’s a Google phone and bound to get updates too for a while – but I am feeling stingy and US$ 400 too is high. The price is way better than the Moto X of a similar configuration so the sensible decision would be to get the Nexus 5 but I’d rather get the Moto G for US$ 200 and get a Kindle Voyage with the US$ 200 I will be saving! Too many gadgets to buy, not all of them of regular use for me, so I must economise. :)

Nexus 7 OTA errors

Today I finally upgraded my Next 7 (2013) tab to Android 4.4.4. Finally!

For the past few months it’s been stuck on 4.4.2. I tried OTA updates but each time it would download and try to install – and fail. On the recovery screen it would throw errors about signatures not matching. Initially I thought maybe my ISP or someone in the middle was trying to hijack the update, so I tried couple of times via VPN too. Not that that helped!

Finally I decided to try a manual update via sideloading. Followed the instructions at this link (note: at step 4, if you are using Clockwork Mod Recovery like I was, go to the option that says install ZIP and then you’ll find an option to install ZIP via sideload). Did that, and sideloading failed with an error (from Recovery) that /system/lib/hw/power.msm8960.so has unexpected contents. Great!

Went to that location using Solid Explorer on the tablet and found there’s no file with such a name. Instead there was a power.msm8960.so.bak so I renamed that to power.msm8960.so. Repeated above process; and got an even more weird error:

error

This time I couldn’t find any file in the location shown.

By now I was having a suspicion that something I changed in the base system was what’s causing there errors (I got a similar impression from various other posts too). Two things I did do to this tab were to 1) root it and 2) install the Franco Kernel. Either of these could be the issue but I decided to start with Franco. Thankfully I had backed up my previous kernel – note to self & readers: always backup the original kernel! – so I restored that, rebooted, and tried to sideload. This time I got the power.msm8960.so error again, so I rebooted again, renamed the file again, and tried. And – phew! – it worked this time.

So the problem was Franco kernel. Wish I was aware of this beforehand, I could have updated a long time ago! Anyhow, for next time I know I have to restore the old kernel and rename any such missing files and that will be good to go. I think I’ll skip moving to Franco for now though; I forget why I started using it in the first place, and I am feeling too lazy to do all these the next time I need an update. Plus Android L is around the corner, so apart from rooting I don’t want to make too many other changes.

Speaking of rooting, sideloading the update resulting in loosing root access. Not an issue – use the excellent Nexus Root Toolkit (NRT) to get access again. NRT is an excellent piece of software, a huge time saver (I must donate to the author sometime but I keep procrastinating). I keep changing laptops or re-installing the OS, so each time I use NRT I have to go through the hassle of installing the drivers and that usually requires a reboot and some extra steps. Did that this time too and now my Nexus 7 has Android 4.4.4 rooted.