Because every time I want to flash a new ROM, I forgot how I did it the last time.
This is how I re-flashed my unbranded Samsung Galaxy S4 (german black edition) with a stock ROM (because Cyanogenmod crashed my phone all the time). The correct Stock ROM for my Galaxy S4 is: I9505XXUHOJ2_I9505OXAHOJ2_I9505XXUHOJ2
- adb
- heimdall (brew cask install heimdall-suite)
- Find any ROM that you want to flash and unzip it
- If there is a xxx.tar.md5 remove the .md5 and untar the file as well, until there is a list of around 12 files in a folder (see list of required files in heimdall command below)
- Now switch to your console and change into that directory
Enter Download mode with Power + Volumne Down or:
adb reboot bootloader
Wait until the system is in Download mode and then execute:
heimdall flash --APNHLOS NON-HLOS.bin \
--ABOOT aboot.mbn \
--BOOT boot.img \
--HIDDEN hidden.img.ext4 \
--MDM modem.bin \
--RECOVERY recovery.img \
--RPM rpm.mbn \
--SBL2 sbl2.mbn \
--SBL3 sbl3.mbn \
--SYSTEM system.img.ext4 \
--TZ tz.mbn \
--CACHE cache.img.ext4
Have fun with your new ROM!
Boot into recovery mode Volume Up + Power + Home and execute
- Wipe data / factory reset
- Wipe cache partition
- Reboot
Flash it again from within Download mode
heimdall flash --RECOVERY recovery.img
If you have the Samsung Kies software installed, this might load some intrusive kernel modules. This is how to find and get rid of them:
kextstat | grep -v apple
sudo kextunload -b com.devguru.driver.SamsungComposite
sudo kextunload -b com.devguru.driver.SamsungACMData
sudo kextunload -b com.devguru.driver.SamsungACMControl
In 2024, it is not working