This HOWTO shows how I did this on a Ubuntu 20.04 host.
(There are other topics that explain about using Odin on a Windows machine - I can’t do that, so doing this instead. There are other topics and links about using heimdall, but none give all the details. Please reader, if you know more about this topic, do help me out.)
PLEASE READ ALL THE WAY TO THE END BEFORE STARTING TO FOLLOW THIS GUIDE
Check whole thread for feedback. I’d prefer that some experienced users who can get themselves out of trouble test this before saying this guide is ready. Usual disclaimers apply - if something goes wrong your phone may become unusable, I’m not responsible for that
-
Identify my phone model. In my case SM-G965F
-
Getting the Stock Image.
I went to https://samfrew.com/all/ and searched for my device type, then got image for my region:
NZ android Q version
Downloaded (allow about 8 hours for slow download) sfirmware and samfw are faster
Optional: Get TWRP image here -
Received zip file NZC-G965FXXUFFUC6-20210428121900.zip (about 4.8GiB), save into its own empty directory
-
unzip this file, results in 5 files
-
BL_G965FXXUFFUC6_CL21315605_QB39020729_REV01_user_low_ship.tar.md5
-
AP_G965FXXUFFUC6_CL21315605_QB39020729_REV01_user_low_ship_meta_OS10.tar.md5
-
CP_G965FXXUFFUC6_CP18513641_CL21315605_QB39020729_REV01_user_low_ship.tar.md5
-
HOME_CSC_OMC_OXM_G965FOXMFFUC6_CL21315605_QB39020729_REV01_user_low_ship.tar.md5
-
CSC_OMC_OXM_G965FOXMFFUC6_CL21315605_QB39020729_REV01_user_low_ship.tar.md5
Reading the sidebar here I learned that CSC and HOME_CSC tar files are alternative versions of the same data “Use CSC_*** if you want to do a clean flash or HOME_CSC_*** if you want to keep your apps and data.” So you may not want to unpack the file starting with HOME_
$ the_text_of --the command -lines
- Each of these can be unpacked with
tar
e.g.tar xf BL_G965FXXUFFUC6_CL21315605_QB39020729_REV01_user_low_ship.tar.md5
Note that the shell won’t autocomplete the filename because of the .md5 at the end, but tar works fine.
Or use this commandline to remove the md5 extension
for f in *.md5 ; do mv $f "${f%.md5}" ; done
-
Some of the resulting files are compressed, and have the extension .lz4, so they need to be unpacked with the command
lz4 -m -d --rm *.lz4
(multiple files, decompress, remove source) -
Now I have a bunch of files (grouped by origin tar file)
filename, partition name to be used in a later step
AP_G965F
- boot.img BOOT
- dqmdbg.img DQMDBG
- recovery.img RECOVERY
- system.img SYSTEM
- userdata.img USERDATA
- vendor.img VENDOR
BL_G965Fblahblah:
- cm.bin CM
- param.bin PARAM
- sboot.bin BOOTLOADER
- up_param.bin UP_PARAM
- keystorage.bin KEYSTORAGE
CP_G965F:
- modem.bin RADIO
- modem_debug.bin CP_DEBUG
CSC_OMC_OXM_G965F:
- cache.img CACHE
- hidden.img HIDDEN
- odm.img ODM
- omr.img OMR
- STAR2LTE_EUR_OPEN.pit (list of partitions)
HOME_CSC_OMC_OXM_G965F: (note duplication of files from CSC)
- cache.img CACHE
- hidden.img HIDDEN
- odm.img ODM
- Install heimdall-gui (and heimdall)
$ sudo apt install heimdall-flash heimdall-frontend then run
heimdall-frontend` (HG for short)
-
Reboot the phone into download mode. Power off, then press and hold Volume down + Bixby (single button below volume down) + Power button until download confirmation screent appears. Press Volume Up button to confirm. Connect phone to PC with USB cable.
Preferably connect to a USB2 port. (I found that when connected via USB3, I got USB bulk transfer errors; switching to USB2 let it work) -
Confirming compatible PIT file. In HG, select the Utilities tab, click Detect device, hopefully your device is detected. Then Download PIT. Enter a destination filename, e.g. “my-device.pit”, then click Download.
Then use Print PIT. Select Local File, navigate to “my-device.pit”, click Print. A bunch of stuff shows up in the Output window. Click in there, select all and copy. Open a text editor, paste the text, and save as e.g. “my-device-pit.txt”.
Repeat the print, but this time load the pit file that came from the firmware archive, in my case “STAR2LTE_EUR_OPEN.pit”. Get the result into e.g. “downloaded-pit.txt”.
Now, compare the two text files, I think they should be identicaldiff my-device-pit.txt downloaded-pit.txt
showed no differences. ?What to do if they are different?
-
Selecting what to flash.
At this stage advice is to flash ALL the img and bin files you got at step 6 - I’m not sure this is truly necessary or safe - what is modified by the /e/ os install?
Go to the Flash tab on HG. Similar instructions with images here
First the PIT option. Browse for the pit file that came as part of the download and load it.
For each of the .bin and .img files you have, Click the Add button, then use the dropdown box under Partition Details to find the partition name that it should be loaded into. As you select different partition names a hint shows up next to File, just under Partition ID. (add annotated screenshot here) See point (7) for my list.
If you got a TWRP image, you can use that instead of the stock recovery.img. In my case
twrp-3.5.2_9-0-star2lte.img
-
Reflash the phone. Click the Start button.
It will install all the listed partitions, one by one. -
Either the device will reboot by itself, or you can manually reboot.
At this point my phone went into a boot loop! But all was not lost… -
Reboot into recovery (I assume you installed TWRP for the recovery
(Press Volume Up + Bixby + Power). If bootloop is happening, you may have to try multiple times, but you should be able to get there. -
At last, install /e/ by following the standard instructions here, hopefully /e/ will boot.
-
If you have an /e/ account@e.email, then pretty soon after entering your credentials at the startup prompts, your stuff from ecloud (mail, contacts, notes, photos) will be synced to your phone.
Other relevant topics:
- When will we be able to flash /e/ android 10 on S9 with the easy installer?
- https://forum.xda-developers.com/t/s9-oem-soft-brick.4178157/ Documents commandline heimdall use, suggests that all 17 img/bin files should be flashed.