[Samsung Galaxy Tab A8 (2021)] Vinpinto:
Your warranty will be void after any of these procedures.

* I am not responsible for the outcome for using any of this information, e.g. bricked devices, dead devices, boot loops

* do some research regarding flashing, custom ROM and unlocking bootloaders

* you chose to make these modifications under your own responsibility.

The following guide is for flashing any Treble Project compatible ROM (GSI) on the Samsung Galaxy Tab A8 2021 (SM-X200 + SM-X205)​

What's working on android 12 / 12.1 ROMs :

Everything

What's working on android 13 ROMs :

Everything

There are two ways of flashing GSI, generic system images, for treble compatible devices:

ROM flash from fastboot mode.

Dynamic System Updates (DSU) loading

Prerequisites:​

First you should check if your device is treble compatible, this has been already checked by me. Here's the app link for checking it if you make sure yourself

Then you should unlock your bootloader and flash TWRP, here's the link for it

Enable ADB over USB.

Wipe the Data Partition from TWRP

You can root with Magisk if you like.

Option 1 ROM flash from fastboot mode:​

This is my preferred mode

Instructions:

Turn off the device and Hold Power & Vol Up buttons during restart to enter TWRP recovery

Format data from TWRP and wipe all partitions

Navigate to reboot and select Fastboot mode

Download a GSI image, including LineageOS, Google Android, AOSP, or any other custom GSI Treble compatible ROM for AB partition scheme.

fastboot flash system system.img

also a fastboot -w after flashing for additional wiping wouldn't hurt

IMPORTANT: remember to always only flash *.img files, never flash zip, img.xz, img.tar, gz, or img.tar.zx files, look for the tools for unzipping these file formats and always extract just the system.img file for these procedures. NEVER flash the vbmeta.img this can brick your device

if by any case it wont boot, just flash the stock recovery back again

Option 2 Dynamic System Updates (DSU) loading:​

Instructions:

Enable the DSU feature flag​

Before using DSU, ensure the corresponding feature flag is enabled. You can enable the flag using one of the following methods:

On a device with a userdebug Android build: You can enable the feature in Settings > System > Developer options > Feature flags > settings_dynamic_system.

On other devices: Use the following adb command:

adb shell setprop persist.sys.fflag.override.settings_dynamic_system true

Launch DSU​

After the feature is enabled, launch DSU using the adb tool.

Download a GSI image, including LineageOS, Google Android, or any other custom GSI Treble compatible ROM for AB partition scheme.

Note: If you build your own GSI from source, or if you download a GSI from another image server, your GSI might not be unsparsed. Use the following command inside your build tree to convert the image to an unsparsed image: simg2img system.img system_raw.img

gzip the GSIand then Push the GSI to the device:

gzip -c system_raw.img > system_raw.gz

adb push system_raw.gz /storage/emulated/0/Download/

Launch DSU using adb.

adb shell am start-activity \

-n com.android.dynsystem/com.android.dynsystem.VerificationActivity \

-a android.os.image.action.START_INSTALL \

-d file:///storage/emulated/0/Download/system_raw.gz \

--el KEY_SYSTEM_SIZE $(du -b *.img|cut -f1) \

--el KEY_USERDATA_SIZE 8589934592

The KEY_SYSTEM_SIZE should be for the uncompressed image file, otherwise it will fail

IMPORTANT: remember to always only flash *.img files, never flash zip, img.xz, img.tar, gz, or img.tar.zx files, look for the tools to uncompressed these file formats and always extract always the system.img file for these procedures. NEVER flash the vbmeta.img this can brick your device

Boot into the GSI​

Figure 1. A persistent notification that you can use to control DSU.

After DSU installs the GSI, a DSU menu appears as a persistent notification inside the system notification drawer (see figure 1).

At this point, you can do one of the following:

Boot into the GSI by tapping Restart.

Clean up the GSI by tapping Discard.

Switch back to the device's original system image​

After you are done testing your app using the GSI, you can perform a cold reboot to boot the system back into its original system image.

When setting the next reboot to use a GSI, you can have the GSI stay installed through multiple boot cycles (until discarded) by enabling sticky mode, or have it used for only one boot cycle by disabling sticky mode.

The following command enables sticky mode:

adb shell gsi_tool enable

The following commands disable sticky mode:

adb shell gsi_tool disable

adb shell gsi_tool enable -s

adb shell gsi_tool disable

Install GSIs using DSU and the DSU Loader​

Android 11 introduced the DSU Loader, a tool available in the device's developer options that lets you download, install, and manage GSIs entirely through the system's UI.

To install a GSI using the DSU Loader, follow these steps on a device running Android 11 or higher:

Enable developer options on your device.

Open your device's Settings app, then tap Developer options > DSU Loader.

Choose the GSI that you want to install on your device.

Agree to the GSI terms and conditions.

After you agree to the terms and conditions, the GSI that you selected starts downloading. You can check the status of the download through the DSU notification.

After the download has finished, tap Restart to boot the GSI.

When you want to switch back to your device's original system image, tap Restart from the DSU system notification.

[IMG alt="DSU notification with an option that lets you reboot the device using the

original system image"]https://developer.android.com/static/images/topic/dsu/restart-original-system-image.png[/IMG]

​

Thanks to Magendanz for the TWRP recovery​