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

Search This thread

lewmur

Senior Member
Apr 30, 2011
3,055
616
Is DSU option not possible if you have 16GB model because of limited storage space?
I don't have the model with only 16gb so I can't test it. But there have been others that said it's true. Though why anyone would buy that model when 32 or 64gb model don't cost very much more.
 

ke4peo

Senior Member
Oct 23, 2010
142
5
Samsung Galaxy S21
Well, I managed to get through part of the process. I got TWRP installed in the recovery partition and I can reboot into TWRP.

However, I don't see any option to "Enable ADB over USB". There is "Apply update from ADB" but that puts it in sideload mode and ADB won't let me 'fastboot flash system system.img' that way. It just sits as <waiting for device>

There's also no option for 'navigate to reboot and select Fastboot mode'. I tried 'Apply update from SD Card' with the system.img on the SD card, but TWRP doesn't see anything in that folder. Used to be, you could put the ZIP file for the rom in a folder on the SD card and TWRP would find it and flash it.

Right now I'm stuck with TWRP installed, but still the stock Samsung OS on it. Also, I can't seem to get back to where I can make sure the bootloader is unlocked. When I reboot and hold Vol Up and Vol Down it just takes me to the 'Custom OS' screen.

Any suggestions on how to load the Lineage or AOSP roms would be appreciated. Thanks!
 

asripath

Senior Member
Jul 12, 2020
300
246
Redmi K20 Pro
Samsung Galaxy Tab A8
Well, I managed to get through part of the process. I got TWRP installed in the recovery partition and I can reboot into TWRP.

However, I don't see any option to "Enable ADB over USB". There is "Apply update from ADB" but that puts it in sideload mode and ADB won't let me 'fastboot flash system system.img' that way. It just sits as <waiting for device>

There's also no option for 'navigate to reboot and select Fastboot mode'. I tried 'Apply update from SD Card' with the system.img on the SD card, but TWRP doesn't see anything in that folder. Used to be, you could put the ZIP file for the rom in a folder on the SD card and TWRP would find it and flash it.

Right now I'm stuck with TWRP installed, but still the stock Samsung OS on it. Also, I can't seem to get back to where I can make sure the bootloader is unlocked. When I reboot and hold Vol Up and Vol Down it just takes me to the 'Custom OS' screen.

Any suggestions on how to load the Lineage or AOSP roms would be appreciated. Thanks!
https://www.xda-developers.com/android-developer-options/
Enable developer options & usb debugging for adb over usb
 

ke4peo

Senior Member
Oct 23, 2010
142
5
Samsung Galaxy S21
https://www.xda-developers.com/android-developer-options/
Enable developer options & usb debugging for adb over usb
I did that. Both OEM Unlocking and USB debugging are on.

ADB can see the device. I can issue commands like "adb reboot" to the device and it will reboot. So ADB can talk to it. But when I try doing the 'fastboot flash system system.img' it sits there saying '<waiting for any device>'.

I even tried doing the 'fastboot' command then booting the tablet into download mode (the cyan-colored screen). That doesn't work and ADB doesn't see the device then. Only Odin does. So I'm at a loss.
 

Attachments

  • 2022-12-15 (1).png
    2022-12-15 (1).png
    47.5 KB · Views: 174
  • 2022-12-15.png
    2022-12-15.png
    46.6 KB · Views: 169

asripath

Senior Member
Jul 12, 2020
300
246
Redmi K20 Pro
Samsung Galaxy Tab A8
I did that. Both OEM Unlocking and USB debugging are on.

ADB can see the device. I can issue commands like "adb reboot" to the device and it will reboot. So ADB can talk to it. But when I try doing the 'fastboot flash system system.img' it sits there saying '<waiting for any device>'.

I even tried doing the 'fastboot' command then booting the tablet into download mode (the cyan-colored screen). That doesn't work and ADB doesn't see the device then. Only Odin does. So I'm at a loss.
You need to be in fastboot/bootloader mode to run fastboot commands

adb reboot fastboot
Or
adb reboot bootloader

Edit
Get familiar with adb
 

ke4peo

Senior Member
Oct 23, 2010
142
5
Samsung Galaxy S21
You need to be in fastboot/bootloader mode to run fastboot commands

adb reboot fastboot
Or
adb reboot bootloader

Edit
Get familiar with adb

I tried 'adb reboot fastboot'. All that did was reboot the tablet and load right back into Android. So, then I tried 'adb reboot bootloader'. That sends me into the cyan-colored screen (see image). I then did 'fastboot flash system system.img' and it again sits at <waiting for any device>.

I again, confirmed OEM Unlocking and USB debugging are enabled. Bootloader is unlocked. Not sure what else I can try except trying to flash the IMG file via Odin. But it's been a while and I can't remember the way to do it that way.
 

Attachments

  • 2022-12-15 (2).png
    2022-12-15 (2).png
    35.2 KB · Views: 126
  • bootloader.jpg
    bootloader.jpg
    3 MB · Views: 125

lewmur

Senior Member
Apr 30, 2011
3,055
616
I tried 'adb reboot fastboot'. All that did was reboot the tablet and load right back into Android. So, then I tried 'adb reboot bootloader'. That sends me into the cyan-colored screen (see image). I then did 'fastboot flash system system.img' and it again sits at <waiting for any device>.

I again, confirmed OEM Unlocking and USB debugging are enabled. Bootloader is unlocked. Not sure what else I can try except trying to flash the IMG file via Odin. But it's been a while and I can't remember the way to do it that way.
Samsung devices don't all support fastboot natively. If you read the OP carefully, you will see that you have to flash TWRP first and use that to enter fastboot.
 

ke4peo

Senior Member
Oct 23, 2010
142
5
Samsung Galaxy S21
Samsung devices don't all support fastboot natively. If you read the OP carefully, you will see that you have to flash TWRP first and use that to enter fastboot.
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.
 

Attachments

  • twrp3.jpg
    twrp3.jpg
    3 MB · Views: 95
  • twrp2.jpg
    twrp2.jpg
    2.1 MB · Views: 95
  • twrp1.jpg
    twrp1.jpg
    2.1 MB · Views: 95

lewmur

Senior Member
Apr 30, 2011
3,055
616
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.
 

ke4peo

Senior Member
Oct 23, 2010
142
5
Samsung Galaxy S21
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.

Ah ha! That explains it then. I double-checked the link to the post I used on how to install TWRP and it mentions nothing about disabling auto-reboot. I will go back and try this again and this time disable auto-reboot.

Thanks!
 

ke4peo

Senior Member
Oct 23, 2010
142
5
Samsung Galaxy S21
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!
 

Attachments

  • lineage1.jpg
    lineage1.jpg
    3.1 MB · Views: 121
  • lineage2.jpg
    lineage2.jpg
    2.8 MB · Views: 124
Last edited:

cyb7

Member
Dec 22, 2022
5
1
Guys, I guess I am too stupid to install LineageOS on that tablet, maybe someone is kind enough to help me.

I enabled "USB debugging" and "OEM Unlocking", unlocked the bootloader, flashed TWRP recovery with Odin, formated data, wiped all partitions with TWRP, unzipped lineage-19.1-20221122-UNOFFICIAL-arm64_bgN-secure.img.xz to system.img, rebooted tablet to fastboot and used "fastboot flash system system.img" to flash LineageOS.

fastboot output shows 11 steps of sending data to the tablet and finishes every step with OKAY. When selecting "Reboot to system" on the tablet after that, the tablet reboots and nothing happens. I can still restart TWRP, but LineageOS was obviously was not installed correctly.

Strange thing to me: During "fastboot flash system" nothing is displayed on the tablet itself. IIRC from flashing Smartphones the tablet should actually display some logging, shouldn't it?

Another strange thing: I installed Samsung-USB-Driver-v1.7.48.0.exe but nevertheless the Windows Device Manager displayed SM-X200 as non-working with invalid driver. I then updated the driver in Device Manager manually to "Samsung Android Bootloader Interface" (which was existing on my system because of the installation of that samsung.exe) and from then on the device would show up in "fastboot devices".

Does anybody know what I might do wrong?

Thanks!

cyb7
 

lewmur

Senior Member
Apr 30, 2011
3,055
616
Guys, I guess I am too stupid to install LineageOS on that tablet, maybe someone is kind enough to help me.

I enabled "USB debugging" and "OEM Unlocking", unlocked the bootloader, flashed TWRP recovery with Odin, formated data, wiped all partitions with TWRP, unzipped lineage-19.1-20221122-UNOFFICIAL-arm64_bgN-secure.img.xz to system.img, rebooted tablet to fastboot and used "fastboot flash system system.img" to flash LineageOS.

fastboot output shows 11 steps of sending data to the tablet and finishes every step with OKAY. When selecting "Reboot to system" on the tablet after that, the tablet reboots and nothing happens. I can still restart TWRP, but LineageOS was obviously was not installed correctly.

Strange thing to me: During "fastboot flash system" nothing is displayed on the tablet itself. IIRC from flashing Smartphones the tablet should actually display some logging, shouldn't it?

Another strange thing: I installed Samsung-USB-Driver-v1.7.48.0.exe but nevertheless the Windows Device Manager displayed SM-X200 as non-working with invalid driver. I then updated the driver in Device Manager manually to "Samsung Android Bootloader Interface" (which was existing on my system because of the installation of that samsung.exe) and from then on the device would show up in "fastboot devices".

Does anybody know what I might do wrong?

Thanks!

cyb7
I looked up what bgN meant and it seems the N means there is no superuser partition included. I think you need a ROM that is bgS.
 

cyb7

Member
Dec 22, 2022
5
1
I looked up what bgN meant and it seems the N means there is no superuser partition included. I think you need a ROM that is bgS.
Okay, I checked https://sourceforge.net/projects/andyyan-gsi/files/lineage-19.x/ and the only images with GAPPS where without superuser partition. So the most popular image seems to be lineage-19.1-20221122-UNOFFICIAL-arm64_bvS.img.xz I guess.

Right now I cannot try anything anymore on the tablet. From TWRP I chose "Reboot" and "Power Off". The tablet restarted and now hangs in "Samsung Galaxy" screen displaying "This tablet is not running Samsung's official software...blaa." I guess I have to wait for the battery getting empty before I can do anything again :(
 

lewmur

Senior Member
Apr 30, 2011
3,055
616
Okay, I checked https://sourceforge.net/projects/andyyan-gsi/files/lineage-19.x/ and the only images with GAPPS where without superuser partition. So the most popular image seems to be lineage-19.1-20221122-UNOFFICIAL-arm64_bvS.img.xz I guess.

Right now I cannot try anything anymore on the tablet. From TWRP I chose "Reboot" and "Power Off". The tablet restarted and now hangs in "Samsung Galaxy" screen displaying "This tablet is not running Samsung's official software...blaa." I guess I have to wait for the battery getting empty before I can do anything again :(
This one is bgS. Hold power and vol down with USB cable plugged in. As soon as the screen blanks, switch to vol up while still hold power. That should boot to TWRP.

Once that is installed, you can then flash a later one that is bgN, so long as you DON't wipe the superuser partition.
 
Last edited:

lewmur

Senior Member
Apr 30, 2011
3,055
616
I'm still on the Aug version of the 19.1 ROM. When I try to use the Updater it says there is a Nov 22 version but when I click download and install, it just show an error occurred and to try later. Is there any way to manually download and install this version?
 

cyb7

Member
Dec 22, 2022
5
1
Is there any way to manually download and install this version?
Will flashing the system image with fastboot not just update the system and leave all the user data alone?

Is there a way to install (e.g. BiTGApps) from a zip file in TWRP? I am not able to mount anything in TWRP. I can see a directory structure, but all folders are empty.
 

lewmur

Senior Member
Apr 30, 2011
3,055
616
I'm trying to flash this ROM system-td-arm64-ab-vanilla.img. I have installed stock Android 13 and flashed TWRP and rooted with Magisk. This all worked fine and I have root access. I booted TWRP, formatted data and rebooted back to recovery. Wiped Factory Reset and flashed the new img file to Super. It appeared to work fine with no error message but it still bootloops at Samsung screen with the red nag about being unsafe. What am I doing wrong? Do I need to flash the img with fastboot instead of TWRP?

edit: Flashing with fastboot worked. I think the problem with TWRP is that there is no option to flash to system and flashing to super doesn't work.
 
Last edited:

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.