yashsingh1/xdaforums huggingface dataset:
[Galaxy S 4 i9505 Original Android Development] goister:
Yes, already in Download Mode. Also already installed Samsung USB drivers, but tried both twrp-3.2.3-0-jfltexx.img and twrp-3.3.1-1-jflte.img, both failed with the following logs

<ID:0/003> Added!!
<ID:0/003> Odin engine v(ID:3.1303)..
<ID:0/003> File analysis..
<ID:0/003> Total Binary size: 8 M
<ID:0/003> SetupConnection..
<ID:0/003> Initialzation..
<ID:0/003> FAIL! (DeviceInfo)
<OSM> All threads completed. (succeed 0 / failed 1)
<ID:0/003> Removed!!
<ID:0/003> Added!!
[Galaxy S 4 i9505 Original Android Development] goister:
OK, figured out the problem. Turns out it was a USB port problem. I switched the USB port and now it completes successfully. Then I had to flash CF-Auto-Root to unlock the bootloader before I could successfully flash TWRP.
[Galaxy S 4 i9505 Original Android Development] Axl_Mas:
Is 3.4.0 working as expected? Is it safe to install? Thank you
[Galaxy S 4 i9505 Original Android Development] ripee:
I tested the unified jflte twrp 3.4.0-0 it on my jfltexx. Yes it is safe.
[Galaxy S 4 i9505 Original Android Development] Jacen Solo 95:
Hey guys strange issue, but for the life of me I can't seem to get TWRP working.

I can install it fine through Odin, no issues whatsoever. Auto Reboot ticked, the phone reboots.

But then when I try to get into the recovery, I see the Galaxy S4 logo with little blue text on the top saying recovery booting, then I get the android with the insides open and blue stuff processing and then the android failed to find command with the red exclamation warning and then I'm back to the stock recovery...

Also off note is that I can never use Power+Volume up+Home to boot into recovery. I usually can only use ADB to boot into recovery. Download mode is no issue though, only recovery. Is something wrong with the OS? I'm on stock 5.0.1 and unrooted. Anyone had an similar issues and advice if possible?

Edit: Oh boy I feel dumb. After trying it a million times, I finally got it to stick. I think maybe I wasn't pulling the battery fast enough?? I don't know what, but now it's working. My bad guys :)
[Galaxy S 4 i9505 Original Android Development] x2k13:
[MENTION=6005084]ripee[/MENTION] I have problems with twrp 3.4.0 and LOS 17.1 (official) for jfltexx.

I use adopted storage and phone encryption. When restarting to recovery, TWRP doesn't ask for the decryption password, starts, then fails to mount /data (obviously due to failed decryption). I still can see the folders on the sd card, but since the storage isn't decrypted, nothing is accessible making it impossible to use the internal storage to load and save backups, for example.

Another example what can't be done due to this: adb sideloading the magisk uninstaller .zip, resulting in magisk's addon.d survival script being unremovable thus spamming the command line while flashing system images.

Any chance to get this behaviour fixed?
[Galaxy S 4 i9505 Original Android Development] Stucko:
I had the same problem when trying to update from 3.1.1-0 to 3.1.1-1, I could not decrypt /data anymore, I guess they changed something in the partition layout and you need to format /data with the new TWRP version to be able to use decryption again. For me it is not worth the hassle reinstalling all the apps so I just stay on the older version.
[Galaxy S 4 i9505 Original Android Development] x2k13:
Well, I used 3.4.0-0 right from the start, so I doubt my case can be compared to yours. I have another non-Samsung phone that has 3.4.0-0 as well and there decryption just works...
[Galaxy S 4 i9505 Original Android Development] Stucko:
Did you format (!= wiping) /data before flashing LOS?
[Galaxy S 4 i9505 Original Android Development] x2k13:
Yes of course, I always do that before flashing a phone from scratch.
[Galaxy S 4 i9505 Original Android Development] rjt2291:
LOS now only supports encryption with native recovery. You need to flash latest 17.1 nightly recovery and select factory reset/wipe and format system.
[Galaxy S 4 i9505 Original Android Development] Hemuli:
I have these problems too. The log says that mounting failed due to invalid argument. Custom TWRP 3.3.1-0 by JDCTeam (build 2) succesfully mounts everything, but OTA updates don't work due to a bug that was fixed in TWRP 3.4.0. LOS recovery works also for what it's worth.
[Galaxy S 4 i9505 Original Android Development] bersem:
OTA update works with custom JDC TWRP ( official LOS build ) . Does the OTA update work on official 3.4.0 TWRP recovery ?

Regards !
[Galaxy S 4 i9505 Original Android Development] Hemuli:
My post was about the scenario where encryption is used. 3.3.1 doesn't ask for unlocking during OTA so it doesn't mount /data. This is fixed in 3.4.0 (see changelog) but on jflte official the decryption doesn't work to begin with.
[Galaxy S 4 i9505 Original Android Development] x2k13:
Could you please provide a link to the JDC 3.4.0 recovery? I can't find it.
[Galaxy S 4 i9505 Original Android Development] Hemuli:
I could have been more specific. JDC hasn't released that version for now. I was referring to the official TWRP for that version.
[Galaxy S 4 i9505 Original Android Development] x2k13:
Aah okay, thanks for clarifying. Yea the official jflte 3.4.0-0 can't decrypt anything making it quite useless for an encrypted phone, unfortunately.
[Galaxy S 4 i9505 Original Android Development] GabriaTz:
whats is new in this version ? can you post changelog ? i using 3.3.3.1 should i update ?

sorry bad english :D
[Galaxy S 4 i9505 Original Android Development] Hemuli:
You can find the changes on twrp's official website.
[Galaxy S 4 i9505 Original Android Development] TimAnd:
Thanks. I have jfltecan and, while TWRP 2.8.7.0 worked, TWRP 3.3 from https://dl.twrp.me/jfltecan/ didn't load. This one 3.4.0 loads.
[Galaxy S 4 i9505 Original Android Development] x2k13:
[MENTION=6005084]ripee[/MENTION] any chance to get proper decryption capability on this recovery soon? I'm pretty uncomfortable with having to use a fully unencrpted phone...
[Galaxy S 4 i9505 Original Android Development] droi1:
use older twrp 3.2.3.0 works with LOS 17.1 & OTA updates.
[Galaxy S 4 i9505 Original Android Development] meowmeoe111:
Will this work on the SCH I545? The bootloader is vrugof1. If the bootloader needs to be unlocked, please tell me how.
[Galaxy S 4 i9505 Original Android Development] fsherman:
TY
[Galaxy S 4 i9505 Original Android Development] jhford:
Recovery.log is attached.
[Galaxy S 4 i9505 Original Android Development] daromani:
The issue I am describing here is regarding TWRO 3.1.1-0 and TWRP 3.2.3-0 for jfltexx, downloaded from https://dl.twrp.me/jfltexx/

Apologies if this is not the appropriate forum for this, I am a newbie.

I have two Samsung Galaxy S4 Model: SGH-I337M (jfltevl) phones.

The basic problem is this:

On working phone: TWRP 3.2.3-0 works fine.

On the not-working phone: TWRP 3.1.1-0 works fine. But TWRP 3.2.3-0 does not work.

The TWRP screen with the selection buttons is frozen. Does not respond to any taps. I have to remove battery and reinstall 3.1.1-0.

I tried both flash methods, Odin and TWRP.

I do notice that the file size of 3.2.3-0 is 0.7MB smaller than 3.1.1-0. Is it possible that the code removed also broke compatibility with my phone?

My TWRP 3.1.1-0 still works fine, so this is not a show-stopper of as problem.

But it has made me very curious to know why a newer version of TWRP works with one phone but not the other?

I view this as an opportunity to learn something.

Here are the Droid Info reports for the two phones:

---------------------------------------------------------------------------------------

THE WORKING PHONE

DEVICE

Model: SGH-I337M (jfltevl)

Manufacturer: Samsung

Baseband Version: I337MVLUGOH1

RIL Version: Qualcomm RIL 1.0

Build Number: lineage_jfltexx-userdebug 9 PQ3A.190801.002 b88dfe0b56

Build Fingerprint: samsung/jfltevl/jfltecan:5.0.1/LRX22C/I337MVLSGQB1:user/release-keys

Bootloader: I337MVLUGOH1

Java VM: ART 2.1.0

OS Version: P (9)

SDK: 28

PROCESSOR

CPU Architecture: ARMv7 Processor rev 0 (v7l)

Board: MSM8960

Chipset: SAMSUNG JF

Cores: 4

Clock Speed: 384 MHz - 1890 MHz

Instruction Sets: armeabi-v7a, armeabi

CPU Features: swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt

CPU Governor: interactive

Kernel Version: 3.4.112-g3da4699

Kernel Architecture: armv7l

---------------------------------------------------------------------------------------

THE NOT-WORKING PHONE

DEVICE

Model: SGH-I337M (jfltevl)

Manufacturer: Samsung

Baseband Version: I337MVLSGQB1

RIL Version: Qualcomm RIL 1.0

Build Number: lineage_jfltexx-userdebug 9 PQ3A.190801.002 b88dfe0b56

Build Fingerprint: samsung/jfltevl/jfltecan:5.0.1/LRX22C/I337MVLSGQB1:user/release-keys

Bootloader: I337MVLSGQB1

Java VM: ART 2.1.0

OS Version: P (9)

SDK: 28

PROCESSOR

CPU Architecture: ARMv7 Processor rev 0 (v7l)

Board: MSM8960

Chipset: SAMSUNG JF

Cores: 4

Clock Speed: 384 MHz - 1890 MHz

Instruction Sets: armeabi-v7a, armeabi

CPU Features: swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt

CPU Governor: interactive

Kernel Version: 3.4.112-g3da4699

Kernel Architecture: armv7l

---------------------------------------------------------------------------------------
[Galaxy S 4 i9505 Original Android Development] daromani:
Accidentally double-posted - can't see how to remove this post so deleted text. Mod can you please remove this? Thanks.
[Galaxy S 4 i9505 Original Android Development] Hemuli:
I would first try upgrading the bootloader and baseband of the non-working phone to the same version as in the working phone.
[Galaxy S 4 i9505 Original Android Development] daromani:
Thanks for your advice.

Interestingly, the non-working phone has the newer firmware.

According to Sammobile firmware archive, I337MVLSGQB1 is from 2017 while I337MVLUGOH1 is from 2015.

Wondering of you can give me any advice about the best way to do what you suggest?

Should I reset the entire phone to original Samsung firmware I337MVLUGOH1 from Sammobile, using Odin as per the instructions at Sammobile? Then repeat the entire TWRP / LineageOS flashing process?
[Galaxy S 4 i9505 Original Android Development] Hemuli:
Yes. Or if you can find a package which has separate BL, AP, Phone etc. packages, you could flash modem and bootloader individually. For latest firmware, you could get those with the Frija tool. https://xdaforums.com/t/tool-frija-samsung-firmware-downloader-checker.3910594/

There's a lot of information in this thread, maybe some could be helpful to you https://xdaforums.com/t/ref-galaxy-s4-family-modems-and-bootloaders-collection.3315987/
[Galaxy S 4 i9505 Original Android Development] daromani:
Thanks again.

I downloaded the I337MVLUGOH1 firmware from two different sources and I notice they are very different when I unzip (or un-RAR) the files.

The first is a 1.45GB .zip file. When I unpack it I get a 2.4GB .tar.md5 file. When I look inside the .tar.md5 file, I see .img flies, .bin files, and .img.ext4 files, roughly corresponding to standard android partitions.

The other is a 1.45GB .rar file. When I unpack it, I see four .tar.md5 files (AP_*, BL_*, CP_*, CSC_*), one .pit file.

I understand that these files correspond to Android partitions and the sections of ODIN tool where you would reference them.

What I don't understand is why is the (nominally) same stock firmware package available in these two seemingly (to me) different packaging configurations?

Is the first configuration simply a convenience configuration that allows you to flash stock firmware by referencing only the one single .tar.md5 file in Odin, as opposed to the second configuration which requires you to reference each of AP_*, BL_*, CP_*, CSC_* separately in Odin?

Relative newbie here, trying to learn my way around this.
[Galaxy S 4 i9505 Original Android Development] js-xda:
Anyone tested already 3.5.2? I tried on a test device (I9505) and it resulted in no regular boot to system or recovery possible but forcing download mode. Haven't tried further yet.
[Galaxy S 4 i9505 Original Android Development] Retrial:
It's working fine for me. (I9505) Make sure you downloaded the right twrp for I9505 variant and check my S4 Unified Collection & Guides for a proper installation.
[Galaxy S 4 i9505 Original Android Development] js-xda:
No clue ... second attempt (but other I9505) same procedure without issues.
[Galaxy S 4 i9505 Original Android Development] x2k13:
@ripee meanwhile I updated my jfltexx to 18.1 and my klte likewise. klte in combination with twrp-3.5.2_9-0-klte works flawlessly including the ability to decrypt /data on recovery booting/loading.

On jfltexx it still does not work with twrp-3.5.2_9-0-jflte, just the long outdated twrp-3.2.3-0-jflte. Do you have any idea how to get on par with klte's ability to decrypt /data in combination with twrp-3.5.2_9-0-jflte and higher (when released)? It is possible, apparently, otherwise it wouldn't work on klte, right? 😏

If it is too hard to do, maybe you could explain why.

Thank you for the good work so far. 🙂

The error thrown is the one claiming "invalid argument" on trying to mount /data btw.
[Galaxy S 4 i9505 Original Android Development] ripee:
Does this happen when you try to decrypt the data partition on 3.5.2 that had been backed up on 3.5.2 while already encrypted?
[Galaxy S 4 i9505 Original Android Development] x2k13:
I'm not sure if I understood you correctly, but I encrypted the phone after upgrading to 18.1. Reboot to 3.5.2 recovery, data can't be mounted.

Replaced 3.5.2 with 3.2.3.0, data can be decrypted and mounted. All following twrp versions fail to decrypt and mount /data, though.
[Galaxy S 4 i9505 Original Android Development] ripee:
Yes, that's what I meant.
[Galaxy S 4 i9505 Original Android Development] x2k13:
Okay and that means what? 🤷🏼‍♂️
[Galaxy S 4 i9505 Original Android Development] ripee:
Try this build.
[Galaxy S 4 i9505 Original Android Development] x2k13:
Thank you for the new build, but unfortunately this one didn't fix it yet.
[Galaxy S 4 i9505 Original Android Development] ripee:
So I will have to import the encryption blobs from stock, like klte and trlte have.
[Galaxy S 4 i9505 Original Android Development] x2k13:
Ah, I see. Well, if that's the way they do it, it should do the trick. Just out of interest, how did you try to make it work?
[Galaxy S 4 i9505 Original Android Development] ripee:
Try this one.
[Galaxy S 4 i9505 Original Android Development] x2k13:
👇

"Could not mount /data and unable to find crypto footer."

"Failed to mount '/data' (invalid argument)"

"Unable to recreate /data/media folder."
[Galaxy S 4 i9505 Original Android Development] x2k13:
@ripee did you already have success with this?

Found out minute ago that JDCTeams's 3.5.2_9-0 can decrypt /data, might be worth to take a look at?
[Galaxy S 4 i9505 Original Android Development] ripee:
Please take a look if you wish, I don't have time for this TWRP right now.
[Galaxy S 4 i9505 Original Android Development] x2k13:
Take your time. It's not that urgent.

I've never built TWRP myself, and since you're the maintainer I assumed you would be interested where to probably dig around.

Thanks, though! 🙂
[Galaxy S 4 i9505 Original Android Development] ripee:
Another approach to encryption, inspired by the Exynos Note 4 TWRP sources.
[Galaxy S 4 i9505 Original Android Development] x2k13:
You made it, it works again! Thanks for the effort, and sorry for me pestering you about it. 😇😄👍🏻
[Galaxy S 4 i9505 Original Android Development] ripee:
Great! I will submit it to TeamWin for official support.
[Galaxy S 4 i9505 Original Android Development] 0xfab1:
Hi ripee

After a couple of problems with TWRP (twrp-3.5.0_9-0 at that time) when upgrading my S4 (GT-I9505) from LOS 17.1 to 18.1, I now want to perform a factory reset and start from scratch (clean install).

Today I am a little confused about which is the latest recommended TWRP version to install.

On May 19 (2021-05-19), npjohnson wrote the following in the "[OFFICIAL] LineageOS 18.1 for the Samsung Galaxy S4 (All QCOM Variants)" thread: "Yeah, formatting via TWRP is unsupported, another guy pushed a fix for it, I merged it, so TWRP builds should work now. you nailed the reason btw, twrp now reserves that space for encryption metadata after two days ago's build."

npjohnson's statement hints that build twrp-3.5.2_9-1 (dated 2021-05-17 and which is currently the latest available release for download from the official TWRP site) is the release that is capable of both formatting an S4 as well as being able to handle the encryption/decryption properly. Is that correct?

What confuses me is that on May 15 you uploaded a TRWP build "twrp-3.5.2_9-3-jflte" here to the forum, which has a higher version number than the release that was built 2 days later (twrp-3.5.2_9-1, 2021-05-17)?!

How can this be explained and which release should I use now? Could you please shed some light on this issue - thank you!
[Galaxy S 4 i9505 Original Android Development] 0xfab1:
(deleted double post due to technical problem)
[Galaxy S 4 i9505 Original Android Development] x2k13:
3.5.2_9-3 was a test version he made (and only put here) for me to check out if decryption works again, after I confirmed it works, he pushed the changes to TWRP upstream, and what came out is 3.5.2_9-1, which is the logical order in ascending version numbers for everyone else.

I assume that both versions actually are the same, code wise.

Feel free to read back the thread to find out. 🙂
[Galaxy S 4 i9505 Original Android Development] 0xfab1:
So simple :-) - good + thank you!
[Galaxy S 4 i9505 Original Android Development] x2k13:
@ripee

I saw twrp-3.6.0_9-0-jflte.img being available by now - but when I try to flash it an error occurs "Size of image is larger than target device".

Looking at the size of the images, the previous version really is smaller.

twrp-3.6.0_9-0-jflte.img: 10,03 MB (10518544 B)

twrp-3.5.2_9-1-jflte.img: 9,88 MB (10362896 B)

Ideas?
[Galaxy S 4 i9505 Original Android Development] carlos974:
- Decompile the .img file

- Remove languages that are not useful except English

- Recompile

- The .img file is less than 10MB

- Flash and enjoy
[Galaxy S 4 i9505 Original Android Development] x2k13:
Although this might work, the file provided to download from twrp website remains too big, right?

So this isn't a go-to solution for everyone. I think @ripee should check that in any case, because that error will hit anyone trying to flash the Image as-is.
[Galaxy S 4 i9505 Original Android Development] ripee:
Changelog:

TW_NO_EXFAT := true

I hope exFAT is not as popular for you all as ext2 or ext4 are.
[Galaxy S 4 i9505 Original Android Development] x2k13:
Works! Thank you very much. +1 for ext4.
[Galaxy S 4 i9505 Original Android Development] droi1:
when booting in TWRP recovery normally it ask for my PIN/Password but since some LOS updates it stopped working, i can enter recovery and do everything.
[Galaxy S 4 i9505 Original Android Development] x2k13:
You need to reset your lock screen/security settings, like if you used PIN and fingerprint, change to e.g. pattern (will save your fingerprints), then back to PIN and tap on PIN needed to boot phone, blue button at the lower right side of the screen. Done.
[Galaxy S 4 i9505 Original Android Development] x2k13:
@ripee Found a bug in 3.6.0_9-0-jflte, USB OTG can't be mounted and there is a sdcard2 directory being created for no good reason in /.

3.6.0 is really not usable atm. Stick to 3.5.2_9-1-jflte, all good there.
[Galaxy S 4 i9505 Original Android Development] lifehackerhansol:
Hello, every time I try to flash recovery within TWRP, the next reboot goes straight to Download mode and stays there until I re-flash recovery via Odin/Heimdall, regardless of whether the reboot is to recovery or system. This update procedure has never once worked on this phone.

There doesn't seem to be a valid log either, it just says it flashed fine. There's no indication that this should have failed, but it never boots until I re-do it in download mode. Is this a known issue?

EDIT: I debugged this a little further, and it appears the MTP implementation on Linux is so bad that every transfer corrupts the image when copying to the system. So now I have to adb push the images whenever I need to update. This is easy to find out with zip installs since TWRP rightfully complains that the zip is corrupted, but no such mechanism exists for the images.

I suppose this is just a me problem at this point. Sorry to disturb y'all.
[Galaxy S 4 i9505 Original Android Development] dirtywordz:
I am fighting with the NOT-WORKING Phone as well. trying to Root

SGH-I337M (jfltexx)

LineageOS version: 19.0 20220222-UNOFICIAL-jfltexx

Android version: 12

Build number: lineage_jfltexx-userdebug 12 SQID.220202.003 eng.side.2022022.204935 test-keys

PROCESSOR

CPU Architecture: ARMv7 Processor rev 0 (v7l)

Board: MSM8960

Chipset: SAMSUNG JF

Cores: 4

Clock Speed: 384 MHz - 1890 MHz

Instruction Sets: armeabi-v7a, armeabi

can't even get into recovery, all i get is three lines at the top left:

RECOVERY 'Rooting' (i believe) in BLUE

RECOVERY NOT SEANDROID ENFORCING in RED

SET WARRANTY BIT: RECOVERY in YELLOW

after a few seconds, just reboots.

grrrrrr.
[Galaxy S 4 i9505 Original Android Development] notnoelchannel:
can you try my themed recovery?
[Galaxy S 4 i9505 Original Android Development] dirtywordz:
Sorry for the delay, LIFE kinda got in the way, as it does.

Sure i'd Love to try your themed recovery.

I have managed to Root my SGH-I337M, as all my root apps are functional, although my Binary is Occupied.

I have a complete backup, so i am completely willing to play with it some more.

Send me a link and i'll try 'er out ok

Thanks

Cheers,

Cassidy
[Galaxy S 4 i9505 Original Android Development] notnoelchannel:
Hi, here's my themed recovery's XDA thread:

https://xdaforums.com/t/recovery-jfltexx-twrp-3-6-1-9-0-touch-recovery-custom-builds-themed.4415263/
[Galaxy S 4 i9505 Original Android Development] Buff99:
That'll be your answer then...
[Galaxy S 4 i9505 Original Android Development] ripee:
Great! I'll revert my changes from yesterday and re-submit for official support.
[Galaxy S 4 i9505 Original Android Development] Szwajowy:
Yea, great, but recovery from lineage repo worked even for me, and got suport for NTFS. Soo, are you going to do something about it ? I can test next builds if you want.
[Galaxy S 4 i9505 Original Android Development] ripee:
Am I going to do something about it? What do you think?

I think the problem may lie in the fact that the lineage-based twrp was built using one of lineage's dependencies, android_device_samsung_qcom-common, which provides additional partition-related code.

Edit:

twrp-3.2.1-0-jfltexx.img

twrp-3.2.1-0-jfltexx.tar
[Galaxy S 4 i9505 Original Android Development] Szwajowy:
still, no luck :/
[Galaxy S 4 i9505 Original Android Development] ripee:
Can you please try an SD card that's not formatted in NTFS.
[Galaxy S 4 i9505 Original Android Development] Szwajowy:
ExFat or FAT32 will be good ?

EDIT: I tested it with other SD Card and its working. In a sec I will tell you what file system it is.

EDIT2: FAT32 is working good.
[Galaxy S 4 i9505 Original Android Development] ripee:
Either, but try both. Also, does your rom recognize SD cards formatted in NTFS?
[Galaxy S 4 i9505 Original Android Development] Szwajowy:
Of course, I use official Lineage OS with TWRP 3.1.1 and either TWRP and ROM is recognizing without any problem my SD Card. There's only problem with your recovery :/

EDIT: ExFAT doesnt work :/ only FAT32 is working.
[Galaxy S 4 i9505 Original Android Development] ripee:
Just to be clear, does the twrp from lineage that I built work as well as 3.1.1 with all your SD card formatted in these 3 file systems?
[Galaxy S 4 i9505 Original Android Development] Szwajowy:
Yes, it was working, but I will test it once more.

EDIT: I think I know why, everything is working on twrp from lineage. Because its twrp 3.1.1. I just noticed it while booting in recovery.