How To Guide Samsung Galaxy Tab A8 2021 (SM-X200 + SM-X205) Android 13 Treble flash Guide

Search This thread

Vinpinto

Member
Dec 18, 2011
48
19
NY
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.

  1. 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
  2. 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/
  3. 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​

dsu_control.png


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:

  1. Enable developer options on your device.
  2. Open your device's Settings app, then tap Developer options > DSU Loader.
  3. Choose the GSI that you want to install on your device.
    DSU loader interface for selecting a GSI
  4. 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.
  5. After the download has finished, tap Restart to boot the GSI.
    DSU notification with options for managing the GSI
  6. 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​

 
Last edited:

WackyHacky1

Member
Sep 13, 2022
26
10
only issue is rainbow six mobile and pubg new state detect it as a emulator so how would we fix this?
 

jeffbar2

New member
Nov 21, 2022
2
0
Twrp keeps saying entering fastboot but never does.
I think it was using older versions of adb and usb drivers
 
Last edited:

MarcusGuy1108

Member
Aug 11, 2018
10
1
Does this trip knox like on s22 etc, or does it go back to normal if you restore back to original and relock bootloader?
 

lewmur

Senior Member
Apr 30, 2011
3,084
626
Does this trip knox like on s22 etc, or does it go back to normal if you restore back to original and relock bootloader?
AFAIK, the knox bit is a physical "fuse" and once it is tripped, it will never restore back. But normally Sansung will still honor the warranty so long as you go back to a stock ROM and relock the bootloader. That will also re-enable OTA updates.
 

MarcusGuy1108

Member
Aug 11, 2018
10
1
AFAIK, the knox bit is a physical "fuse" and once it is tripped, it will never restore back. But normally Sansung will still honor the warranty so long as you go back to a stock ROM and relock the bootloader. That will also re-enable OTA updates.
I see, just like the phones... damn samsung. Thank you very much for the quick response.
 

lewmur

Senior Member
Apr 30, 2011
3,084
626
I see, just like the phones... damn samsung. Thank you very much for the quick response.
It isn't just Samsung. Installing a custom ROM or rooting your device will void the warranty with all makers. But at least Samsung will still honor the warranty unless there is some indication that what you did caused the problem. Like bricking the device. But if it is really a hardware problem, they'll still fix it for free during the warranty period.
 

MarcusGuy1108

Member
Aug 11, 2018
10
1
It isn't just Samsung. Installing a custom ROM or rooting your device will void the warranty with all makers. But at least Samsung will still honor the warranty unless there is some indication that what you did caused the problem. Like bricking the device. But if it is really a hardware problem, they'll still fix it for free during the warranty period.

I mean the knox warrantee bit
 

lewmur

Senior Member
Apr 30, 2011
3,084
626
I know what you meant. Yes, the warranty bit is blown. But as I said, Samsung will honor it anyway unless they feel something you did caused the problem. Of course, you will still have to reflash to a stock rom, relock the bootloader and factory reset before sending in for repair.
 

MarcusGuy1108

Member
Aug 11, 2018
10
1
I know what you meant. Yes, the warranty bit is blown. But as I said, Samsung will honor it anyway unless they feel something you did caused the problem. Of course, you will still have to reflash to a stock rom, relock the bootloader and factory reset before sending in for repair.
Maybe I'll try it then. I like a lot about this tablet but god is it sluggish on OneUi. Games and all that work fine (even smooooth) but animations and stuff on OneUI are just.... wow
 

lewmur

Senior Member
Apr 30, 2011
3,084
626
Maybe I'll try it then. I like a lot about this tablet but god is it sluggish on OneUi. Games and all that work fine (even smooooth) but animations and stuff on OneUI are just.... wow
There is a fix for that. It has to do with using ADB to change the options for how to size the ramdisk to zero. You might try googling "Samsong One Ui laggy". Lineage doesn't have One Ui so it doesn't have the problem.
 
  • Like
Reactions: w00tnezz

ke4peo

Senior Member
Oct 23, 2010
142
5
Samsung Galaxy S21
Hey all. I just recently bought a Tab A8 32GB and was looking for a way to load a ROM on it so I can use the SD Card as internal storage.

I found this guide, but I'm not seeing some of the steps it says to take on my device. I've enabled Developer Options, but I don't see the DSU/GSI stuff. Nor the 'feature flag' to turn that on.

I know back in the old days all you have to do way flash a recovery image and then you could load the ROM from recovery. Is that still the basic process? Can I flash TWRP and then flash the ROM, or is more detailed now than that?
 

Vinpinto

Member
Dec 18, 2011
48
19
NY
Hey all. I just recently bought a Tab A8 32GB and was looking for a way to load a ROM on it so I can use the SD Card as internal storage.

I found this guide, but I'm not seeing some of the steps it says to take on my device. I've enabled Developer Options, but I don't see the DSU/GSI stuff. Nor the 'feature flag' to turn that on.

I know back in the old days all you have to do way flash a recovery image and then you could load the ROM from recovery. Is that still the basic process? Can I flash TWRP and then flash the ROM, or is more detailed now than that?
The full process for flashing is in the first post, in case you don't have the DSU option
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    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.

    1. 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
    2. 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/
    3. 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​

    dsu_control.png


    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:

    1. Enable developer options on your device.
    2. Open your device's Settings app, then tap Developer options > DSU Loader.
    3. Choose the GSI that you want to install on your device.
      DSU loader interface for selecting a GSI
    4. 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.
    5. After the download has finished, tap Restart to boot the GSI.
      DSU notification with options for managing the GSI
    6. 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​

    2
    How did you do it? I can't seem to fathom how to do it myself.

    Info about my tablet:
    32GB Internal Storage (I also have a 64GB SD card)
    Is an SM-X205 (XTC)
    Rooted through a patched boot.img (Magisk v25.2)
    Doesn't use TWRP
    Supports Project Treble
    Uses VNDK 30.0 and has VNDK Lite (Full linker namespace seperation enabled)
    Uses System-as-Root
    Does not have Seamless Upgrades
    Uses Dynamic Partitions
    ARM64 CPU Arch and 64-bit Binder Arch
    My installation process from the very start was:
    1. Ensure you are running the latest firmware, at the time of writing this for my CSC it is the January 2023 security patch, Android 13 (X205XXS1CWA5)
    2. Unlock bootloader
    3. Flash TWRP using Odin (rename the TWRP image to recovery.img, put the img file into a tar archive using 7-Zip), make sure Auto Reboot is unchecked, manually reboot to TWRP
    4. Go to Wipe > Format Data > type yes
    5. Reboot recovery, go to Wipe > Advanced Wipe > Check everything
    6. Reboot to fastboot (from the TWRP reboot menu)
    7. Rename the extracted lineage-20.0-20230324-UNOFFICIAL-arm64_bgN.img file to system.img, open a Terminal (command prompt) in that folder and run fastboot flash system system.img
    8. Wait for it to complete, once it has, press Reboot in TWRP and reboot to system
    9. Wait a while for it to boot (it looks like it gets stuck on the Samsung Galaxy screen but it doesn't, just be patient), if it reboots by itself and goes back into TWRP, format data and advanced wipe all partitions again then reboot system.

    After this you should successfully be able to boot and use LineageOS 20.
    The only issues I've found in my testing are:
    - Bluetooth does not work (it doesn't turn on and every so often shows a Bluetooth keeps stopping message), although apparently it works in earlier LOS builds, such as 20230218 though I have not tried it myself.
    - Flip cover cases do not work in the way of turning the screen on or off, though this should be a relatively easy fix by adding 0x15 in the source code, more specifically where the code checks for SW_LID, however it involves building the GSI image yourself which I don't have the time for (but if someone else does and can share their build, that would be amazing!). Samsung uses a different event (the 0x15 value) for detecting flip cover opening/closing which AOSP does not support natively.

    Otherwise it works quite well, I got root working without much trouble either, I just had to use ADB sideload in TWRP to sideload the Magisk zip from my computer as the unofficial TWRP build the A8 has is not able to read the internal storage due to encryption.

    Edit: Also forgot to mention that I don't have the video playback bug of the colours inverting as is mentioned in the OP of this thread, not sure if this has been fixed in later LOS builds since the OP was updated but either way I'm happy that I don't have that problem.
    2
    Just wanted to say thanks to everyone who helped me. Finally got Lineage installed and formatted my 256GB SD card as internal storage! So far, it's only had one little quirk, but it's a livable one until I figure it out.

    The quirk? After I installed and formatted my Sandisk 256GB SD card as internal storage inside Settings the Storage section sees it, but when I tap on Storage it circles and then closes the Settings app. Like I said, quirky...but livable so long as it sees all the storage. :)

    Edit: Fixed it! Basically went into TWRP and factory reset (with the SD card inserted) and also made sure to wipe the SD card. After rebooting and setting up my Google account again, it allowed me to format as internal and now doesn't crash!
    2
    @kevinco1 Bluetooth update: I've reported the bluetooth issue to phhusson and it has been resolved.

    The 20230531 AOSP TD build now has bluetooth functioning for this device, and now it's just a wait for it to appear in the next monthly LOS TD build.
    2
    Which I did flash TWRP. But there is no fastboot option that I can find in TWRP. There's "Reboot system now" and "Reboot into bootloader".

    Reboot Into Bootloader just takes me to the same cyan screen and doesn't allow ADB to do anything.
    The recovery shown in your pics is the standard recovery and NOT TWRP. When flashing TWRP you MUST disable the auto-reboot option in Odin because if the tablet reboots to system, it will overwrite TWRP. When TWRP finishes flashing in Odin, hold the vol down and power until the screen blanks. Then, immediately switch from vol down to vol up to reboot to TWRP. You have to do this fast or it will reboot system again and you'll have to do it again.