[Xperia Z4 Tablet General] djibe89:
[GUIDE/TUTORIAL/HOWTO] Sony Xperia Z4 Tablet Stock to Android 11

[GUIDE/TUTORIAL/HOWTO] Sony Xperia Z4 Tablet (LTE/karin or Wi-Fi/karin_windy) Stock to Android 11 R / LineageOS 18.1

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

Netflix and Disney+ work as 2023/03/22.

BEFORE GOING FURTHER

- Make sure you are with a Xperia Z4 Tablet

Go to Menu > Settings > About tablet > Model is: SGP712 (32 GB) or SGP771 (LTE, 32 GB).

I started from latest Android 7.1.1 official firmware.

- Make sure bootloader is unlockable

With LTE device, you can dial *#*#7378423#*#* > Service info > Configuration > Rooting Status

With Tablet Z4 Wi-Fi:

Open Xperia Contacts app > Menu button (3 dots vertical icon in top right corner) > Settings.

View attachment 5869335

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.

View attachment 5869341

Tap on it and dial *#*#7378423#*#* to reveal Service menu

View attachment 5869343

Go to Service info > Configuration

Look at the Rooting status line: Bootloader unlock allowed: Yes

If No, you can cry, you cannot get further.

### One user (@ontano) reported that he could change this unlock state by opening Sony MyXperia preinstalled app.

### Looks like with an account he desactivated it which then changed the bootloader unlock state.

View attachment 5869345

At the same time, note down the IDID (we need it to ask for an Unlock code).

### Read warnings like this

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

CHANGELOG

v1. Initial release

1) DOWNLOAD FILES

- djibe Xperia Z4 Tablet pack: https://bit.ly/djibe-xperia-tabletz4

(contains Tablet Z4 USB drivers + adb + fastboot + TWRP 3.5.0_9.0 by @andralex8 + Android 11 boot.img + Magisk + MagiskHidePropsConf-v6.1.2 + safetynet-fix + Netflix and Disney+ apps)

+ ROM LineageOS Unofficial 18.1: https://xdaforums.com/t/rom-11-lineageos-18-18-1-z4tablet-sgp712-771.4199169/

Download latest build for LTE (karin) or Wi-Fi (karin_windy): https://cloud.mail.ru/public/WuyG/5Lg5rEefa/Android 11 ROMs/LineageOS 18_18.1 (11)

Mirror: https://androidfilehost.com/?a=show&w=files&flid=337886

+ BitGApps ARM64 11 (any variant): https://bitgapps.github.io/download/Platform/Omni/ARM64.html

+ 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%.

2) INSTALL DRIVERS

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_Z4_Tablet_driver/ folder.

Click Next to install.

Reboot Windows.

3) FIRMWARE NUMBER AND USB DEBUGGING

On tablet, go to Menu > Settings > About tablet > Build number

Make sure it is 32.4.A.1.54 and tap 7 times on it to unlock Developer options.

If not 32.4.A.1.54, go to Menu > Settings > About tablet > Software update > System updates tab

### Don't go further if you are not with 32.4.A.1.54 firmware.

Go to Menu > Settings > Developer options.

Switch ON following options: OEM unlocking and USB debugging and confirm it in the next Dialog.

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 Z4 Tablet

Enter your IMEI or IDID (see section: Before going further) + check both checkboxes after this.

Copy the unlock code.

5) FASTBOOT MODE

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

CB5A25P7Z7 unauthorized

On tablet, Check ON Always allow from this computer and tap on OK.

If no Allow USB debugging? screen shows up on tab, disconnect and reconnect tablet.

Enter command:

adb reboot bootloader

Tablet restarts and a blue light appears in top right corner.

Go back to Windows Device Manager.

Z4 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 sa0112 ADB Interface Driver (at the bottom of the list).

(https://www.sony.co.uk/electronics/support/articles/SX278901)

Now you can enter command:

fastboot devices

Command returns: CB5A25P7Z7 fastboot

6) UNLOCK BOOTLOADER

### All data will be lost

Fill the command with your Unlock Code:

fastboot oem unlock 0xYOURUNLOCKKEY

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

Bootloader is unlocked !

7) FLASH TWRP RECOVERY 3.5

Still in fastboot, type in console:

fastboot flash:raw boot boot-windy.img

. Confirm with Enter (boot.img is LOS 18.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.5.0_9-0-karin_windy-20210122.img

. Confirm with Enter.

### For LTE/4G variant, replace with: TWRP-3.5.0_9-0-karin-20210122.img

Power off tablet: disconnect from USB OR hold Volume+ + Power until it vibrates 3 times.

Power on tablet: press Power button + Volume- until tablet vibrates once then release buttons.

TWRP shows up.

8) BACKUP CURRENT ROM

You are now in TWRP recovery, Swipe to Allow Modifications.

Go to Wipe > Format Data, type yes and tap on bottom right check icon.

This removes encryption on Data partition.

Go to Reboot > Recovery

Back to TWRP, go to Backup, select Boot, System, Data, OEM, LTALabel, Firmware partitions.

Tap on Select Storage and select MicroSD Card.

Swipe to Backup.

Later, store this TWRP backup somewhere safe.

Go to TWRP Home screen > Mount.

Go to Wipe > Advanced Wipe > Select Dalvik, Cache, Data, Internal Storage, System and swipe to confirm erasing.

9) INSTALL ROM AND GAPPS

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,

(Optional: Add Magisk*.zip)

Swipe to confirm flash.

Wait while Install Zips are flashed.

At the end, tap on Wipe Cache/Dalvik, then Reboot System.

Android 11 is installed !

Wait during boot.

10) ROOT WITH MAGISK (OPTIONAL)

### Only if you flashed Magisk via TWRP recovery

Do not connect to Android account.

Magisk root starts with Android.

You can manage permissions and extra modules with Magisk Manager app.

Open Files app > Install Magisk.apk.

Then in Magisk goto Settings > Hide magisk app and give it a name, switch Zygisk option ON.

Go to Modules Tab > Install from Storage: MagiskHidePropsConfig and Safetynet Fix.

Go to Developer options to disable Android debugging (ADB).

Reboot tablet.

You can use yasnac app to check Safetynet passes.

Then with Files App: install netflix and disney+ if needed.

### Later, if an app (Zoom, Doctolib) refuses to launch because of root:

### Go to Magisk > siwtch Enforce DenyList ON and Configure DenyList, check that app.

### Go to app list > long press app > App info > Storage and cache > Clear storage.

### Launch app again and enjoy.

11) TWEAKS

If you flashed files from Internal memory (and not microSD card),

from TWRP recovery you can clear files from internal memory: go to Advanced > File Manager > Data > media.

Long press on a file > Delete.

From Android:

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, @alex009988, sabar_op, Bernie, Tarkzim, TopJohnWu

--------------------------------------------

### Sony Xperia Z4 Tablet boot to recovery:

Shutdown tab.

Press Power button + Volume- until tablet vibrates once then release buttons.

Many thanks to @jaset_uk

### Force shutdown

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