FORUMS
Remove All Ads from XDA

[Guides S4] Flash Stock-Custom Roms & Usefull Links

522 posts
Thanks Meter: 418
 
By Retrial, Senior Member on 8th November 2018, 01:36 PM
Post Reply Email Thread
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.2.3-0 or JDC TWRP 3.3.0-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 and Flash Modem(CP Section)+BL(BL Section). (Untick Auto Reboot in options before you flash and when you have flashed it, Reboot to Download Mode and Flash Modem+BL again with Auto Reboot on)*

8. Now Reboot to Download Mode once again and Flash TWRP 3.2.3-0 or JDC TWRP 3.3.0-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.2.3-0 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 . *****


USEFULL 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)+BL(BL Section). Untick Auto Reboot in options before you flash and when you have flashed it, Reboot to Download Mode and Flash Modem+BL again with Auto Reboot on.
3. Done! Check what Modem and BL you have, if Modem and BL didn't changed do the same steps again.
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.

The Following 12 Users Say Thank You to Retrial For This Useful Post: [ View ] Gift Retrial Ad-Free
 
 
9th November 2018, 12:04 AM |#2  
Senior Member
Thanks Meter: 151
 
More
Great Tutorial, thanks @Retrial!

I wanted to ask if you could add some additional hints, e.g. like you did in response to a question of @InTheY2K here:
https://forum.xda-developers.com/sho...postcount=2175

Then I realized, you've already done so. Thanks again!

But I've got some additional questions:
  • In step 4 you describe how to clean external sd. In step 5 you advise to clean internal storage. But if you wipe internal storage, all personal data (e.g. downloaded files, music etc) is lost. Wouldn't it be sufficient to delete the same folders as on external sd card and leave the personal folders?
  • In step 6 you flash an actual lollipop rom, in step 7 modem and bootloader. I thought an actual stock rom comes with modem and bootloader, so that a separate flash of modem and bootloader would not be neccessary. Am I wrong?
  • As this is a guide for clean flash, one could not expect to find information about a dirty flash . But I think, this is the best place to at least leave a hint to a place where this information can be found. I remember @Buff99 has one for his roms. @Buff99, @Retrial - wouldn't it be a good idea to add this information directly or as a link to this description?

Additional question: When reading the post with my beloved i9505 and XDA Labs I can't see the colour difference in the asterisks, they all look the same. Perhaps you can replace them with additional ones (meaning *, **, ***) or list your remarks with the corresponding number from your main list (meaning 1), 2) etc.)
The Following 3 Users Say Thank You to pocketrule For This Useful Post: [ View ] Gift pocketrule Ad-Free
9th November 2018, 10:39 AM |#3  
Retrial's Avatar
OP Senior Member
Flag Athens
Thanks Meter: 418
 
Donate to Me
More
Quote:
Originally Posted by pocketrule

  • In step 4 you describe how to clean external sd. In step 5 you advise to clean internal storage. But if you wipe internal storage, all personal data (e.g. downloaded files, music etc) is lost. Wouldn't it be sufficient to delete the same folders as on external sd card and leave the personal folders?

We are doing the best clean install from the scratch so the internal storage must be wiped. You should move all your personal data in your sdcard before you wipe. I will add it as clue to the guide.
  • In step 6 you flash an actual lollipop rom, in step 7 modem and bootloader. I thought an actual stock rom comes with modem and bootloader, so that a separate flash of modem and bootloader would not be neccessary. Am I wrong?

That's not exactly true. If you have an old modem/bootloader and u flash for example PK2 firmware, you will not have same Modem/BL as ur firmware and then ur WiFi etc will not work. Flashing Stock Rom doesn't change them. You need to separate flash them.
  • As this is a guide for clean flash, one could not expect to find information about a dirty flash . But I think, this is the best place to at least leave a hint to a place where this information can be found. I remember @Buff99 has one for his roms. @Buff99, @Retrial - wouldn't it be a good idea to add this information directly or as a link to this description?

Hmm yeah this guide is for clean flash, but probably I will say something for dirty flash too.

Additional question: When reading the post with my beloved i9505 and XDA Labs I can't see the colour difference in the asterisks, they all look the same. Perhaps you can replace them with additional ones (meaning *, **, ***) or list your remarks with the corresponding number from your main list (meaning 1), 2) etc.)

Maybe the xda app has some issues. I've added numbers near asterisks, I guess it can help. Thanks for feedback.

Thanks mate, I've answered with green color under ur questions.
The Following 6 Users Say Thank You to Retrial For This Useful Post: [ View ] Gift Retrial Ad-Free
27th January 2019, 07:08 PM |#4  
side's Avatar
Recognized Developer / Contributor
Flag Thessaloniki
Thanks Meter: 14,372
 
Donate to Me
More
Up
The Following 3 Users Say Thank You to side For This Useful Post: [ View ]
2nd May 2019, 04:16 PM |#5  
Retrial's Avatar
OP Senior Member
Flag Athens
Thanks Meter: 418
 
Donate to Me
More
Update:
  • Added recommendation for JDC Roms
  • Added JDC Roms Universe Link
  • Added JDC TWRP 3.3.0-0 Link
  • Updated Visual Color Titles for each guide
  • Updated some Links.
  • Updated some steps in the guide "clean install not from the scratch"
The Following 3 Users Say Thank You to Retrial For This Useful Post: [ View ] Gift Retrial Ad-Free
18th June 2019, 01:45 PM |#6  
Retrial's Avatar
OP Senior Member
Flag Athens
Thanks Meter: 418
 
Donate to Me
More
Update:
  • Added note that other S4 Models can follow the same steps.
  • Added Usefull Links Section with quick guides.
  • Visual changes on Titles
The Following 2 Users Say Thank You to Retrial For This Useful Post: [ View ] Gift Retrial Ad-Free
27th June 2019, 05:59 PM |#7  
Retrial's Avatar
OP Senior Member
Flag Athens
Thanks Meter: 418
 
Donate to Me
More
Update:
  • Added PIT Files section with links at "Usefull Links"
  • Minor general changes at steps.
The Following 2 Users Say Thank You to Retrial For This Useful Post: [ View ] Gift Retrial Ad-Free
5th July 2019, 07:35 PM |#8  
Retrial's Avatar
OP Senior Member
Flag Athens
Thanks Meter: 418
 
Donate to Me
More
Update:
  • Change the recommended Modem/ Bootloader to the latest QK1.
  • Added links for recommended Modem/Bootloader for GT-I9505 (latest QK1 links) at "Usefull Links" section.
  • Added steps with explanation how to flash Modems/Bootloaders at "Usefull Links" section.
The Following 2 Users Say Thank You to Retrial For This Useful Post: [ View ] Gift Retrial Ad-Free
Post Reply Subscribe to Thread

Tags
clean install, flash, galaxy s4, guide, i9505

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread