Friday, March 7, 2014

Donate Bitcoins

How to create ODIN flashable rooted packages

Hello Everyone!

All of us, who own a Samsung device, need Odin Flash to go back to stock firmware.
This is done for various reasons like you want to flash a new ROM, so going to use stock ROM to serve as a base
or simply love stock ROM because of its stability.

However there is a catch. As soon as you flash the firmware, you lose root access.
Then starts the process (oftenly boring as you do it many times) and not to mention wear and tear of hardware buttons in recovery.
But this is easily solved by converting the firmwares into prerooted ones. You can put Superuser/SuperSU (and/or) busybox.

I assume you use 3 file flashing. PDA, PHONE (that is MODEM) and CSC.

Now coming to the point, there are 3 cases.
1) Firmwares which are in rfs and converted with simg2img
2) Latest firmwares which are based on ext4 (These files when extracted they are named as system.img.ext4 etc.)
3) Firmwares which show "bad magic" with simg2img (like galaxy y firmwares)






Quote:
Prerequisites:-

1) Linux Environment (virtualbox can work) (I use Ubuntu 12.04 VBOX) (for case 3 cygwin will work)

2) Ability to transfer files from Virtualbox to Host (Refer here)

3) ext4_utils from here (They are required only for first 2 cases) (Put them in working folder)

3) Usable brain (must be dual core) Download Link:- Error 404: File encrypted to keep trolls away 


Quote:


CASE 1:- rfs format with simg2img support
Credits to dr.ketan

1) Download 3 file firmware from XDA Forum of your device. (skip steps 2 & 3 if you have done this)

2) Download firmware from Sammobile It will be named as xxxx_xxxx_HOME.tar.md5

3) Split it if required into PDA, PHONE & CSC. (We need only PDA file, take it to Linux PC/VBOX)

But if your phone firmware doesn't have PDA, CSC etc flashing, then rename xxxx_xxxx_HOME.tar.md5 to xxxx_xxxx_HOME.tar (I assume you know how to CHANGE FILE EXTENSION BY RENAMING)

Then extract it by WinRAR/7zip anything. You will get boot.img, system.img etc. Then at last step you make tar of these extracted files.

4) Extract it
Code:
tar xvf {your PDA file name here}.tar.md5
5) Convert it to ext4 to make it mountable.
Code:
./simg2img system.img newsys.img
Then delete old system.img

6) Create temp folder and mount it.
Code:
mkdir temp
mount -o loop newsys.img temp
7) Add root app (I am adding Superuser.apk), su binary and busybox.
Code:
cp su temp/xbin/su
chmod 06755 temp/xbin/su

cp Superuser.apk temp/app/Superuser.apk
chmod 0644 temp/app/Superuser.apk

cp busybox temp/xbin/busybox
chmod 04755 temp/xbin/busybox
8) Convert newsys.img to samsung system.img format.
Code:
./mkuserimg.sh -s temp system.img ext4 tempdir 2048M
# 2048M is the size of system.img
9) Unmount and delete temp folder.
Code:
umount temp
rmdir temp
10) Create tar file and add md5 checksum
Code:
tar cvf prerooted.tar boot.img cache.img hidden.img modem.bin recovery.img sboot.bin system.img tz.img
#Please add files which you get in step 4

md5sum -t prerooted.tar >> prerooted.tar
mv prerooted.tar prerooted.tar.md5
11) Now flash this output file from Odin.
Source: XDA-Developers

No comments:

Post a Comment

Bitcoin

Contributors

Created and designed by © Faruhaan