[Samsung Galaxy S10 Guides, News, & Discussion] kkoo:
Hello,

This would be a short & sweet guide on how to install a custom ROM on your Samsung using ODIN. I'm going to tailored this guide for the S10e G9700 HK version (is the phone I own) I'm a linux user but Odin only runs on Windows so this works 100% on a Windows 10 VM an of course native on Windows.

1. Who is this for?

For people that can't or don't want to install TWRP on their devices. For example TWRP doesn't work with the S10E Snapdragon G9700 the HK/CHG version.​

2. Will this method work on my bootloader locked phone?

NO!

Bootloader locked phones are locked in hardware there's no way to flash anything but carriers ROMs to them. If you can unlock the bootloader this guide will work for you.

https://www.getdroidtips.com/how-to-unlock-bootloader-on-samsung-galaxy-phones/​

3. Can I use this only with the G9700 phone?

No you can use any device, but this guide is tailored to the s10e g9700; because the TWRP version for this phone doesnt work with Android10.​

4. Why not use Heimdall and do the guide entirely on Linux?

I use Manjaro [Arch] linux and tried to get Heimdall to work but couldn't, so choose the path of least resistance, so ODIN and windows is what we got :).​

5. Recommended ROMs?

I'm not a fan of Google Apps so my recommendations are these (2) ROMs:

1. https://github.com/phhusson/treble_...ad/v219/system-quack-arm64-aonly-floss.img.xz (No bloat, Stock Android 10 with FOSS Apps replacements of Gapps, you can install your own on top, Like I use Google Maps (the only Gapp I use)

2. https://sourceforge.net/projects/an...7-UNOFFICIAL-treble_arm64_bvN.img.xz/download (Lineage OS 17.1 - this is vanilla, you will have to install an App store like F-Droid or Aurora from the .apk files using ADB [FYI] - This is what I use as my daily driver!

note* the proximity sensor doesn't work with the S10E and PHH based ROMs - https://github.com/phhusson/treble_experimentations/issues/592#issuecomment-519853332
​

6. If using a PHH based ROM from phhusoon set this to get Bluetooth Audio working?

Under Developer Options - toggle ON "Disable Bluetooth A2DP hardware offload"​

Credit goes to (for their work) [MENTION=1915408]phhusson[/MENTION] [MENTION=4467696]AndyYan[/MENTION] (Project Treble PHH & LineageOS PHH) & [MENTION=5440075]mkh.mourad[/MENTION] (CMD Script)

https://xdaforums.com/project-treble/trebleenabled-device-development

Requirements

7zip - https://www.7-zip.org/

Odin - https://samsungodin.com/

CMD or PowerShell (Windows) - View attachment 5039569

Step-by-Step Process

Get your phone Official Stock ROM - https://samfw.com/firmware/SM-G9700/TGY (this is the one for my phone)

Extract the downloaded file (you'll have the BL, AP, CP, CSC) .TAR.MD5 files

Using 7zip extract just the AP .tar.md5 (it'll have img.lz4 files: boot.img.lz4, vbmeta.img.lz4 & system.img.ext4.lz4)

Download a clean vbmeta.img file from Google - https://dl.google.com/developers/android/qt/images/gsi/vbmeta.img

Now we need to compress the vbmeta.img file (just downloaded from google) using LZ4.

Go into the /bin folder inside the script zip file provided (or download LZ4 from https://github.com/lz4/lz4/releases)

Run this command

lz4.exe -B6 --content-size vbmeta.img vbmeta.img.lz4

Done with vbmeta.img (keep the vbmeta.img.lz4 file)

Now download your favorite Custom ROM (https://github.com/phhusson/treble_...ad/v219/system-quack-arm64-aonly-floss.img.xz)

Using 7zip extract the .img.xz file & Rename the file inside to system.img.ext4 (this is the system OS without lz4 compression)

Now we need to compress the system.img.ext4 file (just renamed) using LZ4.

Run this command

lz4.exe -B6 --content-size system.img.ext4 system.img.ext4.lz4

Done with system.img.ext4 (keep the system.img.ext4.lz4 file)

Want to Root the device? if yes continue on; if not skip to step 24

Take the boot.img.lz4 extracted from the stock ROM (the AP.tar.md5 file)

We need to decompress this file using LZ4.

Run this command

lz4.exe -d boot.img.lz4 boot.img

Transfer this boot.img file to a phone and run Magisk Manager (doesnt need to be a rooted phone) and patch the boot.img file

Take the patched file on your phone and transfer to your computer

Rename the patched Magisk file to boot.img

Now we need to compress the boot.img file (just renamed) using LZ4.

Run this command

lz4.exe -B6 --content-size boot.img boot.img.lz4

Done with the renamed Magisk patched (keep the boot.img.lz4 file)

Replace the stock boot.img.lz4, vbmeta.img.lz4 & system.img.ext4.lz4 with the new customize files

Extract the files from tar-md5-script-tool.zip

Copy or Move all files below to the tar-md5-script-tool folder

Files are: (we don't need the meta-data folder with fota.zip)

boot.img.lz4

dqmdbg.img.ext4.lz4

dtbo.img.lz4

persist.img.ext4.lz4

recovery.img.lz4

system.img.ext4.lz4

userdata.img.ext4.lz4

vbmeta.img.lz4

vendor.img.ext4.lz4

Now we are going to build the AP file to use with Odin

Run the batch.bat file from the tar-md5-script-tool folder

Once it finishes go to the /tar-md5-script-tool/temp-folder/

Inside you will find the AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5

Flash the BL, CP, CSC (use HOME_CSC) from your Stock ROM & AP (using AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5)

Done

Thanks to [MENTION=8171045]Alberbeast[/MENTION] for reaching out and encouragement to help the community and S10e G9700 owners :good: ;)