[Samsung Galaxy Mega] starmaster10:
No do not root it first because when you flash the stock rom it will replace what you rooted with the stock recovery without root. And the t-mobile sim card should work i think..but these are stock roms for the their respective carriers and they all have bloatware..i just not sure on how much each different rom has for bloatware, i use the BWA rom which is for sasktel in my area.

1. Download odin v 3.07 as v 3.09 i don't really like using.

2. Unzip odin 3.07 to a spot on your pc that you can find it easy and open the odin program.

3. Choose which stock rom you want to flash but make sure to unzip the rom so that you get the .tar.md5 file inside and you don't need that .dll file.

4. Now with odin open click on the PDA button and locate were you have the rom's .tar.md5 file and click on so it shows up in the File name window and click on the open button, and give it time for odin to load the file as it will take a bit and when done it will show the file in the PDA window.

5. Make sure only "Auto Reboot" and "F. Reset Time" is checked and the rest of the boxes don't need to be checked.

6. Now that odin is ready to flash, you have to get your phone into Download Mode..by first have the phone powered off and then hold the vol-down + power button at the same time and it should vibrate and then a warning screen should appear and release the buttons and then push on the vol-up button and you are now in download mode.

7. Now connect your phone to your pc and with odin still open from before you should see in the first ID:COM window light in blue and show something like 0:{COM4} in it..this means your device is connected and ready for flashing..make sure all other settings like described earlier in this post is set in odin.

8. Now you are ready to flash the rom and click on the start button and it will begin flashing and will take a bit to do and once done your phone will reboot and then you can unplug your phone from your pc and let the rom load as this will take a while also..and once it starts you can fill in the info you need when your first start a new rom..and you can now close odin.

Now that part is done..on to flashing TWRP recovery.

1. Open odin again and follow the procedure above in this post like how you did the rom to flash the TWRP recovery .tar file, but make sure that the Melius.tar file is for the mega 6.3 phone and the Crater.tar file is for the mega 5.8 phone from that link in my earlier post, and use the right .tar file according to what phone you have the mega 6.3 or the mega 5.8..BUT you change one setting only "Uncheck" the "Auto Reboot" as you don't want your phone to reboot after it is done flashing and the rest is all the same settings, like only have the "F. Reset Time" box checked and all the rest not checked.

2. Now put your phone into Download Mode again like describe earlier in this post.

3. Connect your device to the pc and make sure the ID:COM window lights up with your device id in it.

4. Double check that you have the right file and settings are what they are suppose to be and click on the start button and odin will begin flashing and will be done very quick and the bigger window above the ID:COM window will light up and say reset or pass and flashing is done.

5. Now unplug your phone from the pc and you will still be in the Download Mode which is okay.

6. Now you want to go back into the TWRP recovery right after your phone boots other wise it will not work, while still in the Download Mode hold the vol-up + power button until the phone shuts down and then quickly release the buttons and the then re-push on the vol-up + power button right away again and phone should vibrate and when you see the mega splash screen and in the top left corner of the screen in blue saying Recovery Booting.....and release the buttons and you should now be going into the TWRP recovery.

7. Once in the TWRP recovery and give it a few seconds tap on the reboot button and then it will give some selections and tap on recovery and it will then say the device is not rooted and it will ask if you want to root it with Superuser and you just slide that big round button icon across the screen and it will reboot into TWRP recovery and your phone will now be rooted.

8. Now you can leave TWRP recovery by tapping the reboot button and then tapping the system button and your phone will reboot and go into the rom.

9. Once you get back into your rom at some point it will ask to update the Superuser binaries and you will have a selection of PLAY or TWRP to update these Superuser binaries and choose the PLAY button and tap on it and it will take you to the Google play store (but make sure to have a google account otherwise you cannot get to the google play store) and you can then tap the update button and it update the Superuser binaries for you and after that is updated your are rooted and full Superuser permission..and that's it you are good to go and have fun with your rooted phone...and hope this info has helped you out. :D