Thursday 19 November 2015

The Easy Guide To Flashing An Android Phone. Custom ROMs

The Easy Guide To Flashing An Android Phone. Custom ROMs

Last week, it was stock ROMs, so this week it’s custom ROMs – ones designed by enthusiasts. Jason d’Allison shows you that the flashing process isn’t the dark art it’s often cooked up to be…

As before, I’m using a Samsung Galaxy Note (GT-N7000). It’s an oldie but a goldie, and given Samsung’s runaway popularity in the Android world, a Galaxy makes sense as the basis for a guide on ROM flashing. The process is pretty much the same across the whole model range. It’s often somewhat different with other Android brands, but this guide still has value as an overview and introduction.


Why install a custom ROM, though? Well, maybe you hate your stock ROM’s skin – TouchWiz in the case of a Samsung phone. A skin can cripple performance, as can all that bloatware manufacturers love to include. A custom ROM will usually be ‘clean’. Most likely it’ll also provide greater functionality and flexibility. The headline grabber, however, is that you can breathe new life into a phone that’s no longer being supported. Want a newer version of Android, perhaps even the latest? You got it.

This guide assumes your phone is currently running a stock ROM. If it’s not, there could be complications, so I advise you to install one before going further. I covered this procedure in part one of this guide.

Safe, Not Sorry


As also covered in part one, before you start, you should ensure you’ve backed up everything of value. Ordinarily, you won’t lose anything on a micro-SD card or in the phone’s default media locations, but why risk it?

Forget about Samsung’s PC software: Kies and Smart Switch. Typically, these will only play ball if your Android installation is totally Samsung-stock, so while you’ll likely be able to back up, you’ll probably come a cropper when trying to restoring. With that in mind, to save media files, simply hook your phone up to a PC via USB and copy them across. To save text messages, a good bet is SMS Backup & Restore, a free app in the Play store.

And talking of the Play store, all apps you’ve installed that way, and often their settings, will normally have been backed up automatically to Google’s servers. You’ll be able to restore these as soon as you log into your Google account in the new ROM. The same applies to Gmail messages and call contacts. Here’s an overview: goo.gl/LU5IrM.

Now, again as mentioned in part one, there’s an app that’ll do all the above at one fell swoop: Titanium Backup. It’s in the Play store. One snag is that some features – including text-message backup, unfortunately – are only available in the paid version, currently costing £4.11. Another snag is that your phone needs to be rooted – a subject I’ve handily covered in Taking Root.

Step 1
First, find a ROM. The best place to look is probably forum.xda-developers.com. This caters to all brands of Android phone, not just Samsung. Use the search bar at the top to locate your model – the exact model – then hit the ROMs tab further down the page. You’ll see a list of forum threads, each dedicated to a specific ROM. Don’t run to the hills at the sight of all those codes and funny names!

Step 2
Spend some time skimming through the threads. See what people are saying. What sort of ROM do you want? A slimmeddown job that’s as nippy as can be? One with oodles of customisation options? Or are you simply after a more up-to-date version of Android? Pay attention to users’ bug reports, as custom ROMs often fail to get some phone features to work – the cameras, FM radio or GPS, for example.

Step 3
Most ROM threads provide installation instructions, but these often assume previous knowledge of how things work – hence this guide! So once you’ve found a ROM you like, click the download link. For my Galaxy Note, I’ve chosen NightOwl, derived from the Android 5.1.1 ROM by CyanogenMod (the biggest name in non-Google Android development). Officially, the Note only goes as far as Android 4.1.2!

Step 4
Android itself is open-source, so developers can do with it as they please, but Google’s apps are proprietary. Legally, a custom ROM can’t include them. To get Gmail, Maps and the like, plus access to the Play store, you need to download the ‘gapps’ bundle that matches the ROM’s version of Android. For me, that’s the 5.1.1 bundle. If the ROM’s forum thread doesn’t provide a link, visit www.teamandroid.com/gapps.

Step 5
Your ROM and ‘gapps’ downloads will both be .zip files – do not unzip them. Connect your phone to a PC via USB and access its storage. This will usually show up as Phone. Drop the files into the root folder – the place where you can see all other folders (DCIM, Ringtones, and so on). Alternatively, if your phone has a micro-SD card (this will usually show up as Card), you can drop the files into the root folder of that.

Step 6
Next, equip your PC with Samsung’s USB driver. This comes with Kies, Samsung’s update and backup software, but if you don’t have that set up (probably a mercy!), download and install this stand-alone job: goo.gl/GTqyGn. You also need to download and install Odin, the semi-official Samsung flash tool you’ll be using shortly. Grab the latest version, which is currently v3.10.6: odindownloader.com.

Step 7
Now you need to update your phone’s recovery image. This is a system partition that provides emergency reset and update options, but a custom replacement will also provide options for flashing new ROMs. Recovery images are phone-specific, so download what’s recommended in your forum thread. It’ll be a variant of ClockwordMod Recovery (CWM) – as in my Note’s case – or Team Win Recovery Project (TWRP). If it’s a zip, unzip it.

Step 8
And… action! Make sure your phone’s got plenty of juice or plug it into a charger, then put it into download mode: switch it off, then switch it back on by simultaneously pressing the volume-down, home and power buttons. As mentioned in part one of this guide, it can be tricky to get this right, but when you do, a warning screen will appear. Pay it no heed: press the volume-up button to continue.

Step 9
If you’ve unplugged it, reconnect the phone to your PC via USB. Next, launch Odin. The first ID:COM box will turn blue and display a number, and you should then click the AP button (labelled PDA on older versions) and open your new recovery file (unzipped). Don’t mess with Odin’s settings; only Auto Reboot and F. Reset Time should be ticked (these are hidden under the Options tab on recent versions).

Step 10
Now click Start. Strap yourself in. You’ll see progress bars – blue on the phone and green in Odin. Wait while Odin works through the following stages (don’t worry if they’re slightly different in your case): KERNEL, RESET!, and PASS! It’ll be over in mere seconds. Your phone will then reboot, and you can unplug it from the PC now if you like. You can also close down Odin; you won’t be needing it again.

Step 11
Now boot the phone into recovery mode: switch it off, then switch it back on by simultaneously pressing the volume-up, home, and power buttons. Yes, volumeup this time, not volume-down. Again, it can be tricky. Once you’re in, you’ll see a text menu. The interface works by touch, but if you prefer you can use the phone’s volume buttons to move up and down the options and the power button to make a selection.

Step 12
First, select Wipe Data/Factory Reset. Follow this with ‘Clean to Install a New ROM’ and then Yes. You’ll see Andy the Android with a blue update thing in his tummy. Once the clean-up is finished, tap the screen to return to the main menu or press any key. Next, select Install Zip followed by ‘Choose zip from Internal sdcard’ – or ‘Choose zip from sdcard’ if you took that route. Lastly, select your ROM file (zipped) and then Yes.

Step 13
The update should be done in a few minutes – expect a fair bit of gobbledygook scrolling before your eyes. When prompted, tap the screen to continue or press any key. Once again, select ‘Choose zip from Internal sdcard’ – or ‘Choose zip from sdcard’ – but this time pick your ‘gapps’ file (zipped). Finish with Yes. After some more gobbledygook, tap the screen again or press any key, then select +++++Go Back+++++.

Step 14
Back at the main menu, select Reboot System Now. You’ll then have two choices: No or ‘Yes – Fix root’. Pick either, as it makes no difference; the phone will *not* be rooted either way. Now simply wait while Android sets itself up and installs all those lovely Google apps. This is the longest stage: it could take up to 15 minutes. If progress seems to hang on the ROM’s splash screen, be patient; it’s normal.

Step 15
And that’s it! However, if the splash screen gets stuck for more than about ten minutes – now or after a future reboot – enter recovery mode and wipe the system cache and Dalvik/ART cache. If you’re still in trouble, re-enter recovery mode and try a factory reset. This will wipe all apps and all app data (though the ‘gapps’ bundle will be automatically reinstalled), but with custom ROMs that’s all part of the… er… fun!


Taking Root


Throughout both parts of this guide I’ve talked about rooting. But what is it? Well, Android is based on Linux, so by default your phone’s system areas are protected against improper access. This stops rogue apps from tampering with crucial files or executing malicious code, and it also means you’ll have a hard time screwing anything up and rendering the phone unbootable.

Basically, rooting will remove this protection. Both you and your apps will gain ‘superuser’ privileges. Yes, there are security risks, but a dose of common sense usually lets the pros outweigh the cons.

Most custom ROMs have root access baked in, though often it still has to be enabled. With CyanogenMod-based ROMs, such as my Note’s NightOwl, enter the phone’s settings, tap ‘About device’, then tap ‘Build number’ seven times. This will unhide ‘Developer options’, also in the settings. Within that, ensure root access is switched on for both apps and ADB (the Android Debug Bridge).

Manual rooting is phone-specific. Different models require different methods. For a stock ROM, see what’s what by running a general search in, say, forum.xda-developers.com. Often a one-click PC utility will be available. For a custom ROM, details will normally be given in the forum thread. Usually you’ll find there’s a rooting option in recovery mode.

Final Thoughts


In part one I explained that every Samsung ROM has a CSC (carrier sales code) that defines its intended region and network. Well, worry not with custom ROMs: they’re all networkfree. However, this doesn’t mean you can turn a phone locked to Vodafone into a phone that’ll work on O2 – to use a typical example. You’ll still need to buy an unlock code. Sorry! A phone’s network eligibility is linked to its IMEI and held on an external database.

Last week, I also wrote that most newer Samsung phones have the Knox security feature. This relies on an internal flag, and doing almost anything unofficial, including flashing a ROM by any means other than Kies or an OTA update, will trip it. Knox isn’t included in custom ROMs, but a tripped flag will usually render it forever unusable even in stock ROMs. A phone’s warranty can be nullified too, at least in the US. Beware! Read all about it: goo.gl/JoAdF5.

Finally, if you’re planning to tinker with ROMs a lot, consider a ROM manager. You can install this in a custom ROM or a stock ROM, though your phone needs to be rooted. The managers from CWM and TWRP, the recovery-image developers, are probably the most popular. They’re in the Play store (the standard versions are free). A ROM manager will set up a recovery image, provide a list of compatible ROMs, find the correct ‘gapps’ bundle, automate installation, and also offer backup and OTA-update options – almost on a one-click basis.