Tuesday 31 January 2012

Rooting Android

My previous post on testing Android 4.0 generated a huge buzz (huge for this blog), so I thought I'd follow up on how to begin rooting and customising your phone

Warning: If you choose to root your phone, unlock the bootloader or install a custom ROM on it, be forewarned -  there is a minute chance that something may go wrong. Backing up your data is not optional, it is mandatory. Do it now, then backup your backup, and make a backup of that too. Also, this WILL void your warranty.

What is rooting and why I should do it?
Rooting (Apple users read: Jailbreak) is a term used to denote taking administrative control of your phone. A smart phone is akin to a modern computer, in that it has an Operating System and user accounts and account permissions that stop you from reading certain files and writing certain files - just as Microsoft windows or any other operating system does. Typically when your phone is switched on your logged in automatically (very much like a computer, without a login screen) to a normal user account, with a fwe restrictions on what parts of the phone you can make changes to. So gaining Root is like logging in to your phone with the admin account, you have full control of it and you can read system files and overwrite them - which will let us do some cool things, as we will see soon enough.

How is it done?
Typically someone has written a program for you, which you will download and put on your PC or laptop, then you connect your phone to your computer and and run the downloaded program. What happens in the background is the PC will run a (kind of) malicious program on your phone, that exploits a bug or flaw on your phone (this varies according to make and model of phone). But the exploit essentially grants higher privileges to whatever account is using the phone.

How is it done (step-by-step)?
I have used a few rooting applications and have had great success with unrevoked and revolutionary. Other tools to consider are SuperOneClick and UnlockRoot. UnlockRoot seems to support the most number of phones, so you may just want to stick with that. But read the forums to see if your chosen application supports your phone

HTC Super Tool - a great tool, designed just for HTC phones
Now, you will need USB drivers for your phone from the manufacturers website. In most cases, your phone will come with a CD with the drivers on it. Just google for the drivers if you do not have the CD.





 Next you will need to go to your phones settings menu and enable USB debugging, which for my phone is under Settings > Applications > Development

Enabling USB debugging mode
Connect the phone to your computer via the USB cable, run the program and your phone is now rooted.

So, what now?
Well with a rooted phone you have admin priveleges, so theres quite a bit you can do:
Install a custom ROM on there, to get additional features.
Overclock your phone to speed it up
Underclock the phone to conserve battery
Tether your data connection
Remove annoying pre-installed apps
Setup VPN and or TOR and other security features
plus loads more....

Next time I will walk you through downloading and installing a custom ROM for your phone. Ciao.

Sunday 29 January 2012

A taste of Ice Cream Sandwich

Its no secret that I am a fan of Android, I like all things android. The open culture, the price, the apps, the ease of building for the system and the ability to mod the software and hardware to my hearts content. No other mobile platform provides any serious hacker with the ability to tinker with the system as much as Android does.

Sure, it has drawbacks too, and at some point in a future article, it would be good to compare the strengths and weaknesses of Android versus other mobile OS's.

Well anyhow, my HTC Desire GSM from mid 2010 was running the leedroid ROM for some time (I chose Leedroid after having experimented with both cyanogenmod and leedroid and decided I prefered the aesthetics of HTC sense). The stock ROM that came with my HTC desire didnt support moving apps to SD card, hence I decided to root the device and put a ROM on there that would allow me to install lots of apps without complaining about space. Leedroid had come to the end of its life, as there had been no update for a few months plus my phone was getting clogged up and needed some spring cleaning. So I thought I'd investigate what the Ice Cream Sandwich buzz was all about.

After a short google search, I found a beta version of ICS for the HTC desire. Stability was not promised, but I figured I would give it a go. Installation was easy as my phone was rooted, all I had to do was put the zip file on my SD card and boot into recovery and install it.

After a short while of playing around with it, I found that the new interface was a very welcome addition. The features that I liked best:
  • Lockscreen - can open up certain apps, like text messaging directly, so it saves a few taps on the screen, if u receive a message and want to check it.
  • Updated Marketplace - The new interface looks very nice, although the pricing for some of the content was disagreeable - classic books for example were pretty expensive, compared to what is available for free on project gutenberg.
  • Notification bar - This was pretty awesome. It lets you control many features of your phone directly, like sounds, music player, data connectivity as well as lets you see the notifications and clear them out with a very innovative slide (shame apple ripped this off completely for iOS5 and are now suing android for tonnes of other patent breaches)
  • Voice - The voice search is vastly improved and well integrated into the OS.
  • Interface lift - The interface was given a much needed uplift (so much that the default ICS interface pars well with HTC sense, my long time favourite look for android) - it has awesome animations, subtle interface tweaks and is so much smoother than before.
  • Settings - This part of the OS recieved a lot of love from the developers, and now includes a data monitoring section (I will be very sorry to see 3G watchdog go from my phone). Battery and memory information has nice graphical data to display usage, which is quite aesthtic.
Ive added a few screenshots of my experimentation below (click to enlarge thumbnails), for the full set of images, visit the album on my google+ account.

Overall, the new interface was much to my liking, the beta version meant that there were a few crashes, especially the camera app - which managed to take 2 pictures before crashing. I dont think this is ready for day to day usage, but its clearly on the way. Id be more than happy to put a more stable version on this and use it for a little longer, before making the jump to a newer handset.

For more details on how to install and run this yourself, use the comments below to direct specific questions at me.

I'll try and get a video of this up and running soon.

Friday 20 January 2012

CLKF: Splitting files in linux

Command Line Kung Fu: Splitting files in linux

So I have a flash drive thats pretty irrevocably damaged, and for some reason or another it wont format into NTFS, but happily formats into FAT32 (exFAT is an option that I chose to ignore). And I have a 4.4GB file to transfer.

We all know that storing a file larger than 4GB is not possible on a partition formatted in FAT32 (which is a pretty old Microsoft file system type, when no-one actually had files larger than a few megabytes, now superseded by NTFS in an age when video files, Operating System images and games come at several Gigabytes in size, and a Terabyte is becoming the norm for any PC sold); In any case the solution to this problem was to split the large file into several smaller chunks that would fit on the drive or several drives.


There is a whole heap of tools available to this end, both freeware and commercial. A quick search on google reveals that the choices available are numerous. Any compression program (7Zip ftw!) does file splitting too. What I want is a command line tool, that will do the task as minimalistically as possible.

One of the original linux tools created for this purpose was 'tar', which stands for Tape ARchive, which is able to bundle a file or a collection of files into one (or several) file (essentially a precursor for ZIP without compression) ready to be stored on what was the best form of backup medium in those days, magnetic tape.

So using tar on the command line, heres how to split a file up:

$ tar -cvM --tape-length=1024000 --file=OUTPUT_FILE1.tar ORIGINAL_FILE

The --tape-length parameter accepts data in kilobytes, so 1024000 = 1GB. Just keep entering sequential filenames when it asks for another filename for each part it creates.
And to join files back up:


$ tar -xvM --file=INPUT_FILE1.tar ORIGINAL_FILE


So that works, but it isn't the most simplistic solution; there is also the much more simpler, split and cat commands:


$ split -b 1024m debian.iso debiansplit


and then when I had to join the files back:


$ cat debiansplit* > debian.iso


split command (click to enlarge)


Some more awesome Command Line Kung Fu to the rescue!





Wednesday 18 January 2012

On the Wikipedia Blackout, SOPA, PIPA and Firebug

So this SOPA and PIPA thing is threatening the Freedom of people across the globe and people are making their voices heard. I'm one of the ones that believe that the internet should remain free, and I think its important for awareness of this evil vile act to be propagated. GoDaddy got slated a few weeks back as thousands of customers left and changed domain providers (I didnt change my domains held by them, but im just going to let them expire since I no longer need them), and now Wikipedia is making a stand, great.


However during the course of the day I came to realise how much Wikipedia really means to me. I've never contributed a single article to the site but I use it on a frequent basis. So frequent that I panicked at the loss of Wikipedia for 24 hours.


With a heavy heart and the pain and loss of Wikipedia urging me to do something, I decided to investigate how the blackout was created. Assuming its for 24 hours only, it would make sense for the designers to add some sort of CSS trick to overlay the blackout image over the normal content. So that come tomorrow morning they could remove the said CSS code and have the site return to normal.



I investigated this angle using the good old 'firebug' add-on for firefox. This is an invaluable tool for any person interested in web development or design, and I have been a faithful user since 2007. Lo and behold, the code showed the addition of some 'display: none' css styles for the content and the addition of a new Div element that overlays the entire page with the SOPA message. The solution for quick access? Change the content div style to 'display:block' and the sopaOverlay div to 'display:none'. (Click on images to enlarge)


Although this gave me access to a single wikipedia page, the larger issue at hand regarding SOPA and any similar law's still remains unresolved. Here's hoping that freedom is handed back to the people. Happy CSS Hacking!