Question

I get files like this below:

GT-I5500-CSC-SERJK1.tar.md5

This is what I want:

GT-I5500-CSC-SERJK1.tar 

How can I get it? Can I just remove the md5 file extension?

Was it helpful?

Solution

The file a.tar.md5 contains the MD5 hash of the file a.tar. The tar and the md5 files are totally different files. You can not get a tar file from a tar.md5 file.

Edit: it turns out there are two types of .tar.md5 files:

  • Just MD5 sum. A file of 32 bytes. It is typically in a directory along with a .tar file, such as here. It is not possible to reconstruct the original tar file from the md5 file.
  • A tar archive with an appended MD5-sum. Several megabytes. Can be extracted by the standard tar tool, or it can be written to a phone with ODIN.

OTHER TIPS

From what I understand this is a simple means of adding a checksum onto a tar file. Since the tar standard states that the end of the tar file is two successive blank "entries" in a row, all data past that point is ignored by "tar -x". So the android dev community has apparently taken to simply concatting the output of md5 to the end of this file.

The following bash script can be used to validate a ".tar.md5" file:

#! /bin/bash

check_tar_md5 () {
    local file="${1:?Required: file to check}"
    [[ ! -f "$file" ]] && {
            echo "File not found: $file" >&2
            return 1
    }
    local filename="$(basename "$file")"
    if [ "${filename##*.}" = md5 ]; then filename="${filename%.*}"; fi;
    local md5_line_length=$(printf "%032d *%s\n" 0 "$filename" | wc -c)
    local embedded_md5=$(tail -c $md5_line_length "$file" | ( read md5 rest; echo $md5 ) )
    local actual_md5=$(head -c -$md5_line_length "$file" | md5sum | ( read md5 rest; echo $md5 ) )
    if [ $embedded_md5 = $actual_md5 ]; then
            echo "$file: OK"
    else
            echo "$file: FAILED"
            return 1
    fi
}

[[ ! -z "$1" ]] && check_tar_md5 "$1"

If you 'source' this script you will have a 'check_tar_md5' function in your current env; otherwise you can just execute it; in either case you provide the file as the only argument. Output is similar to the "md5sum --check" utility.

Making the script more robust (e.g.: in the event you provide a file that is not a .tar.md5) is left as an exercise to the reader.

.tar.md5 files are generally used by Odin to flash firmware to android phones. They are essentially tar compressed archives with the md5 checksum appended to the end, so you can verify no data was corrupted.

md5 files usually are md5 checksums, but not in this special case.

a .tar.md5 file can be flashed to a samsung phone using the software program ODIN

Either the md5 # is the encrypted .tar file name or it is the encrypted .tar file. First you must decrypt the tar file to see its name.

if you have downloaded it to your smartphone that is runing android OS then you can try this go to File Manager and then go to directory where the file you downloaded is located and hold your finger on the file you downloaded then the windows with some options should pop up and chose the rename option then delete where it says .md5 and you are done.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top