Shop Holiday deals at: Amazon | Walmart | Best Buy | Dell | Samsung

  1. Android Central Question's Avatar
    I have following files for my Samsung device:
    - AP_...tar.md5
    - BL_...tar.md5
    - CP_...tar.md5
    - CSC_...tar.md5
    - HOME_...tar.md5

    I can flash these files successfully on my device using Odin3 v3.13.

    My goal is to modify the init.rc file of AP_...tar.md5->system.img to test whether my changes can be flashed on the device or not.

    For this, firstly, I have just extracted AP_...tar.md5 by `tar -xf AP….tar.md5` command. Then, I have re-compressed it using `tar -cvf AP_...tar AP_..` command. I have tried to flash this tar file but the Odin gets crashed.
    Then I have tried to make it md5 file using `md5sum -t AP_...tar AP_...tar` and `mv AP_...tar AP_...tar.md5` commands but again the odin gets crashed without giving any error.

    Any suggestion?
    10-15-2019 06:33 AM
  2. anon(10614692)'s Avatar
    An MD5 file is like a checksum. You don't edit that, you edit the img file and then run MD5 calculator to verify the changes you have made. Check this out WinMD5 Free - Windows MD5 Utility Freeware for Windows 7/8/10
    10-15-2019 07:17 AM
  3. Vatish Sharma's Avatar
    Editing a MD5 file is my requirement. I understand that it is a checksum but there is another thing that if I make a md5 file from system.img of the AP file then the MD5 checksum got verified but then it fails with some other error: https://pastebin.com/SmQAdvwS
    10-15-2019 07:26 AM
  4. mustang7757's Avatar
    Hi, welcome to Android Forums

    I'd like to recommend creating a account so me or other members can assist you, as guest have limitations in replying here and if we need further Information to communicate with you.

    I'll provide a link to register, please come back to your post so we can further assist
    https://forums.androidcentral.com/sh...d.php?t=409154
    10-15-2019 09:08 AM
  5. mustang7757's Avatar
    You can't modify stock firmware files for Odin
    10-15-2019 09:09 AM
  6. Rukbat's Avatar
    1. The ND5 in the file is no longer valid if you change something in the file. You have to remove the MD5, make an MD5 hash from the file, add that to the changed file and add .md5 to the end.

    2. If you're changing anything but an app that's included in the flash, it's probably going to fail the booloader's test for authenticity. You have to get Samsung's code for creating files, and they don't give it out, so the only changes you can make are to things that aren't part of Android or the kernel - changing init.rc would probably cause it to fail. Since init.rc is loading everything within the /{system,vendor,odm}/etc/init/ directories, any change would probably cause a crash at some level.
    10-15-2019 04:31 PM
  7. mustang7757's Avatar
    1. The ND5 in the file is no longer valid if you change something in the file. You have to remove the MD5, make an MD5 hash from the file, add that to the changed file and add .md5 to the end.

    2. If you're changing anything but an app that's included in the flash, it's probably going to fail the booloader's test for authenticity. You have to get Samsung's code for creating files, and they don't give it out, so the only changes you can make are to things that aren't part of Android or the kernel - changing init.rc would probably cause it to fail. Since init.rc is loading everything within the /{system,vendor,odm}/etc/init/ directories, any change would probably cause a crash at some level.
    Exactly, better to change something with root after the flash
    Rukbat likes this.
    10-15-2019 04:36 PM
  8. Vatish Sharma's Avatar
    You are right that MD5 will no longer be valid if I will change anything in the file but with tar extraction the md5 is already removed and I haven't change anything in the file yet. For clarity, I have followed following steps:
    1. Run `tar -xf AP….tar.md5` : It will extract the files of AP….tar.md5 file to a folder with the same name(AP...). My understanding is when tar is extracting the md5 file then it ignores the md5 checksum of the file and extract everything else in a folder. The result is a folder containing several img.lz4, img.ext4.lz4 files and a metadata folder.
    2. Run `tar -cvf AP_...tar AP_..` : It will make the tar file with the folder that we get in the previous step.
    Please note: I haven't change anything in the folder because I just want to try flash it without modification. If I will get success here then I will try to make changes in the init.rc file and flash it.
    3. Run `md5sum -t AP_...tar AP_...tar` : It will add new checksum at the end of AP_...tar file.
    4. `mv AP_...tar AP_...tar.md5` : Renaming the tar file to tar.md5 because it contains a md5 checksum.

    I have also tried above thing with only `system.img`(Extracted this system.img from the AP file) and this results the md5 checksum verification success but another error. Following are the logs of this try:
    <ID:0/005> Added!!
    <OSM> Enter CS for MD5..
    <OSM> Check MD5.. Do not unplug the cable..
    <OSM> Please wait..
    <OSM> Checking MD5 finished Sucessfully..
    <OSM> Leave CS..
    <ID:0/005> Odin engine v(ID:3.1301)..
    <ID:0/005> File analysis..
    <ID:0/005> Total Binary size: 5190 M
    <ID:0/005> SetupConnection..
    <ID:0/005> Initialzation..
    <ID:0/005> Get PIT for mapping..
    <ID:0/005> Firmware update start..
    <ID:0/005> NAND Write Start!!
    <ID:0/005> SingleDownload.
    <ID:0/005> system.img
    <ID:0/005> Complete(Write) operation failed.
    <ID:0/005>
    <ID:0/005> Complete(Write) operation failed.
    <OSM> All threads completed. (succeed 0 / failed 1)

    I may failed in flashing only the system.img but atlease the MD5 finished successfully. So, I am confused why the same method not atleaset verifying the MD5 of my AP_...tar.md5?
    10-16-2019 01:24 AM
  9. Ant-Val's Avatar
    The MD5 hash is only to verify that there haven't been any errors in downloading, there are other authentication methods implemented, some may not have a name to the general public as they are internal to the OEM.

    As stated above: you cannot modify stock firmware and still have it work.

    See the attached image, any single bit of information will result in an invalid hash, and that's only for the download verification, there are other methods implemented on the device itself to reject the file even if you get the whole file to pass MD5 checksum with a different hash.

    As stated above: you cannot modify stock firmware and still have it work.

    How to make valid md5 file for odin?-350px-cpt-hashing-file-transmission.svg.png
    Attached Thumbnails How to make valid md5 file for odin?-800px-cpt-hashing-file-transmission.svg.png  
    09-05-2021 08:58 AM

Similar Threads

  1. .nomedia file hid my .nomedia file?
    By RealFajita in forum Samsung Galaxy S10 & S10+
    Replies: 4
    Last Post: 10-16-2019, 10:11 PM
  2. .nomedia file hid my .nomedia file?
    By RealFajita in forum Samsung Galaxy S10 & S10+
    Replies: 2
    Last Post: 10-15-2019, 06:59 AM
  3. I cant seem to find out where my private pictures are
    By Android Central Question in forum Ask a Question
    Replies: 1
    Last Post: 10-15-2019, 05:29 AM
  4. How to put date on picture in galaxy s8
    By Android Central Question in forum Ask a Question
    Replies: 1
    Last Post: 10-15-2019, 05:27 AM
LINK TO POST COPIED TO CLIPBOARD