1

I have Samsung S10 5G(Qualcomm) device. This device has unlocked bootloader but it is not rooted yet.

I am trying to learn Unpack-Modify-Pack the ROM images.

Currently, I have VZW stock ROM available for this device and I can flash it successfully using Odin3 v3.13.

After flashing this ROM, I have tried to modify system and recovery using tar, lz4, simg2img, mount, tune2fs and md5 tools available on my Ubuntu 18.

When I have tried to flash different tar files then the result is as following:

Success Attempts: If I will not modify anything and flash the Ap.tar containing any of the following file:

  1. system.img.ext4.lz4
  2. system.img.ext4
  3. recovery.img.lz4
  4. recovery.img

Fail Attempts: If I will just modify the init.rc file by writing a simple comment at the end of this file and flash the AP.tar containing any of the following file(which contain modified raw image at last level of its folder hierarchy):

  1. system.img.ext4.lz4 which contains a modified system.img.ext4.
  2. system.img.ext4
  3. recovery.img.lz4 which contains a modified system.img.
  4. recovery.img

When Odin3 v3.13 failed to flash the above modified files then it give below errors:

  1. For AP.tar containing LZ4 file: FAIL! LZ4 is invalid
    • The device has no impact of this error and it stay in download mode.
  2. For AP.tar containing ext4 or img file: FAIL! (Auth)
    • In this case the device display Only official released binaries are allowed to be flashed(recovery) or Only official released binaries are allowed to be flashed(system)

Please give your suggestions on:

  1. This device is secure by Knox from Samsung. Is it causing this error?
  2. If yes, is there any way to disable it in the VZW zip?
  3. If no, what is the actual problem and how can I resolve it?
  • All Android firmware images are protected by a cryptographic signature. Any modification will cause the cryptographic signature to become invalid and therefore your device rejects the image installation. Only devices with unlocked bootloader (not every device can be unlocked) can install firmware images that are not properly signed. – Robert Oct 25 '19 at 10:22
  • My device has unlocked bootloader. So, Is still the cryptographic signature should be valid? If yes, can we add this after modifying the image file or the only Samsung can add this? – Vatish Sharma Oct 25 '19 at 10:25
  • Only Samsung can sign an image. If unsigned images are not accepted your device is not unlocked. What did you do to unlock it? – Robert Oct 25 '19 at 10:27
  • Sorry for late reply. This device is unlocked by Samsung so I don't think they will cheat me. There must be some other reason. Perhaps they just unlocked the device but not turned off the Knox. Also, the device can be rooted by patching AP file by Magisk Manager so if they can patch it, I must be able to flash a simple change. What do you think? – Vatish Sharma Oct 29 '19 at 5:07
  • modded Odin forum.xda-developers.com/showthread.php?t=3762572 – alecxs Nov 20 '19 at 17:39
1

For LZ4 compression: lz4 -B6 --content-size system.img.ext4 system.img.ext4.lz4 command can be used to make a valid Odin Flashable file.

To Fix "FAIL! (Auth)", we need to truncate the vbmeta.img file and remove the signature from the boot.img. The detail is mentioned on Magisk install guide under Instructions section.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.