I have a Samsung Galaxy S3 (SGH-I747M) smartphone. OK, it's getting a little long in the tooth, but it functions perfectly, and when I look at newer phones, they aren't that much better. This one works and I am used to it. And it is still supported reasonably well (no Lollipop but latest Kitkat).

Like any good geek, I both unlocked and rooted my phone eons ago. And just because I am paranoid, I also like to encrypt my devices.

Which is where I ran into difficulties when Samsung upgraded Android to 4.3 on this phone. The over-the-air upgrade wiped SuperSU, because of the new bootloader, KNOX, whatever. To reinstall SuperSU, I had to decrypt the phone or risk losing my data; I opted to decrypt. Little did I know that with SuperSU installed, encryption will fail; monitoring the phone with adb logcat told me that it was never able to unmount the /data partition prior to starting the encryption.

Last night, I noticed that yet another Samsung OS update is available for this phone. No, not Lollipop but still... updates are good. Samsung no longer lets a rooted phone do an OTA update, but I updated the phone using Kies, rerooted it, and all was well. And, well, since miracles sometimes happen, I tried encryption one more time. Predictably, it didn't work... rather than waiting a very long time for the phone to give up trying to unmount /data, I just long-pressed the power button to reboot.

The phone rebooted, and asked for the decryption password. Whoa? It didn't actually encrypt anything, did it? Anyhow, here's the password... and then the phone rebooted and asked for the decryption password.

In other words, I was stuck in a rather nasty boot loop. The phone, for all practical intents and purposes, was bricked.


And that's how a very, very, very long night began.

I first tried the obvious: boot into Recovery. The phone wouldn't. I could boot into ODIN, though, so I attempted to re-root the phone, in the hope that it will fix whatever is wrong with Recovery. It didn't. I couldn't even factory reset the bleeping thing! (Which I was quite prepared to do at this point... fortunately, I had the foresight to back up the phone before all this.)

I tried reflashing a stock image. The flash worked... and when the phone rebooted, it asked for the decryption password. After which it rebooted and asked for the decryption password.

Next, I tried flashing a custom recovery. ClockWorkMod first... which told me that it was unable to unmount /data. Its factory wipe was unsuccessful. Next, I tried TWRP. It offered significantly more options than CWM; most importantly, it allowed me to wipe every partition on the phone. Which I did. Afterwards, TWRP told me that I have no OS, but I rebooted anyway. Predictably, no OS. Back to ODIN, I reflashed the phone with a stock image. Reboot... and the stubbon thing asked for the decrypt password again.

I was ready to smash the poor thing. Indeed, I was already browsing the Rogers Web site for a new phone and I was wondering if they'd let me out of my old 3-year contract early (as nowadays, only 2-year contracts are legal.) But one last time, I tried booting into Recovery. And it worked!

Once in stock Recovery, I did a factory reset, and this time around, the phone was properly reset: next time, it booted without asking for any stupid password, and it started setting itself up like a brand new phone.

Heh! Back in the land of the living! But my chores were not done yet. This was an older stock image, so I had to re-upgrade the phone. And since I had a wiped phone with no data to lose, I decided to encrypt it first before rooting. It worked. Rooting worked, too, and as far as I can tell, it did NOT wipe my data. Once that was out of the way, it was time to restore everything from backup (a very tedious, time-consumig process as Samsung's Kies software is not very efficient). And then, I found out that even with a complete backup, many settings were lost: e.g., Wi-Fi settings were restored but VPNs were gone, several apps (mostly purchased apps) were not restored, many other settings reverted to stock.

As I said, it was a very long night. But in the end, I actually have an up-to-date, rooted, encrypted phone, which is what I wanted all along. I just wish it had been a little easier to get to this point.