Wednesday, October 14, 2015

SW REV CHECK FAIL DEVICE 2 BINARY 1 In Samsung G925 Android 5.1.1

Today I was flashing my Samsung S6 from Android 5.0.2 to Android 5.1.1. So I downloaded tar.md5 file from Samsung fired up Odin and started flashing and out of no where Flash failed!. Then when I tried to flash Android 5.0.1 again I started getting this error

It shows this error on device screen

SW REV CHECK FAIL DEVICE 2 BINARY 1


 <ID:0/003> Added!!
<OSM> Enter CS for MD5..
<OSM> Check MD5.. Do not unplug the cable..
<OSM> Please wait..
<OSM> G925FXXU1AOCV_G925FVIR1AOCN_G925FXXU1AOCW_HOME.tar .md5 is valid.
<OSM> Checking MD5 finished Sucessfully..
<OSM> Leave CS..
<ID:0/003> Odin engine v(ID:3.1005)..
<ID:0/003> File analysis..
<ID:0/003> SetupConnection..
<ID:0/003> Initialzation..
<ID:0/003> Get PIT for mapping..
<ID:0/003> Firmware update start..
<ID:0/003> SingleDownload.
<ID:0/003> sboot.bin
<ID:0/003> NAND Write Start!!
<ID:0/003> FAIL!
<ID:0/003>
<ID:0/003> Complete(Write) operation failed.
<OSM> All threads completed. (succeed 0 / failed 1)


Reason for this error is during the previous flash it upgraded the bootloader to 5.11 and now it is refusing to go back to an older version. You cannot flash 5.0.1 bootloader again. You have to stay with Android 5.11

Then I tried Samsung Smart Switch and it managed to recover the phone from Soft brick and complete Android 5.1.1 installation and it it boots file.

As a another solution, You can

1. Download the tar.md5 file.
2. Rename the file back to tar and extract
3. Delete  hidden.img
4. Download this toolkit http://forum.xda-developers.com/galaxy-s6-edge/orig-development/toolkit-skipsoft-android-toolkit-galaxy-t3101195
5. Make your own firmware
6. Flash


Tip: https://www.reddit.com/r/GalaxyS6/comments/35zshn/howto_fix_a_failed_odin_flash_softbrick_hiddenimg/

Thursday, October 1, 2015

Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES] hell

Today I wanted to install a newer version on top of existing version of my app. So as usual I did

    adb install -r app.apk

It threw

Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]


But why ? So I wanted to check whether certificate has really changed since the last version.  To do this, you need to unzip the apk file and check inside.


1. Unzip the apk file.
2. Goto META-INF folder
3. "CERT.RSA" file is used to verify the signature

So, Now you need to look at whats the signature looks like. To do that,

    keytool -printcert -file CERT.RSA


Will output something like

    Owner: CN=Android Debug, O=Android, C=US
    Issuer: CN=Android Debug, O=Android, C=US
    Serial number: xxx
    Valid from: Thu Aug 01 14:20:26 ICT 2013 until: Sat Jul 25 14:20:26 ICT 2043
    Certificate fingerprints:
             MD5:  xxxx
             SHA1: xxxx
             Signature algorithm name: SHA1withRSA
             Version: 3

And when I compare with the newer version

    "Signature algorithm name: SHA256withRSA"



It appear newer version of the android build tool (23) is using  SHA256withRSA and older version (17) was using SHA1withRSA