If you've rooted your trusty Galaxy Ace 2, and played around with custom ROMs, you're probably having the time of your life -- but there are reasons you might want your old phone back. Perhaps you want to sell it, or maybe it's bricked and won't boot up anymore.
Don't panic, as the sacred text tells us: all may not be lost. The accidental bricking of phones during ROM testing is an occupational hazard of those of us who decide to go off the beaten track of Android's OS.
As long as you can boot up into download mode, there's still hope yet. Here's how to return the ROM back to the official stock Samsung firmware, so you can try again. (Or swear off the black arts of rooting for life, should you prefer. No judgement here!)
For the purposes of this tutorial, you must be using the GT-I8160 version of the handset, which is the version of the Ace 2 sold in the UK.
1. Get your files ready
If you've got into this mess via rooting, you should aready have Odin on your computer, but if not download it from here, along with the Samsung USB drivers. You'll also be needing our stock ROM, which you can download here. This is the UK firmware, so only get this if you have a UK Ace 2.
If you have a different version, find out the model number from the box, or Settings > About phone, if you can turn it on. You should be able to find the stock ROM for your version by Googling it, but you're on your own there.
2. Prepare to revert
It's safest to have a fully charged phone for this. Even if it's bricked and you can't see how much battery it has, pop it on to charge for a while if possible. When you're confident it's full of juice, turn on your phone into download mode. You do this by holding down Power, Menu and Volume Down for a few moments.
If it works, you'll be presented with a message warning you about custom ROMs. But you've been around the block a few times, right? This is no big deal. Press Volume Up, and it will say 'Downloading...' with a picture of a friendly green Android on screen. Put your phone to one side for a moment.
Now install those Samsung USB drivers, if you haven't already, unzip the firmware file to somewhere easy to find and open up Odin. Make sure Auto Reboot and F. Reset Time are ticked, and nothing else is. Then press the PDA button and open up the file you unzipped a moment ago -- the memorably named 'I8160XXLK7_I8160-BTULK7_I8160XXLK7_HOME.tar'.
Connect your Ace 2 to your computer via the USB cable, and an enthusiastic message should pop up in the bottom left corner saying 'Added!!' This means you're ready to flash the new-old ROM back on and recover your mid-range paperweight to its former glory.
3. Flash the ROM and cross your fingers
Press the 'Start' button in Odin, and hold your breath, while the computer does its magic. When it reaches the end of the timer, the phone should reboot back into a working OS again and you can do a celebratory victory dance.
If you want to get back on the custom ROM wagon after this, bear in mind that you'll need to re-root your device, as going back to the stock undoes all your hard work. Need a refresher course? Check out our how-to guide.