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

Search This thread

scottrix

Senior Member
Jul 19, 2012
59
24
Wondering what GSI roms people have actually got working on the SM-X200 ? I have had the following working:
lineage-19.1-20220814-UNOFFICIAL-arm64_bgS.img
https://sourceforge.net/projects/an...20230507-UNOFFICIAL-arm64_bvS.img.xz/download

I would like to get ArrowOS-13.1 installed, however, this is a bvN image and I have so far only for bvS or bgS images working. Has anyone got a bvN or bgN image working on the SM-X200 ?

Thanks to all for their hard work in making this possible.
It looks like the bvN vs bvS image comparison is invalid. The S just includes the phh-su command and an init script to run it, so I doubt that is stopping it working, it must be the size. Verified by using the N version of the lineageOS rom from above.

However, the size of the image I'm trying to flash is 2753974272 and the system.img from stock is 3843932160.

Also I am suffering from the reboot issue previously mentioned, if anyone has ideas on how to fix it.
 

lewmur

Senior Member
Apr 30, 2011
2,737
559
It looks like the bvN vs bvS image comparison is invalid. The S just includes the phh-su command and an init script to run it, so I doubt that is stopping it working, it must be the size. Verified by using the N version of the lineageOS rom from above.

However, the size of the image I'm trying to flash is 2753974272 and the system.img from stock is 3843932160.

Also I am suffering from the reboot issue previously mentioned, if anyone has ideas on how to fix it.
According to Andy Yan's guide, the S means it includes the Super partitions.
 

lewmur

Senior Member
Apr 30, 2011
2,737
559
But actually looking at the difference between the lineage bvN and bvS images (by mounting them on linux through the loop back device) shows that's not the case. It include the superuser, not anything to do with the super partitions.
I think I'll take Andy's word for it over your reading of a script. Besides, his concurs with my observed results.
 

scottrix

Senior Member
Jul 19, 2012
59
24
It looks like the bvN vs bvS image comparison is invalid. The S just includes the phh-su command and an init script to run it, so I doubt that is stopping it working, it must be the size. Verified by using the N version of the lineageOS rom from above.

However, the size of the image I'm trying to flash is 2753974272 and the system.img from stock is 3843932160.

Also I am suffering from the reboot issue previously mentioned, if anyone has ideas on how to fix it.
For my reboot issue, removing the device from the case I had and then restarting by pressing and holding power + vol down, till the samsung logo appears, a couple of time seems to have fixed it.
 

scottrix

Senior Member
Jul 19, 2012
59
24
For my reboot issue, removing the device from the case I had and then restarting by pressing and holding power + vol down, till the samsung logo appears, a couple of time seems to have fixed it.
Still sometimes get the issue on this tablet that it will need restarting a couple of times. However, on my second tablet (I got two at the same time) it is constantly restarting and haven't found a way to stop it yet. There doesn't seem to be anything useful in the logcat as to why it is restarting. Will update if I find out more.....
 

lewmur

Senior Member
Apr 30, 2011
2,737
559
Still sometimes get the issue on this tablet that it will need restarting a couple of times. However, on my second tablet (I got two at the same time) it is constantly restarting and haven't found a way to stop it yet. There doesn't seem to be anything useful in the logcat as to why it is restarting. Will update if I find out more.....
There shouldn't be a difference in the two tablet but there could be in either what stock ROM was on each or what ROM you installed. I know I ran across this problem at one time but I think if you start over and flash the latest stock ROM first, it should work.
 
There shouldn't be a difference in the two tablet but there could be in either what stock ROM was on each or what ROM you installed. I know I ran across this problem at one time but I think if you start over and flash the latest stock ROM first, it should work.
Great advice, you need to know what stock firmware version you had on each before you started flashing. It's a lot easier if you have them on both the same firmware.

If you are unable to boot you did something wrong along the way. The easiest solution is just to reflash stock again through Odin and go from there instead of wasting time trying to troubleshoot
 

Mafioso

Senior Member
Nov 13, 2007
1,067
123
Pune
I'm thinking of flashing GSI rom on this tablet, since I'm fed up with slowness/lag on stock Samsung ROM. Primary usage being kids games (not graphic intensive) and as ebook reader.

Can anybody suggest if GSI rom will work faster/smoother for above use case or I should stick with official a13 ROM?
I don't mind going back to a12.1 as long it is stable & fast
 

gguman

Member
May 31, 2023
21
0
Could anyone help me with the permission error pls. I'm on LOS20 BgN

17737 17772 W AsyncVal: doInBackground() zip file name = main.111622.com.zwift.zwiftgame.obb
05-31 15:59:50.197 17737 17772 W Helpers : getSaveFilePath: /storage/emulated/0/Android/obb/com.zwift.zwiftgame
05-31 15:59:50.198 17737 17772 W Helpers : getSaveFilePath: /storage/emulated/0/Android/obb/com.zwift.zwiftgame
05-31 15:59:50.199 17737 17772 W System.err: java.io.FileNotFoundException: /storage/emulated/0/Android/obb/com.zwift.zwiftgame/main.111622.com.zwift.zwiftgame.obb: open failed: EACCES (Permission denied)
05-31 15:59:50.199 17737 17772 W System.err: at libcore.io.IoBridge.open(IoBridge.java:574)
05-31 15:59:50.199 17737 17772 W System.err: at java.io.RandomAccessFile.<init>(RandomAccessFile.java:289)
05-31 15:59:50.199 17737 17772 W System.err: at com.zwift.zwiftgame.vending.expansion.zipfile.ZipResourceFile.addPatchFile(ZipResourceFile.java:275)
05-31 15:59:50.199 17737 17772 W System.err: at com.zwift.zwiftgame.vending.expansion.zipfile.ZipResourceFile.<init>(ZipResourceFile.java:189)
05-31 15:59:50.200 17737 17772 W System.err: at com.zwift.zwiftgame.downloader.ZwiftDownloaderActivity$AsyncValidationTask.doInBackground(ZwiftDownloaderActivity.java:296)
05-31 15:59:50.200 17737 17772 W System.err: at com.zwift.zwiftgame.downloader.ZwiftDownloaderActivity$AsyncValidationTask.doInBackground(ZwiftDownloaderActivity.java:245)
05-31 15:59:50.200 17737 17772 W System.err: at android.os.AsyncTask$3.call(AsyncTask.java:394)
05-31 15:59:50.200 17737 17772 W System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:264)
05-31 15:59:50.200 17737 17772 W System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
05-31 15:59:50.200 17737 17772 W System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
05-31 15:59:50.200 17737 17772 W System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
05-31 15:59:50.200 17737 17772 W System.err: at java.lang.Thread.run(Thread.java:1012)
05-31 15:59:50.201 17737 17772 W System.err: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
05-31 15:59:50.201 17737 17772 W System.err: at libcore.io.Linux.open(Native Method)
05-31 15:59:50.201 17737 17772 W System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
05-31 15:59:50.201 17737 17772 W System.err: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
05-31 15:59:50.201 17737 17772 W System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
05-31 15:59:50.201 17737 17772 W System.err: at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7770)
05-31 15:59:50.201 17737 17772 W System.err: at libcore.io.IoBridge.open(IoBridge.java:560)
05-31 15:59:50.201 17737 17772 W System.err: ... 11 more
05-31 15:59:50.232 17737 17766 W libc : Access denied finding property "vendor.mali.config"
 
Oct 27, 2018
18
2
38
honolulu
I'm thinking of flashing GSI rom on this tablet, since I'm fed up with slowness/lag on stock Samsung ROM. Primary usage being kids games (not graphic intensive) and as ebook reader.

Can anybody suggest if GSI rom will work faster/smoother for above use case or I should stick with official a13 ROM?
I don't mind going back to a12.1 as long it is stable & fast

"I've only noticed improved performance with vanilla aosp GSI and google GSI android 12 and 13 images, lineageos it's a bit laggy.
I'm working on my own recipe for a Pixel-like rom, I'll share when I get any progress"

This will fix your issue - https://www.androidpolice.com/samsung-ram-plus-phone-how-to-disable/

Tried that - made a bit of difference but just gonna return the tablet.



if you still own it: maybe you're in the mood to take a look here:https://forum.xda-developers.com/t/samsung-galaxy-one-ui-optimization-guide.4376755/


fyi if you lose the ability to toggle the bootloader lock/unlock, just do the wifi and clock rewind trick!
 

gguman

Member
May 31, 2023
21
0
Is it possible to change build.props w/o root as some apps thoughts the device rooted and refuse to start?
 

Attachments

  • PXL_20230601_110934073.jpg
    PXL_20230601_110934073.jpg
    5.7 MB · Views: 26

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Hi, double tap to wake works on GSI ROMs?
    Yeah, you can enable it under Phh-Treble settings>Samsung features>Enable double tap to wake
    1
    I'm new to Samsung devices. I have some questions. Do we have to flash TWRP to install GSI ROMs?
    Yes
    Can't we just install ROMs from fastboot?
    Stock Samsung recovery does not support fastbootd but can be patched with this
    Or we are not able to enter fastboot mode without TWRP? I'm confused. Thanks for help.
    See above
    1
    I'm having some trouble finding the stock android recovery for the SM-X200, can someone point me in the right direction?
    You can extract it from the AP tar file of the stock rom. And the Stock recovery is only needed to flash Larger/highly customized GSI's. LOS, Treble Droid and other less customized GSi's doesn't need to flash stock recovery.
  • 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.