• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[ROM][SM-T500] Samsung Galaxy Tab A7 10.4 (2020) - LineageOS 18.1

Search This thread

agreenbhm

Senior Member
Jun 14, 2010
197
102
USA
Samsung Galaxy S21
Update 9:46am EST July 15 2021: new builds of TWRP and LineageOS with TWRP touch fixed and LOS w/ space for Gapps is now live.

WARNING: USE AT YOUR OWN RISK.

I have successfully ported TWRP and Lineage OS 18.1 to the Samsung Galaxy Tab A7 10.4 (2020), aka SM-T500. This is my first time porting TWRP or LOS, so there may be issues unknown about at this time. Thus far, the only known issue is that the touchscreen in TWRP does not work. This can be worked around by using a USB mouse and/or accessing the device via ADB.

Here are the steps to follow:
  1. Update your device to the latest stock ROM (as of this writing) either using the built-in system updater or via Odin. You want the build that ends with "3BUF3".
  2. Unlock device bootloader using instructions from other threads. This will wipe your device.
  3. Boot into download mode and flash "vbmeta_disabled_R.tar" via Odin in the "Userdata" slot to disable verified boot. This will wipe your device again.
  4. Boot device back into download mode and flash TWRP via Odin in the "AP" slot. If you boot up into the stock ROM rather than booting directly back into download mode then go through the initial setup process of the stock ROM and enable developer tools and ensure OEM Unlocking is still enabled (VaultKeeper can possibly undo OEM Unlocking if you get to the ROM but don't go into Developer Tools and view OEM Unlocking is enabled, so make sure to do this).
  5. Boot device into TWRP (recovery mode) and format (not wipe) your data partition. Then reboot back into TWRP.
  6. Push LineageOS (super.new.ext4.img) to device. Ideally push it to an SD card formatted with ExFat or EXT2/3/4 (FAT/FAT16/FAT32/VFAT won't work due to file-size limitations).
  7. Install LineageOS image to "Super" partition. Make sure to select "Install from Image" in order to show .img files in the install selector screen.
  8. (Optional) Push NikGapps Omni to your device and install the zip. Make sure you include a "nikgapps.config" file in your "/tmp" folder that is configured to install to "system" rather than "product" or "default".
  9. Reboot to system. You should now be in LOS with Gapps.
  10. (Optional, but recommended): Install Magisk via TWRP
  11. (Optional, but recommended): Run fix script to fix brightness slider not working and to make Magisk work. If you didn't install Magisk but only want the brightness fix, just enter "n" when prompted in the script. To run the script:
    1. NOTE: Script has .txt file extension to allow hosting on AFH. Remove that so it's just .sh to match the instructions below.
    2. Download and push to device when booted into TWRP
      1. adb push sm-t500_fixes.sh /tmp
    3. Enter an adb shell
      1. adb shell
    4. Change directories and set permissions
      1. cd /tmp
      2. chmod +x /tmp/sm-t500_fixes.sh
    5. Run script
      1. /tmp/sm-t500_fixes.sh

Tips:
  • If you are not seeing all of your storage space in the OS on the internal flash, boot to TWRP and format data.
  • Flash TWRP via "AP" slot and flash VBMeta_Disabler via "Userdata" slot in Odin.
  • Flash LineageOS as an Image, not as a Zip.
  • For Gapps, use the latest NikGapps for ARM64 and Android 11/R.
  • For Gapps, make sure you install to the System partition and not Product. To do this you need to slightly modify a nikgapps.config file. Instructions on that can be found on the NikGapps site.

Downloads:
Known Issues:
  • OS-encrypted storage (Internal Data) not able to be decrypted in TWRP.
  • Brightness controls don't work: Fixed via "sm-t500_fixes.sh script.
  • TWRP touch screen doesn't work (use USB keyboard or adb). Should be fixed with TWRP Beta 3.
  • TWRP formatting external SD card may hardbrick device. Do not do this! Fixed with TWRP Beta 2.
 
Last edited:

lewmur

Senior Member
Apr 30, 2011
1,816
390
I have successfully ported TWRP and Lineage OS 18.1 to the Samsung Galaxy Tab A7 10.4 (2020), aka SM-T500. This is my first time porting TWRP or LOS, so there may be issues unknown about at this time. Thus far, the only known issue is that the touchscreen in TWRP does not work. This can be worked around by using a USB mouse and/or accessing the device via ADB.

Here are the rough steps to follow:
  1. Unlock device bootloader using instructions from other threads.
  2. Patch stock ROM (AP) using Magisk, then flash rooted ROM. Will likely need to wipe device after this.
  3. Boot into rooted ROM and ensure "OEM Unlocking" is still enabled in "Developer Tools".
  4. Boot back into download mode and flash "vbmeta_disabled_R.tar" to disable verified boot.
  5. Boot device back into rooted stock ROM to ensure things are still functional (may require a device wipe at this step).
  6. Boot device into download mode and use ODIN to flash TWRP recovery.tar file via "AP" slot.
  7. Boot device into TWRP to verify functionality (hold Vol-Up + Power during boot).
  8. Access TWRP via adb using "adb shell" or with USB mouse (touch functionality currently not working).
  9. Format data partition on device.
    • Via ADB shell: twrp format data
    • Via USB mouse: Wipe -> Advanced -> Format Data
  10. Boot device into download mode.
    • Via ADB shell: twrp reboot download
    • Via USB mouse: Reboot -> Download
  11. Flash LineageOS tar file via ODIN using the "AP" slot.
  12. If device boots into TWRP after flashing LineageOS, use USB mouse to select: Reboot -> System
  13. Device should boot and stall for ~1m at the Samsung logo screen with red text below, then should go blank and then display LineageOS boot image.

Downloads:
Great news!! But I think you need to post it in the ROMs, Kernels, Recover thread.
 

wizzdome

Senior Member
Jan 10, 2012
169
14
Denver
Thanks,

After flashing the vbmeta it booted into recovery automatically after what looked like a bootloop in progress, so I wiped with factory reset and then it rebooted fine. (still not sure exactly what the vbmeta does I was hoping it would make it so i didnt get that stupid pop up asking me to hit power button to continue booting due to it having the patched os) anyhow booted fine and twrp installed as you stated without touch screen but mouse with otg works fine. (great job so far) On to LOS... I think I should have checked oem lock before flashing LOS as when I installed I get stuck at boot screen that says oem lock is on... must have been from my factory reset... (facepalm)
Nope... Still sticking on boot with the following showing on the screen...

RPMB fuse not set
RPMB Provisioned
Current BInary: Custom (0x30f)
FRP Lock : OFF
OEM Lock : ON (U) {this was off verified before flash}
KG Status : Checking
Waranty Void : 0x1 (0xE02)
Quallcomm Secureboot : Enable
RP SWREV : B3 (1,1,1,3,1,1) k3 s3
secure download : enable
grdm status : normal (d0000501)
did : 041ce2d22dba

this is displayed in the corner on the bootscreen and looks like it belongs on the download screen, anyhow booting into twrp from this point works however factory reset fails with unable to mount key(something and key(something else) i figure i will let it sit a while as I know sometimes it just takes first boot a while to go through however it doesnt seem to be the problem. Have you had a positive install of the LOS? I am wondering if I had maybe gotten a bad copy of the file. When i go to install I get a pass in odin so not quite sure where to go from here other than back to the factory image any help to get this going would be great... I took on this task cause i needed someting to take my mind off the severely crappy week I have had... so looking forward to anything you can share here...
 
Last edited:

agreenbhm

Senior Member
Jun 14, 2010
197
102
USA
Samsung Galaxy S21
Something to mention: there is not enough space on the /system partition to flash Gapps. I created a build that supports it (with a resized /system partition) but I couldn't get it to flash via Odin. The only way I got it to work was by flashing it via TWRP as an img file. I will be posting that soon. Unfortunately that will be the end of development for now as I hard-bricked the device and need to wait for a repair or replacement. Should be back developing in 2 weeks.
 

lewmur

Senior Member
Apr 30, 2011
1,816
390
Something to mention: there is not enough space on the /system partition to flash Gapps. I created a build that supports it (with a resized /system partition) but I couldn't get it to flash via Odin. The only way I got it to work was by flashing it via TWRP as an img file. I will be posting that soon. Unfortunately that will be the end of development for now as I hard-bricked the device and need to wait for a repair or replacement. Should be back developing in 2 weeks.
I've not been able to flash this yet but I know that the latest TWRP versions have a way to fix the system partition to accept gapps. /Wipe/Advanced check system then resize. Sometimes you have to do it more than once if it is a large gapps.
 

agreenbhm

Senior Member
Jun 14, 2010
197
102
USA
Samsung Galaxy S21
I've not been able to flash this yet but I know that the latest TWRP versions have a way to fix the system partition to accept gapps. /Wipe/Advanced check system then resize. Sometimes you have to do it more than once if it is a large gapps.
I will look into that, but I'm not optimistic it will work. This device does not separately present the system partition, rather it uses a super partition which contains system, vendor, product, and odm. TWRP only shows me the super partition for working with. I was able to resize the system partition by expanding the Lineage image and file system on my pc to match the original stock system partition, then rebuilt the super image with the other partitions it needs.
 

Top Liked Posts

  • 1
    I got it all now..i think. Only problem I'm seeing at the moment is getting "Android Setup keeps stopping"
    Yeah I kept getting that (I really don't know how I fixed it)
  • 6
    Good news, my tablet should be back on Tuesday and I will be looking at continuing my dev work then.
    3
    Any new release of twrp
    I made a new build yesterday however I can't test it yet since my device is not back to me yet. If you want a copy to try dm me and I will share it. But be warned, I don't even know if it boots (though you could always reflash the old one if that's the case). The goal of the new build was to fix the SD card bug and make the touchscreen work.
    2
    I have just two questions.
    1. Does it work on T505 since it's basicaly the same thing, but with LTE?
    2. Does it support Treble? Well, with a little bit of modifications, of course. Since "vendor", "product" and "odm" are sepparate folders within the same partition, and not inside the "system" folder like back in the old days, could it be possible to take a GSI, unpack it, put the "system" folder where it belongs and repack the whole thing with the "vendor", "product" and "odm" folders back into the "super" partition image?

    Edit: Also, the Lineage you ported, was originally a GSI?
    @agreenbhm
    Just to be clear. I'm not asking you to build anything. I just wanna know if i can install TWRP on mine. Or even Lineage, because i neither use, nor care about the LTE functionality. If i remember correctly, this wasn't a problem on the other Galaxy Tab series tablets. The stuff was interchangeable.
    1. I don't know, I don't have that model. Try it and report back.
    2. GSI implies Treble. I did exactly as you're describing to port it. I took the stock super.img and replaced the system partition with the Lineage GSI.

    I don't see why TWRP wouldn't work on the LTE version since that's not used in recovery anyway but I'm not certain. You probably would be safest to make your own port if LOS by replacing the system image within the super image of the ROM for the LTE version with the Lineage GSI from Phh. Look into the tools "lpunpack" and "lpmake" for a starting place for how to do that. It's really not very difficult. TWRP was the part that took me a while.
    2
    Is it giving you any error when installing? Maybe post a copy of your nikgapps.config also.
    It will have to wait till tomorrow when I have some free time. But thanks for the help.
    2
    Just tested your Beta2 of twrp (something that I usually don't do) and touch is working. MTP is not working; as I have a "working" (no decryption) twrp from quite some time if you share your source I may can help you (if you're interested).
    I have no intention on sharing builds or getting too much involved here on xda.. I own this device from a week before lockdown ended, I've managed to make a "working"ish twrp-3.5.1 and lineage-17.1 recovery (with fastbootd). Then I've started again to work so I've dropped the project to port LineageOS.. but if you're willing to share your source I may can help iron some bugs when I have time.
    Didn't test your Lineage build (maybe I will), I still have to update to official 11 firmware.
    Thanks for the reply. The sources can be found on the Github repo I made, which is here: https://github.com/agreenbhm/android_device_samsung_gta4lwifi.

    My Lineage build consists of the 18.1 Lineage GSI as the system partition along with stock vendor, odm, and product partitions within the super image.
  • 10
    Update 9:46am EST July 15 2021: new builds of TWRP and LineageOS with TWRP touch fixed and LOS w/ space for Gapps is now live.

    WARNING: USE AT YOUR OWN RISK.

    I have successfully ported TWRP and Lineage OS 18.1 to the Samsung Galaxy Tab A7 10.4 (2020), aka SM-T500. This is my first time porting TWRP or LOS, so there may be issues unknown about at this time. Thus far, the only known issue is that the touchscreen in TWRP does not work. This can be worked around by using a USB mouse and/or accessing the device via ADB.

    Here are the steps to follow:
    1. Update your device to the latest stock ROM (as of this writing) either using the built-in system updater or via Odin. You want the build that ends with "3BUF3".
    2. Unlock device bootloader using instructions from other threads. This will wipe your device.
    3. Boot into download mode and flash "vbmeta_disabled_R.tar" via Odin in the "Userdata" slot to disable verified boot. This will wipe your device again.
    4. Boot device back into download mode and flash TWRP via Odin in the "AP" slot. If you boot up into the stock ROM rather than booting directly back into download mode then go through the initial setup process of the stock ROM and enable developer tools and ensure OEM Unlocking is still enabled (VaultKeeper can possibly undo OEM Unlocking if you get to the ROM but don't go into Developer Tools and view OEM Unlocking is enabled, so make sure to do this).
    5. Boot device into TWRP (recovery mode) and format (not wipe) your data partition. Then reboot back into TWRP.
    6. Push LineageOS (super.new.ext4.img) to device. Ideally push it to an SD card formatted with ExFat or EXT2/3/4 (FAT/FAT16/FAT32/VFAT won't work due to file-size limitations).
    7. Install LineageOS image to "Super" partition. Make sure to select "Install from Image" in order to show .img files in the install selector screen.
    8. (Optional) Push NikGapps Omni to your device and install the zip. Make sure you include a "nikgapps.config" file in your "/tmp" folder that is configured to install to "system" rather than "product" or "default".
    9. Reboot to system. You should now be in LOS with Gapps.
    10. (Optional, but recommended): Install Magisk via TWRP
    11. (Optional, but recommended): Run fix script to fix brightness slider not working and to make Magisk work. If you didn't install Magisk but only want the brightness fix, just enter "n" when prompted in the script. To run the script:
      1. NOTE: Script has .txt file extension to allow hosting on AFH. Remove that so it's just .sh to match the instructions below.
      2. Download and push to device when booted into TWRP
        1. adb push sm-t500_fixes.sh /tmp
      3. Enter an adb shell
        1. adb shell
      4. Change directories and set permissions
        1. cd /tmp
        2. chmod +x /tmp/sm-t500_fixes.sh
      5. Run script
        1. /tmp/sm-t500_fixes.sh

    Tips:
    • If you are not seeing all of your storage space in the OS on the internal flash, boot to TWRP and format data.
    • Flash TWRP via "AP" slot and flash VBMeta_Disabler via "Userdata" slot in Odin.
    • Flash LineageOS as an Image, not as a Zip.
    • For Gapps, use the latest NikGapps for ARM64 and Android 11/R.
    • For Gapps, make sure you install to the System partition and not Product. To do this you need to slightly modify a nikgapps.config file. Instructions on that can be found on the NikGapps site.

    Downloads:
    Known Issues:
    • OS-encrypted storage (Internal Data) not able to be decrypted in TWRP.
    • Brightness controls don't work: Fixed via "sm-t500_fixes.sh script.
    • TWRP touch screen doesn't work (use USB keyboard or adb). Should be fixed with TWRP Beta 3.
    • TWRP formatting external SD card may hardbrick device. Do not do this! Fixed with TWRP Beta 2.
    6
    Good news, my tablet should be back on Tuesday and I will be looking at continuing my dev work then.
    3
    Any new release of twrp
    I made a new build yesterday however I can't test it yet since my device is not back to me yet. If you want a copy to try dm me and I will share it. But be warned, I don't even know if it boots (though you could always reflash the old one if that's the case). The goal of the new build was to fix the SD card bug and make the touchscreen work.
    2
    I have successfully ported TWRP and Lineage OS 18.1 to the Samsung Galaxy Tab A7 10.4 (2020), aka SM-T500. This is my first time porting TWRP or LOS, so there may be issues unknown about at this time. Thus far, the only known issue is that the touchscreen in TWRP does not work. This can be worked around by using a USB mouse and/or accessing the device via ADB.

    Here are the rough steps to follow:
    1. Unlock device bootloader using instructions from other threads.
    2. Patch stock ROM (AP) using Magisk, then flash rooted ROM. Will likely need to wipe device after this.
    3. Boot into rooted ROM and ensure "OEM Unlocking" is still enabled in "Developer Tools".
    4. Boot back into download mode and flash "vbmeta_disabled_R.tar" to disable verified boot.
    5. Boot device back into rooted stock ROM to ensure things are still functional (may require a device wipe at this step).
    6. Boot device into download mode and use ODIN to flash TWRP recovery.tar file via "AP" slot.
    7. Boot device into TWRP to verify functionality (hold Vol-Up + Power during boot).
    8. Access TWRP via adb using "adb shell" or with USB mouse (touch functionality currently not working).
    9. Format data partition on device.
      • Via ADB shell: twrp format data
      • Via USB mouse: Wipe -> Advanced -> Format Data
    10. Boot device into download mode.
      • Via ADB shell: twrp reboot download
      • Via USB mouse: Reboot -> Download
    11. Flash LineageOS tar file via ODIN using the "AP" slot.
    12. If device boots into TWRP after flashing LineageOS, use USB mouse to select: Reboot -> System
    13. Device should boot and stall for ~1m at the Samsung logo screen with red text below, then should go blank and then display LineageOS boot image.

    Downloads:
    Great news!! But I think you need to post it in the ROMs, Kernels, Recover thread.
    2
    Just tested your Beta2 of twrp (something that I usually don't do) and touch is working. MTP is not working; as I have a "working" (no decryption) twrp from quite some time if you share your source I may can help you (if you're interested).
    I have no intention on sharing builds or getting too much involved here on xda.. I own this device from a week before lockdown ended, I've managed to make a "working"ish twrp-3.5.1 and lineage-17.1 recovery (with fastbootd). Then I've started again to work so I've dropped the project to port LineageOS.. but if you're willing to share your source I may can help iron some bugs when I have time.
    Didn't test your Lineage build (maybe I will), I still have to update to official 11 firmware.
    Thanks for the reply. The sources can be found on the Github repo I made, which is here: https://github.com/agreenbhm/android_device_samsung_gta4lwifi.

    My Lineage build consists of the 18.1 Lineage GSI as the system partition along with stock vendor, odm, and product partitions within the super image.