Android_boot_image_editor icon indicating copy to clipboard operation
Android_boot_image_editor copied to clipboard

Support unpack/pack apex_payload.img

Open nxtclone opened this issue 2 years ago • 7 comments

Can u make this project support unpack/pack apex_payload.img in .apex file? I see it's ext4 file system image backed by dm-verity, so i think can unpack and disable dm-verity like boot.img image

nxtclone avatar May 21 '23 14:05 nxtclone

Yes, have been considering this for a long time ...

apex format https://cs.android.com/android/platform/superproject/+/master:system/apex/docs/README.md

cfig avatar Jun 01 '23 08:06 cfig

example capex cc.cfig.lazybox.capex.zip

Archive:  cc.cfig.lazybox.capex
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
    1328  Stored     1328   0% 2009-01-01 00:00 3134ceed  AndroidManifest.xml
     520  Stored      520   0% 2009-01-01 00:00 f6cbf43d  apex_build_info.pb
     133  Stored      133   0% 2009-01-01 00:00 46672ed5  apex_manifest.pb
    1032  Stored     1032   0% 2009-01-01 00:00 55a7242d  apex_pubkey
  339017  Defl:N    63297  81% 2009-01-01 00:00 63f975b8  original_apex
     597  Defl:N      395  34% 2009-01-01 00:00 c7885266  META-INF/CERT.SF
    2373  Defl:N     1975  17% 2009-01-01 00:00 a5386d22  META-INF/CERT.RSA
     462  Defl:N      305  34% 2009-01-01 00:00 d0dfce73  META-INF/MANIFEST.MF
--------          -------  ---                            -------
  345462            68985  80%                            8 files

cfig avatar Jul 13 '23 08:07 cfig

I tested in Android 11, i can use UKA to unpack and repack witth new apex_pubkey and boot success, but i can't do this with android 13. I tried just extracting the com.android.conscrypt.apex file, then compressing(mode: store) and signing it again, but it still doesn't work, I'm feeling confused.

nxtclone avatar Dec 05 '23 12:12 nxtclone

Having been too busy these months ... I will try to implement it before Chinese New Year

cfig avatar Dec 19 '23 02:12 cfig

I have found an alternative solution. Just re-sign .apex file with tool sign_apex.py with any key and replace it in /system/apex

nxtclone avatar Dec 19 '23 03:12 nxtclone

Just did some testings on apex, there are already some useful tools like apexer, deapexer. As there is alternative tool to do the unpack/pack work, just using the existing ones should be OK.

cfig avatar Dec 19 '23 06:12 cfig

Screenshot_2023-12-19_16-13-07

Attach a pic here, and leave the issue open to help late comers who may be interested.

cfig avatar Dec 19 '23 08:12 cfig