วันอาทิตย์ที่ 4 ธันวาคม พ.ศ. 2559

How To Download Sony Xperia Official Firmware And Create FTF File

How To Download Sony Xperia Official Firmware And Create FTF File

When it comes to software updates for Android smartphones, Sony is going the best so far. In the past few months, Sony has been leaving all other manufacturers far behind in terms of Android software updates for its Xperia series. Sony has been rolling out updates, one after another and sometimes the users just get confused which one is the latest firmware and which one they should flash on their device, confusion with the firmware region is another thing that might occur. Since the firmware updates are rolled out through OTA or through Sony PC Companion, they take much time to hit different regions. Some regions receive the updates instantly while some receive the updates after long delay and this is something the Xperia enthusiast who are always willing to get the latest and greatest version of Android on their device, might not be able to tolerate. Users can also receive an update by changing the CDA of their device, but that can be done by going a little out of the way, and things should be kept as simple as possible.
xperia_M2
Updating your Xperia device manually is the best choice if the update isn’t hitting your region and you are not seeing it coming your way anytime soon. If you’re going to flash the Generic firmware on your device, you don’t actually need to worry about the region as well as the region specific firmware comes with some bloatware that you can probably remove from your device, but you need to be careful with flashing a carrier branded firmware on your device. Flashing the firmwares manually is possible through flashing a Flashtool Firmware File using Sony Flashtool. Although there’s  a number of people who post FTFs for different Sony Xperia Devices on the XDA developers forum as soon as a new update arrives, and there’s a number of some sites as well who post the FTF files, but you might just fail sometimes locating an FTF file of your choice for your Xperia device. In this case what you can do is, you can download the stock firmware from Sony’s server, create your very own FTF file and flash it on your device.
Before you start wondering how you can download the firmware from Sony’s servers, you may not be aware of Xperifirm, a great little application by XDA Senior Member LaguCool.  Xperifirm allows the Xperia device users to check the updates in all the available regions, and shows the build number as well. You can simply choose your desired firmware and download the FILESETs and then compile the FTFs in order to flash.  Downloadingthe firmware and compiling up the FTF might seem a difficult job, but it won’t be difficult anymore once you scroll down. In the succeeding guide we are going have a look on a comprehensive method that will help you to create the FTFs files successfully once you have downloaded the FILESETs for your desired firmware. Let’s start it now.
How to Download Sony Xperia Official Firmware FILESETs using Xperifirm:    
    1. First of all you need to know what’s the latest firmware for your device. You can always check the latest build number on Sony’s official site.
    2. Download and extract XperiFirm.
    3. Run XperiFirm application file now, the one with the black favicon.XperiFirm1
    4. Once XperiFirm opens up, you will see a list of devices.
    5. Click on your device’s, select the model number carefully.
    6. Once the device is selected, you will see the firmwares and their details in the next boxes.
    7. The tabs will be as
    • CDA: Country Code
    • Market: Region
    • Operator: Firmware provider
    • Latest Release: Build number
    1. Now see what build number matches the latest build number, and what region do you want to download it from.
    2. A firmware with the operator name like “Customized IN or Customized US” is a generic firmware, that means this firmware has no carrier limits of carrier boundaries. While other firmwares will be carrier branded.
    3. Make sure that you choose the firmware properly, do not download a Customized firmware on a Carrier Branded device and do not download a Carrier Branded firmware for an open device.
    4. Once you have selected your desired firmware, double click on it and in the third column within the same window, you will find your firmware’s build number. Click on and it will popup with the download option.XperiFirm2
    5. Click on download button and select the path where you want to save the FILESETs and let it download.XperiFirm3XperiFirm4XperiFirm5
    6. Once downloaded, head towards the next part where we will be compiling up the FTF file.
How To Create FTF Using Sony Flashtool:   
    1. Download and install Sony Flashtool on your PC.
    2. Now open Sony Flashtool.
    3. Now in Flashtool, click on Tools > Bundles > FILESET Decrypt.
    4. A small window will open up. Now in the source, select the folder where you downloaded the FILESETs using XperiFrim.
    5. Once you select the source folder, the FILESETs will be listed in the “Available” box. These FILESETs should be 4 or 5.
    6. Now select all FILESETs and push them into the “Files To Convert” box.
    7. Now click on “Convert”  and conversion will begin.Flashtool1
    8. It will take 5 – 10 minutes for the conversion to get completed.
    9. As soon as the FILESET Decryption ends, a new window “Bundler” will open up that will allow you to create the FTF file.
    10. If this doesn’t open up or you just close it accidentally, you can still access it by going to Flashtool > Tools > Bundles > Create and select the source folder where you downloaded and decrypted FILESETs.
    11. Now select the click on the empty bar in front of device from the device selector, enter firmware region / operator and enter firmware build number.
    12. Push all the files to Firmware Content except .ta files and fwinfo.xml file.
    13. Click on Create now.Flashtool2Flashtool3
    14. Sit back and wait for the FTF creation to finish.Flashtool4
    15. Once done, you can find your FTF in the installation directory > Flashtool > Firmwares.
    16. You can flash the firmware using our Sony Flashtool guide.
    17. You will also get a torrent file for the FTF. You may share it with others over the web.Flashtool5
    18. That’s all!


Follow Me

Usama M

+Usama M: Ex Farmviller | Android Fanatic | Software Engineer,Founder - TechBeasts.com

Unlock Xperia boot loader

Unlock the boot loader

Your unlock code: ##########
To complete the unlocking of your device, please follow the manual steps below carefully.
  1. Install the Android SDK and the device drivers

    1. Download and install the Android SDK.
    2. If you’re running Windows, you also need to download and install an updated Fastboot driver. This is the standard android_winusb.inf-file, with a few lines of code added to enable Fastboot to support Sony & Sony Ericsson devices. Replace the original android_winusb.inf-file with the downloaded file in the usb_driver folder, located in the Android SDK > extras > google folder on your computer. If you can’t find the usb_driver folder, make sure you are running Google USB Driver package revision 4 or higher in your Android SDK. If not, install the Google USB Driver Packager using the Android SDK manager.
    Note! If you’re running OSX or Linux, you are not required to install any additional drivers.
    3. On your device, turn on USB debugging by going to Settings > Developer options and click to enable USB debugging.
    As of Android Jelly Bean 4.2 the Developer options are hidden by default. To enable them tap on Settings > About Phone > Build Versionmultiple times. Then you will be able to access the Settings Developer options.
  2. Connect to Fastboot

    1. Turn off your Xperia™ Z1.
    2. Connect a USB-cable to your computer.
    3. On your Xperia™ Z1, press the Volume up button at the same time as you connect the other end of the USB-cable. For Windows users, when asked for a driver, point to the usb_driver folder where you placed the android_winusb.inf-file, and select the Android Boot loader Interface-file.
    4. When your device is connected, open a command window on your computer and go to the platform-tools folder within the Android SDK folder.
    5. Enter the following command:
    fastboot devices
    6. Verify that you get an answer back without any errors.
  3. Enter unlock key

    WARNING! The command below contains your unlock key. If you perform this step, you will unlock the boot loader. This may void your warranty and/or any warranty from your operator.
    1. If you still want to unlock the boot loader of your device, enter the following command:
    fastboot -i 0x0fce oem unlock 0xA7428CAA6299417A
    2. Verify that you get an answer back without any errors.
  4. Done!

    You have now unlocked the boot loader of your device. Return to Developer World for the latest developer news from Sony.

วันเสาร์ที่ 3 ธันวาคม พ.ศ. 2559

Insatall Ubuntu on the Sony Xperia Z1

minato


Bring-up of Sony Xperia line of devices based on AOSP 5.1.1 tree. Tested on Z1, Z2 tablet, Z3 Tablet Compact, Z5, Z5 Compact but not limited to.

Useful key combinations


Before you attempt flashing an Ubuntu image to your device, these key combinations should help you switch between phone modes.
  • Vol UP pressed + insert USB cable -> fastboot mode
  • Vol DOWN pressed + insert USB cable -> flash mode (used by Sony tools)
  • Vol UP + POWER, both pressed during 30 seconds -> hard reboot
  • Vol DOWN + POWER, no USB cable, stop pressing POWER after vibration -> recovery mode when it has been enabled and has a proper image (see below)
  • Small red button next to SIM, press it for a few seconds (you need a clip) until you get 3 vibrations -> power off

Current images


Built images ready to flash on a device are here. Ensure you download the boot.img and ubuntu.img files and then follow the flashing instructions below.

Flashing Ubuntu


1. Unlock the boot loader following Sony's instructions
2. Make sure that you have Android 5.1.1 in your Z1. Otherwise, flash it using the Sony official tools or unofficial tools that run in Ubuntu.
3. After that you can use fastboot to flash the images, by running these commands on the terminal:
sudo fastboot -S 256M flash boot boot.img
sudo fastboot -S 256M flash system ubuntu.img

Compiling from scratch


Alternatively, in addition to the ready-made images, if you want to contribute to development or modify those images, you can build them yourself following these instructions. These assume you've got knowledge of building software and you are familiar with the Ubuntu and Android source code. Current source tree is compatible with Sony’s binary blobs version 19a
Toggle line numbers
   1  Download Sony binaries (current tested version is AOSP L v19a)
   2  repo init -u https://code-review.phablet.ubuntu.com/aosp/platform/manifest -b personal/w-ondra/xperia-5.1.1_r36 -g all,-darwin,-qcom_msm8x26,-qcom_msm8x27,-qcom_msm8x74,-x86,-omap3,-omap4,-omap4-aah,-manta,-grouper
   3  repo sync
   4  . build/envsetup.sh
   5  lunch  -> Select desired target e.g Z5 aosp_e6653-userdebug
   6  make -j8
   7  this is optional step, if you want to use specific channel to build ubuntu root from, for example . ubuntu/prebuilts/prepare-ubuntu-packages-for-build -d generic -c rc-proposed/ubuntu-pd
   8  make ubunturootfsimage  -j8 -> build will downloads ubuntu rootfs and custom packages for default channel rc-proposed/ubuntu channel

Optional steps:
  • Use custom channel to build Ubuntu rootfs from:
    • after step 6 run: . ubuntu/prebuilts/prepare-ubuntu-packages-for-build -d generic -c rc-proposed/ubuntu-pd
    For 64bit devices (Z5, Z5c, Z4 tablet) custom build of libhyrbis needs to be used, to fix GPU crash
    • Run following after step 6
Toggle line numbers
   1  git clone https://code-review.phablet.ubuntu.com/ubuntu/libhybris-prebuilt ubuntu/libhybris-prebuilt -b personal/w-ondra/phabket-5.x-kitakami
   2   mmm ubuntu/libhybris-prebuilt/
   3   make snod

Port status


The port is in its early steps and feature set differs between devices, there are many things that do not work. Some of the stuff that does work is:
Device
what is working
known issues

Z1 (honami)
Unity8/wifi/SMS/data/audio
Power handling/BT/camera/MHL/phone calls

Z Ultra (togari)
Unity8/wifi/SMS/data/audio
Power handling/BT/camera/MHL/phone calls

Z2 Tablet(castor)
Unity8/audio
Power handling/BT/camera/MHL

Z3 Tablet compact(scrorpion)
Unity8/audio
Power handling/BT/camera/MHL

Z5 (sumire)
Unity8/wifi/SMS/data/audio
Power handling/BT/camera/MHL/phone calls

Z5 compact (suzuran)
Unity8/wifi/SMS/data/audio
Power handling/BT/camera/MHL/phone calls

Generic known issues


  • Power handling.
    • Device does not power off completely. When usb cable is plugged and unplugged, power button fails to switch off screen.
    • suspend does not works properly
  • MHL does not work
  • Camera does not work and eventually crashes device
  • phone calls do not work
  • generic stability

Development tips


  • (re)building boot image
Toggle line numbers
   1  $ make bootimage
   2  - repackage boot image without rebuilding dependencies
   3  $ make bootimage-nodeps

  • (re)build recovery image
Toggle line numbers
   1  $ make recoverytimage
   2  - repackage boot image without rebuilding dependencies
   3  $ make recoveryimage-nodeps

  • repackage android ramdisk. !! Android ramdisk is contained in Android system image
Toggle line numbers
   1  $ make ramdisk-nodeps

  • rebuild Android part without checking dependencies
Toggle line numbers
   1  $ make snod

  • Build Ubuntu image ( this will download latest rootfs and custom adds local Android image and packs all in image)
Toggle line numbers
   1  $ make ubunturootfsimage

  • re-build Ubuntu image without checking dependencies, use this to create image with local changes
Toggle line numbers
   1  $ make ubunturootfsimage-nodeps

  • build device package
Toggle line numbers
   1  $ make device package
   2  - without checking dependencies
   3  $ make devicepackage-nodeps

  • rebuilding Ubuntu image, with new changes contained in Android image
Toggle line numbers
   1   - build changes in Android code 
   2   $ make
   3   - copy updated Android image so it is picked when we are repacking Ubuntu image
   4   $ cp out/target/product//system.img out/target/product//ubuntu/rootfs/var/lib/lxc/android/system.img
   5   - repack Ubuntu rootfs without checking dependencies
   6  $ make ubunturootfsimage-nodeps

  • rapid development with adb sync
When doing changes on Android side, sometimes there is need for quick iterations, for this case best is to use adb sync feature. You will have to make sure to use eng build, as you will need to run adb daemon as root. You will also have to make sure to have enough spare space in Android system image.
Toggle line numbers
   1 Preconditions:
   2     - Preparation: prepare Android system image with 30MB padding space
   3     $ BOARD_SYSTEMIMAGE_PARTITION_PADDING=3145728 make -j8
   4     or without dependencies
   5     $ BOARD_SYSTEMIMAGE_PARTITION_PADDING=3145728 make snod -j8
   6     - Create Ubuntu image with new Android system image
   7     $ cp out/target/product//system.img out/target/product//ubuntu/rootfs/var/lib/lxc/android/system.img
   8     $ make ubunturootfsimage-nodeps -j8
   9 
  10     - Flash device with new Ubuntu image.
  11     - once device is booted, using adb add following two files:
  12     $ touch /userdata/.writable_image
  13     $ touch /userdata/.writable_device_image 
  14     - reboot
  15     - once device is booted, check that '/' and '/android/system' are mounted as 'rw'
  16 
  17 Iterating through  changes:
  18     - restart adb as root
  19     $ adb root
  20     - make and compile changes in Android, you do not need to run make in root, to recreate Android system image
  21     - e.g.
  22     $ mmm frameworks/av/media/libmedia
  23 
  24     - sync all changes with device. Be careful if you change is executable can you restart it, if it's shared lib, can you make system reload it, if it's config file can you make system reload it? Ultimately reboot is always safest option if you do not know
  25     $ adb sync

Touch/Devices/minato (last edited 2016-07-29 08:45:25 by w-ondra)

Credit : http://www.omgubuntu.co.uk/2016/02/ubuntu-phone-sony-xperia-oneplus-one