Thor: flashTar directory doesn't detect img
Description
Whenever I try to “flashTar” a dir, it only displays three dots … no img selection…
Reproduction
- Enter command
flashTar "dir" - Attempt to flash
BL_A325FXXU5DWE3_A325FXXU5DWE3_MQB65744574_REV00_user_low_ship_MULTI_CERT.tarthat contains img.lz4 files. - I get the error:
- only three dots
- if I hit “enter” a few times, this:
Unable to read beyond the end of the stream. - if I hit “space” this:
Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
Photo of the device
Full logs of the tool, in debug mode
To enable debug mode, enter debug on before doing connect for collecting as much info as possible.
To get the “full logs”, scroll up to the first message in Thor, select it’s start, and drag to the end of the last message and copy it here:
lmateovf@popos-mateo:~/Descargas/linux$ sudo ./TheAirBlow.Thor.Shell
Welcome to Thor Shell v1.0.4!
Successfully loaded "usb.ids" from cache.
Type "help" for list of commands.
To start off, type "connect" to initiate a connection.
~~~~~~~~ Platform specific notes ~~~~~~~~
You have to run Thor as root or edit udev rules as follows:
1) create and open /etc/udev/rules.d/51-android.rules in an editor
2) enter SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="YourUserGroupHere"
Additionally, you may have to disable the cdc_acm kernel module:
1) To temporarily unload, run "sudo modprobe -r cdc_acm"
2) To disable it, run "echo 'blacklist cdc_acm' | sudo tee -a /etc/modprobe.d/cdc_acm-blacklist.conf"
shell> debug on
Enabled debug logging
shell> connect
[13:24:17 DBG] Number of configurations: 1
[13:24:17 DBG] Number of interfaces: 2
[13:24:17 DBG] ~~~~ Interface index 0 ~~~~
[13:24:17 DBG] Number of endpoints: 1
[13:24:17 DBG] Interface class: 0x02
[13:24:17 DBG] $$ Endpoint index 0 $$
[13:24:17 DBG] !! Class-dependant descriptor, skipping (len = 5 - 2)
[13:24:17 DBG] !! Class-dependant descriptor, skipping (len = 5 - 2)
[13:24:17 DBG] !! Class-dependant descriptor, skipping (len = 4 - 2)
[13:24:17 DBG] !! Class-dependant descriptor, skipping (len = 5 - 2)
[13:24:17 DBG] Endpoint address: 0x82
[13:24:17 DBG] !! USB_ENDPOINT_XFER_BULK fail (value = 03)
[13:24:17 DBG] !! Interface is invalid, continuing
[13:24:17 DBG] ~~~~ Interface index 1 ~~~~
[13:24:17 DBG] Number of endpoints: 2
[13:24:17 DBG] Interface class: 0x0A
[13:24:17 DBG] $$ Endpoint index 0 $$
[13:24:17 DBG] Endpoint address: 0x81
[13:24:17 DBG] $$ Endpoint index 1 $$
[13:24:17 DBG] Endpoint address: 0x01
[13:24:17 DBG] > Interface is valid, exiting
[13:24:17 DBG] Interface: 0x01, Alternate: 0x00, Read Endpoint: 0x81, Write Endpoint: 0x01
Successfully connected to the device!
Now run "begin" with the protocol you need.
shell> begin odinç
~~~~~~~~~~~~~^
Invalid option choice, should be [odin]
shell> begin odin
[13:24:26 DBG] Bootloader version integer 0x00020000
[13:24:26 DBG] Unknown1: 0, Unknown2: 0, Version: 2
[13:24:26 DBG] Sending file part size of 1048576
Successfully began an Odin session!
shell> flashTar /home/lmateovf/Descargas/intento/Descomprimidos/Def
[13:24:48 DBG] PIT size is 4000 (16384), 33 total blocks
[13:24:56 DBG] Full exception: System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
at System.IO.Stream.ReadAtLeastCore(Span`1 buffer, Int32 minimumBytes, Boolean throwOnEndOfStream)
at System.IO.Stream.ReadExactly(Span`1 buffer)
at System.Formats.Tar.TarHeader.TryGetNextHeader(Stream archiveStream, Boolean copyData, TarEntryFormat initialFormat, Boolean processDataBlock)
at System.Formats.Tar.TarReader.TryGetNextEntryHeader(Boolean copyData)
at System.Formats.Tar.TarReader.GetNextEntry(Boolean copyData)
at ThorRewrite.Shell.Commands.ProtoOdin.FlashTar.RunCommand(State state, List`1 args) in /home/theairblow/RiderProjects/Thor/TheAirBlow.Thor.Shell/Commands/ProtoOdin/FlashTar.cs:line 30
~~~~~~~^
Unable to read beyond the end of the stream.
shell> flashTar /home/lmateovf/Descargas/intento/Descomprimidos/Def
[13:25:03 DBG] PIT size is 4000 (16384), 33 total blocks
Choose what partitions to flash from BL_A325FXXU5DWE3_A325FXXU5DWE3_MQB65744574_REV00_user_low_ship_MULTI_CERT.tar:
…
(Press <space> to select, <enter> to accept) [13:25:03 DBG] Full exception: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Spectre.Console.MultiSelectionPrompt`1.Spectre.Console.IListPromptStrategy<T>.HandleInput(ConsoleKeyInfo key, ListPromptState`1 state) in /_/src/Spectre.Console/Prompts/MultiSelectionPrompt.cs:line 165
at Spectre.Console.ListPrompt`1.Show(ListPromptTree`1 tree, CancellationToken cancellationToken, Int32 requestedPageSize, Boolean wrapAround) in /_/src/Spectre.Console/Prompts/List/ListPrompt.cs:line 58
at Spectre.Console.MultiSelectionPrompt`1.ShowAsync(IAnsiConsole console, CancellationToken cancellationToken) in /_/src/Spectre.Console/Prompts/MultiSelectionPrompt.cs:line 97
at Spectre.Console.MultiSelectionPrompt`1.Show(IAnsiConsole console) in /_/src/Spectre.Console/Prompts/MultiSelectionPrompt.cs:line 89
at Spectre.Console.AnsiConsole.Prompt[T](IPrompt`1 prompt) in /_/src/Spectre.Console/AnsiConsole.Prompt.cs:line 21
at ThorRewrite.Shell.Commands.ProtoOdin.FlashTar.RunCommand(State state, List`1 args) in /home/theairblow/RiderProjects/Thor/TheAirBlow.Thor.Shell/Commands/ProtoOdin/FlashTar.cs:line 42
~~~~~~~^
Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
shell>
Hardware and software
- OS of the computer used: Linux – Pop_OS!
- Model of the device: SM-A325F/DS
Additional context
I want to root this A32 for root access.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 1
- Comments: 17 (3 by maintainers)
In the end i successfully rooted muy device with Odín… Thabks again for your help and i hope your app will be great. ❤️
It’s getting stuck on some img, I don’t know why. I have, in every each attempt, reset to factory the userdata… and nothing, still same error, tried with only one tar file at a time, nothing… I’m tired now, will continue tomorrow
Extract them again, To be like name.img, Then compress it to .tar I had the same issue, I just extracted the archive.img.lz4, Then took the archive.img and compressed it to .tar archive and it worked.
From the looks of it, my program fails to properly get the tar file entries. Not sure why it would happen - but I think it’s fault of the tar lib I’m using, as I didn’t have any issues. Just to make sure - are the following files at the root of the tar archive (not in a directory in the archive)?
I had the same issue, basically the .lz4 files in the .tar.md5 firmware files were not being detected by Thor. I was able to fix it by renaming and removing the .md5, then extracting the .tar firmware files to a folder, then extracting all the .lz4 files, deleting the old .lz4 files, then archiving everything in the folder to a .tar file again. I had to do it for each firmware file (by that I mean BL, AP, CP, CSC).
I’ve been working on a proper library for doing GUIs with ImGUI in C#, so who knows, maybe I’ll make a GUI for Thor sometime soon xD
I have no clue as to why it would happen, as I did include LZ4 support… Maybe an accidentally messed up if check?
However, I do not have the time to work on Thor as I switched my interest to a different project of mine, so do not expect me to continue for a while.
Nice! That’s great to hear!
Ok so it detects the magisk AP TAR but not the others:

I’m going to try what @a7md8762 told me, and I will report… because it does not detect the lz4 files only the ones that are already .img…
So there was two issues:
Thank you for your help, if I close this ticket is because I have achieve the root flashing… Hope I don’t have to bother you again hehehe
Please, help me…
Maybe is because of the img.lz4 files?