[rom] [twrp] sm-t290 & sm-t295 [discussions & help thread]

Search This thread

V0latyle

Forum Moderator
Staff member
Sorry. Bad morning so I apologize. Many are getting very confused. Can we please clean thread up some? I may have said it wrong yes. Really tired of this butthurt mentality the past few years. No worries. Ill post no more
Again, if you see issues, please report them for the moderator staff to handle. There's no excuse to be rude yourself.

You're welcome to participate in this community, just be civil and respectful to others.
 

J.Michael

Recognized Contributor
Jan 20, 2018
1,816
2,064
Samsung Galaxy Tab A series
@timba123 If you used more carriage returns I would recommend your post for inclusion in the first post of this thread as "current best practice".

I believe it covers all of the important points. O also believe it is essentially a rewrite of John Wu's "Magisk installation" instructions, reordered to be read in a straight line, focusing on Samsung, and with TWRP replacing the Magisk-patched recovery.

Maybe XDA already has a forum consisting of "documents", rather than discussion threads. I haven't seen it, and I have enough trouble finding things that I will not be exploring any time soon.
 

V0latyle

Forum Moderator
Staff member
@timba123 If you used more carriage returns I would recommend your post for inclusion in the first post of this thread as "current best practice".

I believe it covers all of the important points. O also believe it is essentially a rewrite of John Wu's "Magisk installation" instructions, reordered to be read in a straight line, focusing on Samsung, and with TWRP replacing the Magisk-patched recovery.

Maybe XDA already has a forum consisting of "documents", rather than discussion threads. I haven't seen it, and I have enough trouble finding things that I will not be exploring any time soon.
I've never quite figured out how to patch Samsung recovery in Magisk. I find it easier to simply flash TWRP, then install Magisk through TWRP. Since the factory AP files are extremely large, it takes forever to transfer to the device and patch in Magisk. TWRP by itself is much smaller.

Do you know of a way to remove competing SU binaries? I keep running into an issue with LineageOS because of the preinstalled SU.
 

J.Michael

Recognized Contributor
Jan 20, 2018
1,816
2,064
Samsung Galaxy Tab A series
I've never quite figured out how to patch Samsung recovery in Magisk. I find it easier to simply flash TWRP, then install Magisk through TWRP. Since the factory AP files are extremely large, it takes forever to transfer to the device and patch in Magisk. TWRP by itself is much smaller.

Do you know of a way to remove competing SU binaries? I keep running into an issue with LineageOS because of the preinstalled SU.
I know nothing of Lineage, let alone of SU binaries. I would have assumed that preinstalled SU was like preinstalled Magisk -- you have to wait for new release of Lineage ROM, you can't update it.

When I installed Magisk, there was no TWRP for this device. I don't remember it being too much trouble to copy AP.tar to tablet, or magisk-patched.tar back to PC. I think on my fourth or fifth go-around I created a smaller .tar containing only boot, recovery, and vbmeta. I think my main interest was in getting Odin to run faster.

At the time I was told Magisk *had* to be installed in recovery. I'm still not clear whether Magisk can be installed in boot, or TWRP is being patched by Magisk. No idea whether Magisk will ever patch boot if given a .tar file. I think when I was doing it I found no difference in the patched file whether Recovery Mode was checked or not.

I'm still running the Android 9 (Pie) that came on the tablet. Maybe a newer kernel makes life easier.
 

V0latyle

Forum Moderator
Staff member
I know nothing of Lineage, let alone of SU binaries. I would have assumed that preinstalled SU was like preinstalled Magisk -- you have to wait for new release of Lineage ROM, you can't update it.

When I installed Magisk, there was no TWRP for this device. I don't remember it being too much trouble to copy AP.tar to tablet, or magisk-patched.tar back to PC. I think on my fourth or fifth go-around I created a smaller .tar containing only boot, recovery, and vbmeta. I think my main interest was in getting Odin to run faster.

At the time I was told Magisk *had* to be installed in recovery. I'm still not clear whether Magisk can be installed in boot, or TWRP is being patched by Magisk. No idea whether Magisk will ever patch boot if given a .tar file. I think when I was doing it I found no difference in the patched file whether Recovery Mode was checked or not.

I'm still running the Android 9 (Pie) that came on the tablet. Maybe a newer kernel makes life easier.
I don't know how to create custom tar files, or how to extract images from the AP tar. Magisk does patch the boot image on my Pixel device but I'm not sure exactly what's different for Samsung devices, what with the discrete recovery and inability to flash specific partitions via bootloader (which for all intents and purposes doesn't exist on Samsung devices).
 

J.Michael

Recognized Contributor
Jan 20, 2018
1,816
2,064
Samsung Galaxy Tab A series
I don't know how to create custom tar files, or how to extract images from the AP tar. Magisk does patch the boot image on my Pixel device but I'm not sure exactly what's different for Samsung devices, what with the discrete recovery and inability to flash specific partitions via bootloader (which for all intents and purposes doesn't exist on Samsung devices).
I don't understand why you say bootloader does not exist on Samsung. I thought BL.tar was bootloader. And don't most devices have a discrete recovery?

I use tar under Linux. I don't quite trust the Windows version in UnxUtils. You probably have a tar in Android.

To make a smaller tar file, at a command prompt type
Code:
tar tvf AP.tar
tar xvf AP.tar boot.img recovery.img vbmeta.img
tar cvf miniAP.tar boot.img recovery.img vbmeta.img
The first command prints the TOC, Table of Contents.
The second extracts three files from AP.tar -- it does not change AP.tar.
The third creates a new tar file consisting of the specified files.

The only thing tricky is you have to identify each file by its exact name, you can't use wildcards. (You can when you are building a new tar, because it's the shell filling in the names. When extracting, you have to write the name exactly as it is recorded in the tar file.) So if the tar contains "boot.img.lz4", you have to say that.

I don't know if, when the Magisk manager app is told to patch a tar file, it assumes "recovery" is where Magisk is to be injected, or it figures it out each time. But, when it is injecting Magisk into recovery, it also "patches" boot and vbmeta. Those other two may not be "patch to inject code", but they are at least "patch to change signature" -- maybe just "patch to clear the flag that says expect a signature".
 

Talich52

Senior Member
Dec 24, 2010
476
249
I use tar under Linux. I don't quite trust the Windows version in UnxUtils.
I don't have Linux and use Windows. And to work with firmware files I use TotalCommander. I open the AP.tar.md5 file with it and delete all unnecessary files, leaving only boot.img & vaultkeeper.img. Next, you need to rename the file as AP.tar and copy it to the device and patch it with the latest Magisk program. The recovery file for T290/T295 is not needed, Magisk is not put in the recovery section, it is enough to patch the boot.img & vk.img kernel, and then flash through ODIN.
In another option, TWRP is installed and multidisabler is used from it (+ format data is made) and Magisk.zip itself.
In the first option, it is assumed that custom recovery is not needed, or you can install it later ...
 
  • Like
Reactions: J.Michael

V0latyle

Forum Moderator
Staff member
I don't understand why you say bootloader does not exist on Samsung.
Samsung devices don't have a bootloader mode where partitions can be directly flashed. On my Pixel 5, I can flash any partition from bootloader, including bootloader itself.
I thought BL.tar was bootloader. And don't most devices have a discrete recovery?
If you mean a discrete recovery partition, no - on A/B devices, recovery lives in the boot image, and bootloader calls either normal kernel or the recovery kernel. A discrete recovery is not needed because of the two slots - while system is running on one slot, OTA packages can be extracted and written to the "other" slot (note: by "slots" here I mean A/B, where each critical system partition has a duplicate: /boot_a and /boot_b, /system_a and system_b)

This obviates the need for discrete recovery, because once the inactive slot has been updated, system calls a reboot to that slot, and upon successful boot, marks it active. The only interruption to the user experience is the reboot. See seamless system updates

Contrast that with Samsung, who has obstinately refused to follow this model; to update, the device must reboot to recovery mode, then unpack and flash the update, preventing use of the device until the update has completed.
I use tar under Linux. I don't quite trust the Windows version in UnxUtils. You probably have a tar in Android.

To make a smaller tar file, at a command prompt type
Code:
tar tvf AP.tar
tar xvf AP.tar boot.img recovery.img vbmeta.img
tar cvf miniAP.tar boot.img recovery.img vbmeta.img
The first command prints the TOC, Table of Contents.
The second extracts three files from AP.tar -- it does not change AP.tar.
The third creates a new tar file consisting of the specified files.

The only thing tricky is you have to identify each file by its exact name, you can't use wildcards. (You can when you are building a new tar, because it's the shell filling in the names. When extracting, you have to write the name exactly as it is recorded in the tar file.) So if the tar contains "boot.img.lz4", you have to say that.

I don't know if, when the Magisk manager app is told to patch a tar file, it assumes "recovery" is where Magisk is to be injected, or it figures it out each time. But, when it is injecting Magisk into recovery, it also "patches" boot and vbmeta. Those other two may not be "patch to inject code", but they are at least "patch to change signature" -- maybe just "patch to clear the flag that says expect a signature".
So would we need to patch the boot image in Magisk, then repackage it and flash it in AP in Odin? Seems complicated - I'd rather flash TWRP to /recovery, then install Magisk through TWRP
I don't have Linux and use Windows. And to work with firmware files I use TotalCommander. I open the AP.tar.md5 file with it and delete all unnecessary files, leaving only boot.img & vaultkeeper.img. Next, you need to rename the file as AP.tar and copy it to the device and patch it with the latest Magisk program. The recovery file for T290/T295 is not needed, Magisk is not put in the recovery section, it is enough to patch the boot.img & vk.img kernel, and then flash through ODIN.
In another option, TWRP is installed and multidisabler is used from it (+ format data is made) and Magisk.zip itself.
In the first option, it is assumed that custom recovery is not needed, or you can install it later ...
Oh okay that answers my above question.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    You guys are fast to edit a someone's speech but can't clean this thread up?
    If you have issues with posts in this thread, use the Report button. The only problems I've seen thus far have been your posts - you're rude, demanding, and abrasive. Perhaps you should take a moment to familiarize yourself with the Forum Rules linked in my signature before you continue posting in such a manner.
    3
    Is a TWRP root version of this being worked on? Having TWRP would be great as it provides a lot of great features.

    I was able to root my SM-T290 using Magisk Manager and a collection of random instructions from different parts of the internet.

    The purpose of rooting my device was to operate Kali Nethunter and its modules in which root access is needed.

    I wanted to provide the steps I took to root my device. Disclaimer: PROCEED AT YOUR OWN RISK! I AM NOT RESPONSIBLE IF YOU BRICK YOUR DEVICE OR DONT KNOW HOW TO RECOVER FROM A SOFT BRICK.
    I do not take credit for this, I am simply aggregating what I found during my experience of trying to root my device.

    Furthermore, at the time of writing, doing all the steps will have your ctsProfile set to false, which I believe means you can't do certain banking functions, etc. I've tried numerous guides online to attempt to fix it, but none have worked. They all just unroot the device and I have to do a quick root with Odin since I saved the files from all the steps.

    Needed Items:
    • Cable to connect SM-T290 to PC
    • microSD card
    • Ability to connect microSD card to a PC
    • Paperclip or pinhole stick to open slot on SM-T290
    • Linux (VM is not needed if you don't have one. You can use the Windows Linux Subsystem & obtain Ubtunu from Microsoft Store)
    • Stock Firmware

    DRIVERS

    Install the drivers for your device on your computer. You can google this or connect it to the computer and let it install them on its own.

    UNLOCK BOOTLOADER & USB DEBUGGING

    Before you can do this, you need to enable developer options.

    1) Go to Settings
    2) Go to About tablet
    3) Go to Software Information
    4) Click on Build Number repeatedly. You will see a message at the bottom saying X amounts of taps remaining to enable it
    5) Go back to Settings
    6) At the bottom, you'll see Developer options, click it
    7) Locate OEM Unlocking and enable it. Accept the warning is given, if it is shown
    8) Scroll down and locate USB debugging and enable it

    You've now enabled OEM Unlock & USB debugging.

    9) Turn off the device.
    10) Connect the USB cable to the computer. Do not connect it to the device yet
    11) Press and hold the Up & Down volume buttons at the same time
    12) While holding them down, connect the other end of the USB cable to the device
    13) A warning screen should show up prompting about the risk of unlocking the bootloader
    14) Press and hold (Long Press) the Up Volume button

    Your bootloader should now be unlocked. You can confirm if this is the case as every time you boot the device, you'll receive a bootloader warning.

    Download Stock Firmware

    You need a copy of your stock firmware. First, you need to look up what version you are using.

    1) Go to Settings
    2) Go to About tablet
    3) Go to Software information
    4) Find Build Number and write down the portion after the bulk of numbers, ie. T290XXS3ATC2
    5) Go to <I can't enter a URL since I don't have 10+ posts>. Google SFirmware Samsung SM-T290 (I do not own this site nor do I know how the firmware is obtained. Due to this, I don't store anything personal on the rooted tablet)
    6) Find the build number matching your tablet and its country
    7) Download the files to your computer

    File Modification Needed Towards Root

    1) Unzip the file downloaded
    2) On your Linux VM or Linux Sub-Windows System, go to the folder where the extracted files are at
    3) Find the AP*.tar.md5 file
    4) Extract its contents using the following command: tar -xvf <filename>
    5) Decompress the following files from the extracted AP tar file: boot.img.lz4, recovery.img.lz4, and vbmeta.img.lz4, using the following command: unlz4 <files>
    6) Add the newly decompressed files from the last step into a new tar file, using the following command: tar -cvf pre-processed.tar <files>
    7) Copy the newly created tar file named pre-processed.tar onto a microSD card
    8) Insert the microSD card into the tablet
    9) Using Files, copy pre-processed.tar from the microSD card to the Downloads folder on the Internal Storage. (This step may be optional, but I did this anyway).
    10) Install Magisk Manager on the tablet. The software can be found here: <I can't enter a URL since I don't have 10+ posts> Google Magisk Manager
    11) Open Magisk Manager
    12) You will see it says Magisk is not installed, to the right there is an Install button, click it.
    13) You will be prompted if you want to install it now, click Install.
    14) Navigate to the pre-processed.tar file in Downloads and let it do its thing.
    15) It will process and say it generated a new file, which can be found in the Downloads folder called something like magisk-patched.rar
    16) Copy that file back to the microSD card
    17) Copy that file to your computer
    18) Extract its contents using the following command: tar -xvf post-processed.tar
    19) Go into the new directory containing the extracted content and be sure to add post_ in front of each file there
    20) Copy the files to the AP folder which you created the pre-processed.tar files from.
    21) For post_boot.img and post_recovery.img (not post_vbmeta.img), perform the following command in Linux for each:
    Code:
    dd conv=notrunc if=<POST_PROCESSED_EXTRACTED_*.img_FILE> of=<PRE_PROCESSED_EXTRACTED_*.img_FILE>
    22) Delete the post_boot.img file to prevent any confusion
    23) Delete the post_recovery.img file to prevent any confusion
    24) Delete the vbmeta.img (original) file. Find post_vbmeta.img and rename to vbmeta.img
    25) Create new AP tar file with all original extracted files in the AP folder, except replace the following:
    Code:
    boot.img.lz4 -> boot.img (of= file from last step)
    recovery.img.lz4 -> recovery.img (of= file from last step)
    vbmeta.img.lz4 -> vbmeta.img (from post-processed.tar generated by Magisk)

    Remember the command to create a .tar file is tar -cvf AP-Patched.tar <files>

    Odin & Root

    1) Download Odin if you don't have it already have it from <I can't enter a URL since I don't have 10+ posts> Google Odin3
    2) Boot your tablet into download mode. (Device Powered Off -> Power + Up Volume -> Recovery Mode -> Download Mode)
    3) Connect your tablet to your computer
    4) Open Odin and load the files one by one from the downloaded stock firmware. The only difference should be the AP file which should be the newly created AP-Patched.tar file.
    5) Start it & let Odin do its thing.
    6) Once it's done and the device has restarted, you can check Magisk Manager.
    7) If you see Magisk is up to date with a checkmark, congratulations, you now have root access.

    Hope this helps folks out as I spent about 2-3 days trying to figure everything out.
    3
    I too have this same black screen problem. I just recently posted over on the TWRP 3.5.1 thread here. How I got into this mess is that I tried flashing the TWRP v3.5.1 to my brand new Costco (link) SM-T290NZKCXAR using Odin3 vs 3.14.4 by checking the AP box and putting the TWRP v3.5.1 in the original top post in text area. When it finished successfully, my screen turned on (backlight illuminated) but black and vibrates when touched. If I turn it off by holding the power button, it turns on again to this same state. Odin v 3.14.4 seems to recognize it as COM 1 sometimes (and when it does, Windows shows it as a device in the device manager). When I attempt to hold the power, vol up and vol down buttons to reboot into download mode (perahps im not doing it correctly) it will "reboot" into the same black screen/illuminated background state but without Windows or Odin detecting it. If it helps my serial number begins with R9 and I just bought it from Costco yesterday ($111 with tax / on sale for $99) Any thoughts or ideas appreciated and happy to answer questions or provide more details. thx in advance!
    Turn off tablet.
    Connect usb cable to PC, but NOT to tablet.
    Press vol up + vol dn keys and hold them down.
    Insert usb cable into table while holding down keys.
    You should see a screen with text on it. Release keys.
    Follow directions on screen.
    2
    Here is a TWRP test build for the SM-T290 model only:

    Please test this out and give me feedback. Thank you!
    https://github.com/secretwolf98/project/releases/download/vTWRPb1t1/twrp.tar
    2
    Well, the SM-T290 can handle ROMs. But only Project Treble enabled GSIs will work on it. So far, I’m trying to figure out how it could be installed through Odin without TWRP. Because Samsung devices doesn’t have a proper bootloader to be able to accept fastboot commands.

    Actually, my T295 has a fastboot option. I discovered it by accident. I modified the system.img file (new bootani*.qmg files). But, it would not boot. I got an error msg. When I did the vol up + vol dn + pwr keys, I ended up in a menu that showed a fastboot selection. I tried selecting it, but since my system.img would not boot, I could not get into it. Nor could I get into recovery, etc. So, I selected power down. After tablet was off, I could get into download mode.