[GUIDE/TUTORIAL/HOWTO] Sony Xperia Z2 Tablet Stock to Android 11

Search This thread


New member
May 28, 2022
Hi, do you mean you can't access Sony's bootloader unlock page ?
yes, i just can't get access
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    [GUIDE/TUTORIAL/HOWTO] Sony Xperia Z2 Tablet Stock to Android 11
    [GUIDE/TUTORIAL/HOWTO] Sony Xperia Z2 Tablet (LTE/castor or Wi-Fi/castor_windy) Stock to Android 11 R / LineageOS 18.1

    This detailed step-by-step guide helps you transform your Sony Xperia Tablet Z2 to a powerful one with Android 11.
    Netflix, Disney+ and my bank app work as 2021/10/31, gestures navigation too.


    - Make sure you are with a Xperia Tablet Z2
    Go to Menu > Settings > About tablet > Model number is: SGP511 (16 GB), SGP512 (32 GB) or SGP521 (LTE, 16 GB).

    - Make sure bootloader is unlockable
    With LTE device, you can dial *#*#7378423#*#* > Service info > Configuration > Rooting Status

    With Tablet Z2 Wi-Fi:
    Open Contacts app > Menu button (3 dots vertical icon in top right corner) > Settings.

    Screen shows Accounts & Sync item.
    Long press screen (10 seconds) right above the Home icon of bottom navigation bar and release to reveal Enter service code button.

    Tap on it and dial *#*#7378423#*#* to reveal Service menu > Service info > Configuration
    Look at the Rooting status item: Bootloader unlock allowed: Yes
    If No, you can cry, you cannot get further.

    ### You must be logged as a Microsoft Windows administrator to run console commands below.


    v3. Images to describe "Bootloader unlock allowed", fix flash:raw command and flash TWRP command
    v2. Improve TWRP flash and boot, FTF stock ROM and backup
    v1. Initial release


    - djibe Xperia Tablet Z2 pack: https://bit.ly/djibe-xperia-tabletz2
    (contains Tablet Z2 USB drivers + adb + fastboot + TWRP TWRP-3.4.0-sc-1 by SpiritCroc + Android 10 boot.img)

    + ROM LineageOS Unofficial 18.1 https://forum.xda-developers.com/t/rom-unofficial-lineageos-18-1-for-castor-castor_windy.4261491/
    Download latest build for LTE (castor) or Wi-Fi (SGP511 or SGP512/castor_windy): https://androidfilehost.com/?w=files&flid=321424&sort_by=date&sort_dir=DESC

    See here if you prefer Official LOS 17.1: https://download.lineageos.org/castor

    + BitGApps Package ARM 11 (R44+): https://forum.xda-developers.com/t/custom-gapps-bitgapps-for-android.4012165/post-81060605
    Download latest build: https://github.com/BiTGApps/BiTGApps-Release/releases

    + a microSD card. Copy ROM (*_windy.zip for WiFi-only version), BitGApps, Magisk (optional) on microSD card and insert it in tab.

    + Charge tablet to 100%.


    Right click on Windows Start menu > Device manager.
    Right click on Computer's name (top of devices list) > Add legacy hardware.
    Set folder's path of my Xperia_Z2_Tablet_driver_R2/ folder.
    Click Next to install.

    Reboot Windows.


    On tablet, go to Menu > Settings > About tablet > Status > IMEI Information
    Note the IMEI. Store it.
    ### With Wi-Fi variant, note the IDID


    On tablet, go to Menu > Settings > About tablet > Build number
    Make sure it is 23.5.A.1.291 and tap 7 times on it to unlock Developer options.
    If not 23.5.A.1.291, go to Menu > Settings > About tablet > Software update > System updates tab

    ### Don't go further if you are not with 23.5.A.1.291 firmware.

    Go to Menu > Settings > Developer options > USB debugging, switch it ON and confirm it in next Dialog.


    From your PC, go to: https://developer.sony.com/develop/open-devices/get-started/unlock-bootloader/
    At the bottom of the page, in Select your device: Select Xperia Z2 Tablet (for LTE) or Xperia Z2 Tablet WiFi
    Enter your IMEI or IDID (see Chapter 3) + check both checkboxes after this.
    Copy the unlock code.

    ### Some could advise you to backup TA, but who cares of Xperia features in 2021 (and long-gone warranty) ?


    Connect tab to USB.

    Open the flash/ folder from my pack.
    In Windows address bar, type "cmd" and hit Enter. A Windows Command window will open.
    Now type
    adb devices
    Command returns: List of devices attached
    YT91190206 unauthorized

    If no Allow USB debugging? screen shows up on tab, disconnect and reconnect tablet.
    Check ON always allow from this computer and tap on OK.

    Enter command:
    adb reboot bootloader
    Tablet restarts and a blue light appears in top right corner.
    Go back to Windows Device Manager.
    Z2 tablet has a yellow triangle in Mobile devices and is called S1Boot Fastboot.
    Right click on it > Update driver > Browse my computer for drivers > Choose from a list > Force Sony sa0111 ADB Interface Driver (at the bottom of the list).

    Now you can enter command:
    fastboot devices
    Command returns: YT91190206 fastboot


    ### All data will be lost

    Fill the command with your Unlock Code:
    fastboot oem unlock 0xYOURUNLOCKKEY
    confirm with Enter. After 10 seconds, it is displayed OKAY.
    Bootloader is unlocked !


    Still in fastboot, type in console:
    fastboot flash:raw boot boot-windy.img
    . Confirm with Enter (boot.img is LOS 17.1)
    ### For LTE/4G variant, replace with: boot.img
    ### If error FAILED (remote: Command not allowed): re-enter command
    fastboot oem unlock 0xYOURUNLOCKKEY
    and continue

    Then type in console:
    fastboot flash recovery TWRP-3.4.0-sc-1_castor_windy_20200606_1419.img
    . Confirm with Enter.
    ### For LTE/4G variant, replace with: TWRP-3.4.0-sc-1_castor_20200606_1419.img

    Power off tablet: disconnect from USB OR hold Volume+ + power until it vibrates 3 times.
    Power on tablet: press only power button.
    Wait until the LED goes purple, then press Volume+ once.
    TWRP shows up.

    Thanks to @therealraser.


    You are now in TWRP recovery, Swipe to Allow Modifications.
    Go to Backup, select Boot, EFS, System partitions.
    Tap on Select Storage and select MicroSD Card.
    Swipe to Backup.

    Go to TWRP Home screen.
    Go to Wipe > Format Data, type yes and tap on bottom right check icon.
    Go to Wipe > Advanced Wipe > Select Dalvik, Cache, Data, Internal Storage, System and swipe to confirm erasing.


    Back to TWRP home menu.
    Go to Install > Select Storage > Micro SD card > OK
    Select lineage*.zip.
    ### If you get an error and flash fails, go to Reboot > Recovery and wait for TWRP to reboot.
    Add more zip > BitGapps*.zip file,
    Swipe to confirm flash.
    Wait while Install Zips are flashed.
    At the end, tap on Wipe Cache/Dalvik, then Reboot System.

    Wait during boot.
    (Google search app will probably crash during Setup).

    11) TWEAKS

    Go to Settings > About tablet > Tap 7 times on Build number.

    Go to Settings > System > Advanced > Developer options.
    Advanced restart switched ON (Hold power > Restart > Restart to recovery to access TWRP easily later)
    Android debugging switched ON
    Windows animation scale to Animation scale .5x
    Same for Transition animation scale and Animator duration scale to improve reactivity

    For faster GPS fix, use GPS Status and Toolbox and download A-GPS data.

    Your tablet is a rocket, enjoy ;-)

    Thanks: LineageOS team, TWRP team, BitGApps team, @qsnc, @SpiritCroc, TopJohnWu


    ### Sony Xperia Z2 Tablet boot to recovery:

    Everyone is telling nonsense about how to boot to recovery.
    Shutdown tab.
    Stock boot image: Power it on, when LED is green, hold Volume- until LED becomes blue, then release and tab will restart to TWRP recovery.
    LineageOS boot: Power it on, when LED is purple, press Volume+

    Many thanks to @jaset_uk

    ### Force shutdown

    Bootloop ? Hold Power + Volume+ until tablet vibrates 3 times and release buttons.

    ### ROM and TWRP backups

    Bricked tablet like I did ?
    I saved usefull files there: https://www.androidfilehost.com/?w=files&flid=329886

    ### Sony Xperia Z2 Tablet Stock ROM Android 6.0.1

    Download FTF stock ROM: https://www.androidfilehost.com/?fid=7161016148664843282
    Download Sony Mobile Flasher: https://www.androidfilehost.com/?fid=7161016148664843280
    Follow tutorial: https://stockromfiles.com/sony-xperia-z2-tablet-sgp512-stock-rom/

    Or with Sony Falshtool: https://developer.sony.com/develop/open-devices/get-started/flash-tool

    Many thanks to Boopathy Sundaramoorthy
    Okay, I finally got TWRP 3.4.0 running:D

    - downloaded LineageOS 17.1 .zip
    - unpacked LOS .zip
    - fastboot flash boot boot.img
    - fastboot flash recovery TWRP-3.4.0-sc-1_castor_windy_20200606_1419.img
    - power off device (hold volume up + power until it vibrates 3x)
    - power on device (press only power button)
    - wait until the LED goes green, then press volume up once, LED will switch to blue
    - TWRP appears

    Using the default boot.img from a stock FTF the LED will NOT be on during boot -> no entering recovery possible. Using the boot.img from LOS this will work.

    Happy flashing!
    Thank you for the guide, I'm having issues getting Netflix through the playstore though.
    I've used it to update both 17.1 and 18.1, didn't root, and yet on both versions, the playstore does not return Netflix as one of the results. Any idea why this might be?

    I'm on the wifi tablet, if that matters
    Hi, what about using Aurora Store ? https://apkpure.com/aurora-store-mobile-market-helper-app-2021/com.lamyae.AuroraStoreMobile
    I wanted to reply to this thread regarding my issue and the way i found the solution, for anyone out there facing the same problem i have, maybe this could shed a light in your path.

    I'm a complete noob when it comes to android, but i've had my share of flashing back in the days with samsung mobile devices, and let me tell you Sony devices seem pretty damn hard to deal with especially this tablet.

    When trying the steps explained on this thread, i ran into an issue where my tablet would not turn on (after flashing the .img suggested on this thread) and a red light would blink then nothing would blink at all (just a black screen). I managed to enter fastboot mode by connecting the USB cable and holding the power up button, and flashed the AICP 15.0 ROM (by this time i already flashed TWRP .img).
    After shutting down the tablet and turning it on, the sony logo appeared and device would blink a purple light and enter fastboot mode automatically, by the time the purple light would flash i just pressed the volume up button and there i am into TWRP recovery.
    After that, i didn't have a SD Card so i basically used the sideload Mount method to extract the ROM and flash it through TWRP.
    So this is how i managed to flash my device. Now for anyone out there who wanted to get the stock Sony Firmware running on their tablet again, all i did was go to sony official website and download their flasher and followed the steps needed. Some of you may ask, why go into the trouble of flashing Android 11 then go back to sony's firmware, well you got a point there but my situation was pretty weird, since the password to unlock the tablet was forgotten and this tablet belonged to a family member, there was no way to hard reset it but this way:LOL:.
    I want to say thank you to this thread and all the people in the XDA community, below you will find the links needed of all the things that i mentioned.

    AICP 15.0 FILES: https://media.aicp-rom.com/vault/castor_windy/
    AICP 15.0 Thread on XDA: https://forum.xda-developers.com/t/...0-q10-0-castor-_windy-sony-z2-tablet.4047535/
    Sony's official flashtool: https://developer.sony.com/develop/open-devices/get-started/flash-tool

    Also, you can message me anytime you want if you find yourself in the same situation as me and you need help, i will try to get back to you as soon as i can.


    HUGE!! thank you!!
    your detailed steps helped recover my Z2 from a soft brick caused by updating Magisk v24.2
    weird thing is, it screwed it up so bad, that even FlashTool had trouble with error "The bundle does not match the connected device"

    Z2 is not back online running LineageOs 18.1