Credit goes to @Tronicus and his reply Flash a Rom on an Encrypted Android
The quote looks long however it is really very simple. To install another ROM
- Install and reboot into stock recovery, then wipe data and cache (this removes encryption).
- Then install your recovery of choice and install ROM using recovery. Philz/CWM
How to Flash a rom on an encrypted Android phone (specifically this one, the I9505 SGH-I337).
The Problem: Once encrypted, you can't decrypt it easily. When encrypting the phone android will tell you you can only decrypt it using a factory reset. Naturally you assume it's talking about the "Factory Data Reset" option found in Settings --> Backup and Reset. But noooo, Android is lying through its ****ing teeth. Then you'll assume you have to wipe everything from your custom recovery mod (CWM, TWRP, or one of those). Wrong again! You'll get beautiful "can't mount /data" messages and more bull****. I read about a workaround that required installing the new rom using ADB, but I had ingeniously disabled USB debugging prior to wiping everything, so I only got so far with that option (plus it's tediously long if you haven't installed all the necessary software already and don't feel like bricking your phone because you made a typo in the command line). So, apparently the only other way to really format that partition free of its encryption is to use a stock recovery. So:
Short Version for Godlike users who know automatically how to do all this **** without any help (mimicking how most help posts are finely detailed on this site): Flash stock recovery, wipe everything, flash your custom recovery and install your new rom.
Long version for us mortals who don't know everything and haven't already downloaded already every single bit of software on earth:
- Backup all the stuff you want to save. This process will truly wipe EVERYTHING. You can do it manually, or you can use an app like Titanium Backup Pro to help you (find it on Google Play Store). Here's a nice guide which recommends what to restore and what not to restore: http://forum.xda-developers.com/show....php?t=1480343
- Flash the stock recovery using Odin. You can download a stock recovery from here: http://forum.xda-developers.com/show...91&postcount=3 It's the link called "I337MK2stockrecovery.tar.md5" In case you don't know how to flash it with Odin, this short guide will help: http://forum.xda-developers.com/show....php?t=1506697
- In step 6 replace "recovery.tar.md5" with the stock recovery you downloaded.
- Wipe everything from the Stock recovery console. This little ****er will **** up the encryption all those sissies couldn't touch. You're welcome. You boot into recovery mode from a turned off phone by pressing simultaneously the volume up key + the home key + the power key until you see blue text appearing in the top left corner of your screen.
- Reinstall your custom recovery. In my case I had installed the rom BEFORE flashing in the stock recovery (apparently it works, you just can't boot because of the encryption), so I was able to boot into the new rom before I returned to my custom recovery. Weird. Anyways, I recommend CWM. You can pick it up from this link: http://goo.im/devs/philz_touch/CWM_A..._Edition/jflte
- For some weird reason they call the I337 version the "jflte" version. It's bonkers. Click there, and download the latest version that ends with .tar.md5. This version is upgradable via Odin, which we already used. Use the same instructions used as when you upgraded the stock recovery rom.
- Boot into your recovery mod and flash your rom like you usually do.
This did NOT work on a Touchwiz ROM by same developer
I have not tested any other ROM