1. Download our Official Android App: Forums for Android!

Root Invalid entry hash for system and Preflash Validation failed when I flash modified system.img file.

Discussion in 'Android Devices' started by MasLnd72, Mar 8, 2016.

  1. MasLnd72

    MasLnd72 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Mar 7, 2016

    Mar 7, 2016
    1
    0
    5
    This is my first post to this site, so let me know if I need to ask this in another area.
    I am trying to load an apk into the system.img file of the firmware for the Droid MAXX and am getting the following errors.
    Invalid entry hash for system: index=0
    and
    Preflash Validation failed
    The original firmware file is:
    CFC-obakem_verizon-user-4.4.4-SU6-7-release-keys.xml.zip
    I have been able to get the system.img out of the firmware xml.zip file (on windows 7), remove the first 20000hex bytes (the Moto header I believe), unpack it and mount it using:
    simg2img on an ubuntu virtual machine.
    I can then repack this mounted directory in ubuntu using the following command:
    sudo ./make_ext4fs -s -S file_contents -l 2112M -a system system_adc.img system_mnt
    Then I move this back to the windows 7 machine, re-attach the 20000hex byte header, put this into the previously unzipped firmware folder, and zip it back up.
    I can then boot the Droid Maxx into fastboot, and use RSD lite to flash this firmware to the phone successfully.
    The phone boots and runs fine.

    My problem comes when I try flashing the system.img after adding the APK:
    After mounting the unpacked system.img, I then add my APK to the priv-app directory, and give it 644 permissions like all the other APK files in that directory.
    I then run the same make_ext4fs command to build the new system.img file. It is larger than the original by about the size of my APK.
    Then, as before, I move this back to the windows 7 machine, re-attach the 20000hex byte header, put this into the previously unzipped firmware folder, and zip it back up.
    I then boot the Droid Maxx into fastboot, and use RSD lite to flash this firmware to the phone.
    At this point it works until it gets to to the system.img, then I get Phone returned FAIL.
    on the screen of the phone, I get: Invalid entry hash for system: index=0

    When I try manually flashing the system.img using mfastboot from within platform-tools I get Preflash Validation failed


    Have I made some noob mistake?
    Is there a known way to get past this?
    Do I need to unlock the bootloader in order to do something like this?

    Thanks for any help or ideas.
     

    Advertisement

Share This Page

Loading...