[RECOVERY][ROOT]TWRP 3.2.3-1 Galaxy Tab S4 - T830/T835

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,831
0
Unofficial release -TWRP recovery for the Galaxy Tab S4 2018 - SM-T830/T835 MSM8998





TWRP 3.2.3-0 Released
Aug 6, 2018
TWRP 3.2.3-0 is out now for most currently supported devices.
What's new in 3.2.3-0:
* Fix automatic installing of OTA zips on encrypted devices
* Remove SuperSU from TWRP
* Support both md5 and md5sum file extensions when doing MD5 checking for zip files
Want to get notifications when we release new versions of TWRP? Install the TWRP app and select your device!
We need your help! The bulk of TWRP work is done by a handful of people on a volunteer basis. We have pushed most of our device files to our github and we have a gerrit instance. If you have the ability, please help us maintain our official devices and/or add your device to our official device list. Thanks in advance!
You can track the progress of builds here





Update 21/9/2018
Beta build released.
Current status - Beta (tested working)
Treble supported
Pretty much everything is working except for ADB and MTP at the moment.


You flash this at your own risk. Please ensure you have the stock ROM to hand downloaded from SAMMOBILE in case of problems. This will trip the knox counter.

NOTE: ON ANDROID 5.1.1> DEVICES IT IS NECESSARY TO GO TO:
Settings -> Developer Options -> OEM unlocking
AND ENABLE OEM UNLOCK FIRST OR YOU MAY ENCOUNTER 'BLOCKED BY FRP LOCK' WHEN FLASHING.



*****INSTALL INSTRUCTIONS:*****


Flash with ODIN in the AP slot.


1. Put your device in DOWNLOAD mode.
(Hold POWER + VOL DOWN + VOL UP) ]

2. Run ODIN and uncheck Auto reboot.

3. Load the file below into the AP slot and hit start.
twrp_3.2.3-1_t830_26918


4. After flashing and ODIN reports PASS immediately force reboot to recovery. Do NOT let the device boot to the OS.
You should now see TWRP recovery.

NOTE: FAILURE TO FOLLOW THE STEPS ABOVE IMPLICITLY WILL RESULT IN STOCK RECOVERY REPLACING TWRP AT FIRST BOOT.




*****OREO ROOT INSTRUCTIONS:*****

Note: A MicroSD card is required to install the files below to your device.

1. Flash the Forced encryption disabler patch. This is only required if you wish to have full functionality in TWRP.
Flashing this will disable Samsung's forced encryption. Disabling encryption will allow TWRP to mount the data partition.
After flashing the patch it is necessary to *FORMAT* (not wipe) the /DATA partition using the FORMAT DATA button under the wipe options.
PLEASE NOTE THIS WILL DELETE EVERYTHING ON INTERNAL STORAGE AND FACTORY RESET THE DEVICE, SO BACK UP ANYTHING YOU WISH TO KEEP.
TabS4_oreo_forced_encryption_disabler

2. To root I suggest installing Magisk as this is a currently supported project, SuperSu is no longer getting active development.
https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445

3. Enjoy your rooted device.


DEVICE TREE: https://github.com/ashyx/TWRP_Samsung_GTS4LWIFI


PLEASE DO *NOT* DIRECT LINK TO THESE FILES. PLEASE LINK TO THIS POST




Credits: Me, Teamwin, @ianmacd. Huge thanks to Ian for his full support and testing, helping patch the kernel and providing everything needed to get this done.

Please note I don't own this device and spend a lot of my free time bringing these builds for you to use and benefit from.


FEEDBACK IS APPRECIATED PLEASE.
THANKS.


DONATE ME HERE IF YOU WANT TO BUY ME A BEER OR HIT THE THANKS BUTTON IF I HELPED YOU

 
Last edited:

ianmacd

Senior Member
Jan 5, 2016
2,322
3,693
208
Amsterdam
localhost
I don't expect this to even boot as I have been forced to use the stock kernel and even if it does there is likely to be problems mounting partitions or accessing certain parts of the file system.
This is due to Samsung's current kernel source being totally borked causing many compiler errors I have not yet managed to fix.
Let me be the first to say thank you for this, @ashyx.

I don't have time to flash it until later in the day, but you mention having to use the stock kernel, so I wanted to point you at my repo of Samsung's kernel source for firmware revision ARGH. Samsung hasn't released the source of a more recent version yet.

I built this before I even had the device (before it had even been released in Europe, in fact), so it's also untested, but I did fix all of the compile errors before committing it. You can either clone this repo, or just cherry-pick the commit that fixes all of the compile errors (e1af7e420d4d1eb0a3302d65bb1b6e8e54f7f36b). The defconfig is as released by Samsung, so probably needs a number of config options turned off before it will produce a kernel that will even boot as an unofficial build.

Thanks once again for all of your hard work (often on devices you don't even own).
 
Last edited:

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,831
0
Let me be the first to say thank you for this, @ashyx.

I don't have time to flash it until later in the day, but you mention having to use the stock kernel, so I wanted to point you at my repo of Samsung's kernel source for firmware revision ARGH. Samsung hasn't released the source of a more recent version yet.

I built this before I even had the device (before it had even been released in Europe, in fact), so it's also untested, but I did fix all of the compile errors before committing it. You can either clone this repo, or just cherry-pick the commit that fixes all of the compile errors (e1af7e420d4d1eb0a3302d65bb1b6e8e54f7f36b). The defconfig is as released by Samsung, so probably needs a number of config options turned off before it will produce a kernel that will even boot as an unofficial build.

Thanks once again for all of your hard work (often on devices you don't even own).
Ah good stuff.
Yep most of them were include and tracepoint errors. Had pretty much fixed most of them by the looks of it, but got fed up after a while and got stuck at multiple tracepoint defines errors.

Honestly sometimes Samsung just release any old rubbish source code just to comply with the GPL.
No way is this the actual source code used in the stock kernel.

Many thanks for the link to the kernel source. I'll ensure you get some credit for the commits.
 

ianmacd

Senior Member
Jan 5, 2016
2,322
3,693
208
Amsterdam
localhost
Honestly sometimes Samsung just release any old rubbish source code just to comply with the GPL.
No way is this the actual source code used in the stock kernel.
Yes, I wouldn't be a bit surprised if we're never able to produce a bootable custom kernel for this device, as with the Tab S3. Once we have TWRP up and running, however, I shall certainly give it my best shot.
 

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,831
0
Yes, I wouldn't be a bit surprised if we're never able to produce a bootable custom kernel for this device, as with the Tab S3. Once we have TWRP up and running, however, I shall certainly give it my best shot.
It's ridiculous. Many times I have had to debug Samsung kernel sources. As you have discovered some just do not boot the OS no matter what.
I had an issue with the Tab A a while back where no matter what I couldn't get the kernel to boot.

I put a complaint into Samsung's open source dept. and threatened to report it to the GPL for releasing unbootable source code.
Lo and behold the next source code release booted perfectly.
 

ianmacd

Senior Member
Jan 5, 2016
2,322
3,693
208
Amsterdam
localhost
Current status - UNTESTED

This is really only intended for users who have fair knowledge of flashing custom stuff. I do not recommend for novices until the build is proved stable and proper instructions are available.

I don't expect this to even boot as I have been forced to use the stock kernel and even if it does there is likely to be problems mounting partitions or accessing certain parts of the file system.
I've flashed this now, @ashyx, and there's both good and bad news.

The good news is that it boots!

The bad news is that, although I didn't swipe to allow modifications, it's no longer possible to boot back to system. dm-verity appears to have been triggered. Interestingly, it takes as long as a full boot before the system finally reports Verification failed, so possibly this can still be bypassed by making the right edits from TWRP.

That's all I've done with it at this point. Let me know which steps you would like me to carry out. I'll leave it as is now until I hear from you.

Photos attached. Note the newly appeared open padlock and Custom in the second photo.
 

Attachments

Last edited:

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,831
0
I've flashed this now, @ashyx, and there's both good and bad news.

The good news is that it boots!

The bad news is that, although I didn't swipe to allow modifications, it's no longer possible to boot back to system. dm-verity appears to have been triggered. Interestingly, it takes as long as a full boot before the system finally reports Verification failed, so possibly this can still be bypassed by making the right edits from TWRP.

That's all I've done with it at this point. Let me know which steps you would like me to carry out. I'll leave it as is now until I hear from you.

Photos attached. Note the newly appeared open padlock and Custom in the second photo.
Great.
Now I know it boots I'll fix the DM-VERITY issue.
I take it DATA is unmountable until FORMATTED?
 

ianmacd

Senior Member
Jan 5, 2016
2,322
3,693
208
Amsterdam
localhost
Great.
Now I know it boots I'll fix the DM-VERITY issue.
I take it DATA is unmountable until FORMATTED?
I hadn't done any more with it, but I've just tried and data is indeed unmountable.

Less expected is that all other file-systems (system, efs, cache, etc.) are also unmountable. Or is that the result of dm-verity having been tripped?
 
  • Like
Reactions: fre78

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,831
0
I hadn't done any more with it, but I've just tried and data is indeed unmountable.

Less expected is that all other file-systems (system, efs, cache, etc.) are also unmountable. Or is that the result of dm-verity having been tripped?
As I mentioned previously I expected the file system to have access issues due to the kernel.
Will have to patch the kernel to fix that. However no part of DATA will be accessible until formatted.
 
  • Like
Reactions: fre78

ianmacd

Senior Member
Jan 5, 2016
2,322
3,693
208
Amsterdam
localhost
As I mentioned previously I expected the file system to have access issues due to the kernel.
Sorry, I was rushing out the door and keen to answer you before I left. As soon as I was outside, I remembered what you had written about expecting file-system access to be impaired.


Sent from my SM-G965F using XDA Labs
 
  • Like
Reactions: fre78

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,831
0
Sorry, I was rushing out the door and keen to answer you before I left. As soon as I was outside, I remembered what you had written about expecting file-system access to be impaired.


Sent from my SM-G965F using XDA Labs
Ok have recompiled TWRP with the patched kernel and created a patched boot to disable dm-verity and a flashable zip to disable forced encryption.

twrp_3.2.3-1_t830_test_r2

To disable forced encryption, mount internal storage(DATA) and disable dm-verity:

1. Install the patched boot below. This can be installed with ODIN or extract the boot.img and flash with TWRP:

T830XXU1ARH8_dmverity_patched_boot

2. Boot to TWRP

3. Install the Forced encryption patch: TabS4_oreo_forced_encryption_disabler

4. Format DATA using the *FORMAT DATA button* under the wipe options.
(NOTE - THIS WILL WIPE ALL INTERNAL STORAGE!)

5. Reboot and check DATA is mountable

Done.
 
Last edited:

Cyb3rk1ll

Member
Jul 21, 2016
29
9
0
Austin
So...anyone succesfully rooted this device with TWRP help ? Step-by-step procedure requested. Thanks !!
The thread is only 2 pages, rather than asking you could have read the posts. If you would have read the thread you would see that the recovery is still being developed and has bugs being worked out. There are ways to root your device without twrp. If you need a step by step guide, hold off, because you may need another step by step guide to unbrick your device.
 

ianmacd

Senior Member
Jan 5, 2016
2,322
3,693
208
Amsterdam
localhost
Ok have recompiled TWRP with the patched kernel and created a patched boot to disable dm-verity and a flashable zip to disable forced encryption.

twrp_3.2.3-1_t830_test_r2

To disable forced encryption, mount internal storage(DATA) and disable dm-verity:

1. Install the patched boot below. This can be installed with ODIN or extract the boot.img and flash with TWRP:

T830XXU1ARH8_dmverity_patched_boot

2. Boot to TWRP
Thanks, @ashyx.

I'm afraid can't boot this version of TWRP. At first, I thought it was because dm-verity was tripped yesterday, so I first performed the factory reset demanded by the device, and then tried again, but no joy.

Instead of TWRP, it boots me into download mode, but rather than the familiar turquoise download screen, I get a mixed splash screen/diagnostic text display. Nevertheless, it is definitely download mode.

From there, I tried reflashing test2 of TWRP followed by the dm-verity patched boot image, but rebooting afterwards always puts me back in download mode. The only way I can seem to get out of it again is by flashing stock firmware.

I can't post a log, obviously, but I've attached a photo of the screen in question.

UPDATE:

I tried reinstalling yesterday's initial build of TWRP, just to see if I could still get into that, and it appears that I can.
 

Attachments

Last edited:
  • Like
Reactions: fre78

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,831
0
Thanks, @ashyx.

I'm afraid can't boot this version of TWRP. At first, I thought it was because dm-verity was tripped yesterday, so I first performed the factory reset demanded by the device, and then tried again, but no joy.

Instead of TWRP, it boots me into download mode, but rather than the familiar turquoise download screen, I get a mixed splash screen/diagnostic text display. Nevertheless, it is definitely download mode.

From there, I tried reflashing test2 of TWRP followed by the dm-verity patched boot image, but rebooting afterwards always puts me back in download mode. The only way I can seem to get out of it again is by flashing stock firmware.

I can't post a log, obviously, but I've attached a photo of the screen in question.

UPDATE:

I tried reinstalling yesterday's initial build of TWRP, just to see if I could still get into that, and it appears that I can.
It could either be the custom kernel or the dtb, as I have modified both.
However regarding the dtb, I had issues splitting the dtb with aik, so had to use an alternative method.

I will compile twrp with the stock dtb and custom kernel and see how that goes.

Thanks
 
  • Like
Reactions: fre78 and ianmacd

ianmacd

Senior Member
Jan 5, 2016
2,322
3,693
208
Amsterdam
localhost
It could either be the custom kernel or the dtb, as I have modified both.
However regarding the dtb, I had issues splitting the dtb with aik, so had to use an alternative method.

I will compile twrp with the stock dtb and custom kernel and see how that goes.
As you know, I had started work on a version of TWRP for this device myself, but not got very far. Like you, I had run into the issue of the embedded DTB. When I mentioned this to a developer on Telegram, he pointed me at this splitting tool. Before I could use it, however, you announced your build of TWRP, so I never tried it, but perhaps it can be of some use to you now.
 
  • Like
Reactions: fre78

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,831
0
As you know, I had started work on a version of TWRP for this device myself, but not got very far. Like you, I had run into the issue of the embedded DTB. When I mentioned this to a developer on Telegram, he pointed me at this splitting tool. Before I could use it, however, you announced your build of TWRP, so I never tried it, but perhaps it can be of some use to you now.
Yes thats one of the tools I've used to split the dtb.
It's not the splitting that's the issue I think it's the appending back to the kernel or the custom kernel itself.
Thanks anyway

EDIT: Compiled this one with just the custom kernel and stock dtb.
https://androidfilehost.com/?fid=1322778262904007632
 
Last edited:

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,831
0
This one yields the same result, I'm afraid. I can't get into TWRP and am stuck in download mode until I flash stock firmware again.
I hope it's not the kernel. I'm going to repack the stock kernel and dtb the exact same way and see if that boots.
I have a suspicion there's some special way Samsung are appending the dtb.
I'm also going to contact @osm0sis as he's a whizz at this stuff
Are you ok with the testing?
 

ianmacd

Senior Member
Jan 5, 2016
2,322
3,693
208
Amsterdam
localhost
I hope it's not the kernel. I'm going to repack the stock kernel and dtb the exact same way and see if that boots.
I have a suspicion there's some special way Samsung are appending the dtb.
I'm also going to contact @osm0sis as he's a whizz at this stuff
Are you ok with the testing?
No worries, my friend. I'll test whatever you ask me to.

The device is wiped and unusable now anyway without reinstallation, so I have everything to gain and nothing to lose.