[Galaxy S 4 General] Retrial:
THIS THERAD WILL NO LONGER BE UPDATED. TAKE A LOOK ON MY UNIFIED GUIDES/COLLECTION​

CLEAN & DIRTY FLASH STOCK OR CUSTOM ROM

Note: These guides have mostly specific links for the S4 GT-I9505 Roms TWRP, Modems & Bootloaders but the steps are the same for all other S4 Models - You just need to find specific Roms,TWRP, Modems & Bootloaders for your device model. You can take a look at "Usefull Links" section below.

THIS IS A COMPLETE GUIDE FOR THE BEST CLEAN INSTALL OF A CUSTOM OR STOCK ROM

FROM THE SCRATCH

:

1*. Download a stock LOLLIPOP Rom from here or here (doesn't really matter which country you will choose, just be sure to download one of the latests firmwares-recommend is QK1 or PK2) and recommend is latest QK1Modem / QK1Bootloader or PK2Modem / PK2Bootloader. For the all others Modems/Bootloaders, you can find them here. Also Download a windows program Odin. Next, move all your personal data such pictures,music etc from your internal storage to your external sd card or to your pc.*

2*. If you are going to flash a Custom Rom, Download the Custom Rom you want (Recommened any JDC Roms of your preference), Pico or Nano Gapps (or Super Gapps if you have a custom gapps-confg file) be sure you have choosed Platform: ARM and the proper android version of the rom you are going to flash) [If the Rom you want to flash include Gapps, no need to download and flash any Gapps at all] and the latest Magisk for root. After you finished with downloads move your Custom Rom,Magisk,Gapps to one folder in ur external sdcard. *

3. Reboot to Download Mode(power button+vol.down+home button) and Flash TWRP 3.3.1-1 or JDC TWRP 3.3.1-0 via Odin. (You put the .tar file in AP)

4*. Reboot to TWRP Recovery (power button+vol.up+home button) go to Advanced-File Manager-external_sd and delete all folders on ur ext sd card (For example you should delete: Android, .android_secure, LOST.DIR, DCIM, etc) except your personal files/folders and the folder with your custom Rom/Magisk/Gapps you want to flash. *

5. Now still on TWRP select Wipe-Format Data and type yes-then go back and press-Advanced Wipe-Select Dalvik / ART Cache, System, Data, Internal Storage, Cache and then Swipe to Wipe.

6. Now Boot to Download Mode(power button+vol.down+home button) and Flash Stock LOLLIPOP Rom via Odin. (You put the file in AP section)

7*. When Stock Rom is Flashed go to Odin again,

Reboot your device to Download Mode, connect it to PC and put Modem(CP Section) Untick Auto Reboot in options, flash it and reboot your device to system by holding Power Button.

Then Reboot to Download Mode again, put the Bootloader(BL Section) and do the same steps as before.

Check what Modem and BL you have, if Modem and BL didn't changed do the same steps again.

If for some reason Odin fail to flash, try to change USB Port in your PC and don't move the cable during flash. Also if you have Odin and the files on an External hard drive, move Odin and all the files you want to flash to your C: drive.*

8. Now Reboot to Download Mode once again and Flash TWRP 3.3.1-1 or JDC TWRP 3.3.1-0 via Odin. (You put the .tar file in AP)

9. Reboot to TWRP(power button+vol.up+home button) and do the steps 4. and 5. Then flash your Custom Rom--->Magisk--->Pico or Nano Gapps (or Super Gapps if you have a custom gapps-confg file) (If Rom doesn't include).

10. Let the Rom boot and Install Magisk Manager manually if it's not preinstalled. Enjoy!

1*For Stock Rom to have your WiFi working you need to have the same version of Modem/BL as your Firmware. For example if you have PK2 Stock Rom then you need to have PK2 Modem/BL.

On Custom Roms doesn't matter. You can have any of the latest Modem/BL you want but recommend is QK1.

If you want to use

KitKat Rom

custom or Stock you should flash the proper

KitKat Modem/Bootloader

. It will not work if you have Lollipop.

2*Skip the step 2. if you are going to flash only Stock Rom.

4*Each app on your phone with the WRITE_EXTERNAL_STORAGE permission may create files or folders in ur sdcard. Most of these folders have once been created by one of these apps and many of them may be deleted with a few exceptions (e.g. Android, .data, .android_secure, these contain important system or app data like a game's downloaded content):

.android_secure: apps installed and then moved to sdcard

Android: app data/cache

data: app data

.estrongs: ES file manager

LOST.DIR: sort of trash folder (collects recovered files after phone crashes)

DCIM: phone gallery's photos and previews

OTA-update: Over The Air update service

ppy_cross: an unknown third-party app's data.

So I recommend to delete them so you can put your phone/sdcard in a clean state and is guaranteed to be able to re-create these folders.

7*If you wanted only to flash stock Rom you done on step 7. If you have any problem with Force Close Apps etc go to Settings->Accounts->Backup and reset->Factory data reset.

***** You can follow the same steps for other variants too but you need to find and choose the proper Firmware-Rom/Modem-Bootloader/TWRP for your variant. *****

THIS IS A COMPLETE GUIDE FOR CLEAN INSTALL OF A CUSTOM ROM BUT

NOT FROM THE SCRATCH

:

1. Download the custom Rom you want (Recommened any JDC Roms of your preference), Magisk for root solution and Pico or Nano Gapps (or Super Gapps if you have a custom gapps-confg file)[If the Rom you want to flash include Gapps, no need to download and flash any Gapps at all], be sure you have choosed Platform: ARM and the proper android version of the rom you are going to flash. Then move all those files to one folder in ur sdcard.

2*.Reboot to Download Mode(power button+vol.down+home button) and Flash TWRP 3.3.1-1 or JDC TWRP 3.3.0-0 via Odin. (You put the .tar file in AP)*

3.Reboot to TWRP Recovery (power button+vol.up+home button), go to Advanced-File Manager-external_sd and delete all folders on ur ext sd card (For example you should delete: Android, .android_secure, LOST.DIR, DCIM, etc) except your personal files/folders and the folder with your custom Rom/Magisk/Gapps you want to flash.

4. Now still on TWRP select Wipe-Format Data and type yes-then go back and press-Advanced Wipe-Select Dalvik / ART Cache, System, Data, Internal Storage, Cache and then Swipe to Wipe.

5. Flash your Custom Rom--->Magisk--->Gapps.

6. Let the Rom boot and Install Magisk Manager manually if it's not preinstalled. Enjoy!

2*Skip the step 2 if you already have TWRP Recovery installed.

THIS IS A COMPLETE GUIDE FOR

DIRTY

INSTALL OVER YOUR CUSTOM ROM:

1. [Optional]Make a full nandroid backup., just in case something goes wrong. You can use TWRP to do that. (TWRP-->Backup-->Select everything)

2. Uninstall all Substratum overlays if you have any installed.

3. Remove previous root solution with Magisk Unistaller and optional UnSU to ensure all root remnants are gone. (TWRP-->Flash the unistaller.)

4. Reboot to TWRP and Wipe system, cache and art / dalvik.

5. Flash the Rom-->Magisk-->Gapps.

6. Reboot and Enjoy!

***** I've skipped some explanations, because if you are going to dirty flash, you already know for example how to boot to TWRP . *****

USEFUL LINKS (USB DRIVER, TWRP, ODIN, PIT FILES, ROOT-MAGISK, FIRMWARES, MODEMS AND BOOTLOADERS)

SAMSUNG USB DRIVER

If you have a problem while plug-in the device to your PC and PC can't recognize it, you may miss the Samsung USB DRIVER. To fix follow these steps:

1. Download SAMSUNG USB DRIVER.

2. Unzip it and install it to your PC.

3. Connect your device and done! Now should be ok.

TWRP

Download the TWRP version for your specific model of your device HERE.

Installation Process:

1. Without any custom recovery installed on your device: Download the .tar file of the version you choosed.

Reboot to Download Mode(power button+vol.down+home button) and Flash the TWRP version you choosed via Odin. (You put the .tar file in AP)

Done!

2. With TWRP already installed to your device (UPDATE to latest version): Download the .img file of the version you choosed.

Reboot to TWRP(power button+vol.up+home button) and press Install--->Install Image--->Navigate to .img file you downloaded before---->Flash.

Done!

ODIN

You can download ODIN HERE

PIT FILES

GT-I9505: You can find the link HERE. Flash it in Odin at PIT tab.

ROOT - MAGISK

You can root your device via MAGISK. Just download the .zip from HERE and flash it in TWRP.

SAMSUNG FIRMWARES

You can find all Samsung Firmwares HERE or HERE.

Just search for your device model.

MODEMS & BOOTLOADERS COLLECTION

GT-I9505:

Latest Modem QK1Modem

Latest Bootloader QK1Bootloader

You can find most of the Modems & Bootloaders HERE. Just search for your device model.

Steps:

1. Open Odin

2. Reboot your device to Download Mode, connect it to PC and put Modem(CP Section) Untick Auto Reboot in options, flash it and reboot your device to system by holding Power Button.

3.Then Reboot to Download Mode again, put the Bootloader(BL Section) and do the same steps as before.

4. Done! Check what Modem and BL you have, if Modem and BL didn't changed do the same steps again.

If for some reason Odin failed to flash, try to change USB Port in your PC and don't move the cable during flash. Also if you have Odin and the files on an External hard drive, move Odin and all the files you want to flash to your C: drive.

Some explanation:

- For Stock Rom to have your WiFi working you need to have the same version of Modem/BL as your Firmware. For example if you have QK1 Stock Rom then you need to have QK1 Modem/BL.

- On Custom Roms doesn't matter. You can have any of the latest Modem/BL you want but recommend is the latest QK1 for GT-I9505 or the latest for your variant.