Monday, September 1, 2014

Rooting and flashing Sony Xperia J ST26i

Writing this post after successfully flashing Sony Xperia J ST26i with DARK MOON AVD ROM

I followed the instructions given in
http://forum.xda-developers.com/xperia-j-e/development/st26i-dark-moon-avd-rom-4-1-2-v1-6-t2309415

Steps:
PART 1:

Take a backup of your contacts, sd card etc. I used My phone Explorer

Update the phone's firmware
Go to Settings > About phone > Software updates > System updates
or use SONY PC Companion

PART 2:

Unlock BootLoader
Followed the steps given here
http://www.android.gs/unlock-bootloader-sony-xperia-devices-universal-tutorial/

How to Unlock Bootloader of Sony Xperia Devices (official and universal tutorial)
  1. Go here and check whether your smartphone is on the “unlock bootloader” list or not. If your phone is not listed there it means that you cannot use this guide for unlocking the system.
  2. Also, on your handset type and dial: *#*#7378423#*#*; then go to “Service info -> Configuration -> Rooting Status” and check if the “Bootloader unlock allowed” says yes. If the “no” answer will be displayed then you will not be able to unlock the bootloader of your device.
  3. Now, extract the file named “downloadinf.zip” (which has been downloaded before) on your computer.
  4. Then, copy the obtained file (“android_winusb.inf”) to path c:\android-sdk\extras\google\usb_driver.
  5. Click yes if asked to overwrite something.
  6. Type *#06# on your phone and get the IMEI number; write it down as you will need it a little bit later.
  7. Now, go here.
  8. On the first page click on “Yes, I’m sure”.
  9. Agree to Sony’s legal terms and then hit “I accept”.
  10. On the next page enter your name, email and your device’s IMEI number and click on “Submit”.
  11. An unlock code will now be offered; note it down.
  12. Turn off your device and connect the same with the computer by pressing on the Menu button (for the Xperia arc, Xperia arc S, Xperia neo, Xperia neo V, Xperia pro handsets), or on the Search button (for the Xperia Play device) or on the Volume Up button (for the Xperia mini, Xperia mini pro, Xperia ray, Xperia active, Live with Walkman, Xperia S smartphones).
  13. Install the drivers on the path mentioned above (c:\android-sdk\extras\google\usb_driver).
  14. Now, on your computer open command prompt: “start -> run -> type cmd”.
  15. On the cmd window enter the following commands (one at a time): cd C:\android-sdk\platform-tools; fastboot.exe -i 0x0fce getvar version; fastboot.exe -i 0x0fce oem unlock 0xKEY (replace key with the code obtained before).
  16. That’s all, now the bootloader will be unlocked.
  17. In the end, remove the USB cable and reboot your smartphone.

Problem Faced: STEP 13  The driver to be installed was not accepted by the system.
Soln: 
Hold down the Windows key on your keyboard and press the letter C to open the Charm menu, then click the gear icon (Settings).

Click More PC Settings.

Click General.

Under Advanced Startup, click Restart Now.

NOTE: In Windows 8.1, the ‘Restart Now’ button has moved to ‘PC Setting -> Update & Recovery -> Recovery.’

After restarting, click Troubleshoot.

Click Advanced Options.

Click Windows Startup Settings.

Click Restart.

After restarting your computer a second time, choose Disable driver signature enforcement from the list by typing the number 7 on your keyboard.

Your computer will restart automatically.

After restarting, you will be able to install the  drivers normally; however, Windows will display a warning message. When the warning appears, click Install this driver software anyway

Soln from:  https://learn.sparkfun.com/tutorials/disabling-driver-signature-on-windows-8/disabling-signed-driver-enforcement-on-windows-8

So after unlocking your bootLoader.

PART 3:

Download from here
AVD Rom Latest Release

Addon Archive

Kernel ftf

FIXES_FOR_AVD_1.6_V.zip


place Rom & Addon zip on externel sdcard


Place the downloaded file ClockworkMod-6.0.2.5.img into the folder  C:\android-sdk\platform-tools

Instructions:
  • Download ClockworkMod from the link above
  • Switch off phone
  • Hold Vol-UP button
  • Insert USB cable, wait for blue light
On the cmd window enter the following commands (one at a time): cd C:\android-sdk\platform-tools
type:
run fastboot flash boot ClockworkMod-6.0.2.5.img

and then type
run fastboot reboot

  • when the purple LED shines, press and hold the Vol-UP button
You are now in ClockworkMod Recovery!

Wipe data/factory reset, wipe cache partiton, go to advanced wipe dalvik cache. then go to mounts & storage format system.

Go to install zip from sdcard choose zip from externel sdcard. flash rom

when installation is finished go back to advanced choose fix permissions



PART 4:

Now we need to download and install flashtool 
After installing it. 

The Kernel ftf  that you downloaded
"st26i_11.2.A.0.31 Kernel By Gavster26@XDA_Central Europe.ftf" needs to be extracted. 
You need to have 7Zip or any other file extracting programs.
Once you are done extracting you will find a file called kernel.sin 

follow the instructions in the video
Note: u need to browse for the kernel.sin file that you extracted.


Note:Be careful while browsing and selecting the right file, I happened to choose the wrong one and my phone would not startUp but I retried with the right file and it worked.
Now Flashing of new kernel is done.

PART 5:

Next for Addon Package: It is the same as the instructions in part 3. 
Except that here we select the addon package zip from sd card 
After that follow PART 4 (Flash the kernel again)

PART 6:
The file you downloaded FIXES_FOR_AVD_1.6_V.zip extract it and place the files on sd card.

Download Root Browser place it on ur phone SD card.

Start your phone and install the RootBrowser APK that you downloaded.

Now open it up and copy systemui.apk from the extracted files of FIXES_FOR_AVD_1.6_V.zip to /system/app give permissions rw-r-r
Note: there will already be a copy of systemui.apk rename it to sytemui_copy.apk and then push/copy the file. Tap and hold on the file for long and select permissions from the menu and give it as rw-r-r

Similarly copy  framework.jar to system/framework give permissions rw-r-r
Note: there will already be a copy of framework.jar rename it to framework.jar_copy.apk and then push/copy the file. Tap and hold on the file for long and select permissions from the menu and give it as rw-r-r

You are done.
Be careful while flashing/rooting/unlocking as the methods vary from each model.
Refer XDA forums when in doubt.