[Xperia Tablet Z Q&A, Help & Troubleshooting] djibe89:
[GUIDE/TUTORIAL/HOWTO] Sony Xperia Tablet Z LTE or Wifi Any version to Android 9 Pie

[GUIDE/TUTORIAL/HOWTO] Sony Xperia Tablet Z SGP321 LTE/4G (pollux) or Wifi (pollux-windy) Any version to Android 9 Pie / LineageOS 16

This detailed step-by-step guide helps you transform your Sony Xperia Tablet Z to a powerful one with Android 9 Pie.

Supported models:

- SGP321 = Pollux (4G)

- SGP311 and SGP312 = Pollux_windy (Wi-Fi only, respectively 16 and 32 GB)

To make sure your tablet is supported:

On the tablet, go to Menu > Settings > About tablet. Check that the "model number" is listed above.

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

### When you lose control of your Xperia tablet Z, hold Power + Volume+ until tab restarts.

CHANGELOG

v15. Magisk 26.2 + safetynet

v14. If you want Magisk, use v25.2+

v13. Drop Magisk (if you want it, use v24.1), update pack

v12. Permanent TWRP recovery, overclock with Smartpack kernel manager

v11. Move to Android 9, replace addonsu with Magisk root, revert to 2016 adb + fastboot (fastboot flash fails with latest versions), fix glitches in tutorial

v10. Updated pack for TWRP 3.4.0-0 + LOS download links

v9. Updated pack for TWRP 3.3.1-0

v8. Moved to Official LineageOS 15.1 available to bring you Android 8.1 Oreo

v7.2. Refresh OpenGapps download link

v7.1. Refresh pack v2 (TWRP 3.2.3-0) and tutorial

v7. recovery TWRP 3.2.2-0 and new FOTAKernel installation

v6. Google Play certification, recovery TWRP 3.2.1-0, new pack for easier install

v5.5. Overclock

v5. Updated tutorial to latest ROMs and utils

v4. Upgraded tutorial

v3. Moved to Android 7.1

v2. Tutorial updated for permanent recovery, Black kernel, pack has no more missing fastboot files, drivers included, F2FS optimizations

v1. Initial release

1) DOWNLOAD FILES

- djibe Xperia Tablet Z pack: http://bit.ly/djibe-xperia-tabletz-v2

(contains Xperia USB drivers + adb + fastboot + recovery TWRP 3.4.0-0 for both LTE/4G/Pollux version and Wifi/Pollux_windy + Magisk + MagiskHidePropsConf-v6.1.2 + safetynet-fix-v2.4.0)

### Want to try Android 13 on your Xperia Tablet Z ? Go to https://xdaforums.com/t/rom-13-0-unofficial-lineageos-20-0-pollux-beta.4637094/

+ ROM Unofficial LineageOS 16: https://forum.xda-developers.com/xperia-tablet-z/orig-development/rom-lineageos-16-0-t3924942

Download latest build for Tablet Z LTE/Pollux: https://www.mediafire.com/file/lwx9fmudnixv668/lineage-16.0-20220131-UNOFFICIAL-pollux.zip/file or https://androidfilehost.com/?fid=16385555061192791960

Download latest build for Tablet Z Wifi-only/Windy: https://www.mediafire.com/file/lwx9fmudnixv668/lineage-16.0-20220131-UNOFFICIAL-pollux.zip/file

WARNING. Download correct version, Pollux for your 4G/LTE model, Pollux_windy for your Wifi-only model

ROM backups: https://androidfilehost.com/?w=files&flid=140468&sort_by=date&sort_dir=DESC

+ BitGApps ARM 9 v2.7+ MINI (or other variant): https://github.com/BiTGApps/BiTGApps-Release/releases

or OpenGApps ARM 9 Nano: https://opengapps.org/?arch=arm&api=9.0&variant=nano

+ a microSD card. Copy ROM, OpenGApps, +/- Magisk on microSD card and insert it in tablet.

+ Charge tablet to 100%.

NB. Use a USB2 port to connect tablet to PC.

2) INSTALL DRIVERS

Commands below are for Windows 10 installation of unsigned drivers.

### For other Windows versions, Google "windows X install unsigned driver".

On the keyboard of PC, use "Windows key + R" combo.

In the command prompt that opens, type:

shutdown -r -t 0 -o

This opens a Windows menu:

Go to Troubleshooting > Advanced Options > Settings > Restart

Upon restart, press on keyboard : key 7 - Disables drivers signature verification

After boot,

Start Flashtool Xperia Driver Pack 1.9,

check the Fastboot drivers, ADB and Xperia Z tablet drivers, start the installation and confirm the

forcing the driver installation. It ends by saying that everything was installed.

Restart Windows.

3) IMEI NUMBER

On tablet, go to Menu > Settings > About tablet > Status > Information on the IMEI code

Note the IMEI. Store it.

4) GENERATE BOOTLOADER UNLOCK CODE

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 Tablet Z (or Tablet Z Wifi).

Enter your IMEI and check both checkboxes.

Copy the unlock code on next page.

5) CONNECT TAB IN FASTBOOT MODE

Tablet powered off, hold "Volume up" while you plug the tablet in USB.

The blue light appears next to microSD cable, the drivers install in Windows.

6) UNLOCK BOOTLOADER

In Windows, copy the path to the "flash" folder you unziped earlier.

Open a Windows command prompt : Start menu > Command prompt > Start as administrator

Then type

cd /d thePathToFlashFolder

(ex: E:\root\Sony Xperia Tablet Z SGP321 Pollux\djibe Xperia pollux Pack\flash)

Type:

fastboot -i 0x0fce getvar Version

If a line is returned, drivers are correctly installed.

### Use fastboot and adb from my pack

Paste the following line (written at the end of the page issued by Sony) :

fastboot oem unlock 0xYOURUNLOCKKEY

confirm with Enter. After 2 seconds, it is displayed OKAY.

Bootloader is unlocked !

7) FLASH TWRP RECOVERY 3.4

Still in fastboot, type in console :

fastboot flash boot twrp-3.4.0-0-pollux.img

(or twrp-3.4.0-0-pollux_windy for Wifi model). Confirm with Enter.

Wait, then once the confirmed success,

type :

fastboot reboot

(confirm with Enter).

AND while it restarts, repeatedly click Volume+ AND Volume- buttons to access the recovery (can take a while).

8) BACKUP CURRENT ROM

You are now in TWRP recovery, swype to unlock changes.

Go to Backup, select all partitions.

In Storage, select microSD Card then OK.

Then swype to start backup (Well, hums, it failed on my tablet ;-) ).

Click the TWRP icon to return to home.

Go Wipe > Wipe Advanced > Select Dalvik, System, Cache, Data and swipe to confirm flash.

### If errors are displayed in red "failed to mount data (invalid argument)" appear (as I had),

### go to Wipe > Data Format, type yes and click OK.

9) FORMAT TO F2FS

INFO. F2FS is the fastest filesystem for read and write partitions on flash memories. Compared to EXT4, gain is from 15 to 280 %.

No need to format the /System partition because it is Read only and EXT4 is still faster.

Still in Advanced Wipe menu,

select the /Cache partition and tap Repair or Change File System > Change File System and select F2FS.

Confirm with a Swipe to Change.

Do it again for the /Data partition.

### Any partition problem ? Bootloop ? Format every partition back to EXT4, wipe all partitions and reflash Zips.

Go to Reboot > Recovery.

10) INSTALL ROM, GAPPS +/- MAGISK

Back to TWRP home menu.

Go to Install > select lineage*.zip.

### If no file is visible, click Storage > select microSD Card.

### If you get an error and flash fails, go to Reboot > Recovery and wait for TWRP to reboot.

Go to Reboot > Recovery and wait for TWRP to reboot.

Back to Install > bitgapps*.zip and swipe to flash.

Go to Reboot > Recovery and wait for TWRP to reboot.

Back to Install > magisk*.zip and swipe to flash.

At the end, select Wipe Dalvik and cache and then Reboot system.

11) ROOT ACCESS (OPTIONAL)

### Needed to work with Netflix or Disney+

Configure Android as you like.

No need for extra work to be root.

Magisk launches with Android.

Superuser permissions can be managed from Magisk Manager app.

### If no Magisk app is found, copy Magisk.zip and rename it to Magisk.apk and install it using Files app.

Launch Magisk.

Then in Magisk go to Settings > Hide the Magisk app, give it a name and switch Zygisk option ON.

Go to Modules Tab > Install from Storage: install MagiskHidePropsConfig and safetynet (located in my archive).

Unlock Developer options: go to Settings > About.

At the bottom, tap 7 times on Build number.

Go to Settings > System > Advanced > Developer options > Disable Android debugging (ADB).

Reboot phone.

12) PERMANENT TWRP RECOVERY AND TWEAKS

To keep TWRP recovery permanently, you need to flash it to a smart location: the FOTAkernel partition.

Now Settings > System > Advanced > Developer options.

Advanced restart switched ON (Hold power > Restart > Restart to recovery to access TWRP easily later)

Root access > ADB only

Android debugging switched ON

Windows animation scale yo Animation scale .5x

Same for Transition animation scale and Animator duration scale to improve reactivity

Connect tablet to PC.

Re-open a Windows command on my /flash folder.

Enter commands in order:

adb devices

On tab, grant ADB access

adb root

adb wait-for-device

adb push twrp-3.4.0-0-pollux.img /tmp/twrp.img

Command returns: 2600 KB/s (12103680 bytes in 4.544s)

and finally

adb shell dd if=/tmp/twrp.img of=/dev/block/platform/msm_sdcc.1/by-name/FOTAKernel

It will output

> 23640+0 records in

> 23640+0 records out

> 12103680 bytes transferred in 2.864 secs (4226145 bytes/sec)

You are done with flashing ! Congratulations.

13) OPTIONAL: OVERCLOCK

Open built-in Files app.

Open microSD folder.

Install Smartpack Kernel Manager app from my pack.

Launch app and grant root access.

Go to CPU menu > Apply on boot, CPU Maximum Frequency 1728 MHz

CPU min: 192MHz

Governor: ondemandplus

14) Others

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, OpenGApps team, Flashtool Xperia Driver pack team, @CaHbKaUp, @CyberWalkMaN, @AdrianDC, Chippa_a, @Rootk1t