Skip to content

ext2rd seems make apex in system.img fail to unzip #13

@butterl

Description

@butterl

Hi,
Thanks for sharing this great tool for rom analysing !
I meet one thing that, after I run the ext2rd system_ext.img ./:savedir there is no error show and the jar file in system image is good to unzip.

the system.img in the test below is from https://dl.google.com/developers/android/sc/images/factory/coral-spb3.210618.016-factory-b1598d08.zip

file system.img
system.img: Android sparse image, version: 1.0, Total of 204832 4096-byte output blocks in 21 input chunks.

file system_ext.img
system_ext.img: Linux rev 1.0 ext2 filesystem data, UUID=ac16ea36-9e78-5adc-92ff-3e6fd0ccedcc (extents) (large files) (huge files)

When it comes to file under system/apex/ , the unzip is not success,seems all the apex file are broken

savedir/system/apex$ unzip -l com.android.appsearch.apex
Archive:  com.android.appsearch.apex
error [com.android.appsearch.apex]:  missing 32768 bytes in zipfile
  (attempting to process anyway)
  Length      Date    Time    Name
---------  ---------- -----   ----
      761  2009-01-01 00:00   apex_build_info.pb
       29  2009-01-01 00:00   apex_manifest.pb
  1355776  2009-01-01 00:00   apex_payload.img
     1032  2009-01-01 00:00   apex_pubkey
     1359  2009-01-01 00:00   assets/NOTICE.html.gz
       40  2009-01-01 00:00   resources.arsc
     1340  2009-01-01 00:00   AndroidManifest.xml
       32  2009-01-01 00:00   stamp-cert-sha256
      868  2009-01-01 00:00   META-INF/CERT.SF
     2244  2009-01-01 00:00   META-INF/CERT.RSA
      733  2009-01-01 00:00   META-INF/MANIFEST.MF
---------                     -------
  1364214                     11 files

while the jar xvf com.android.appsearch.apex returns

savedir/system/apex$ jar xvf com.android.appsearch.apex
extracted: apex_build_info.pb
extracted: apex_manifest.pb
java.util.zip.ZipException: invalid entry CRC (expected 0xdb6c7410 but got 0x2c51a2fa)
        at java.base/java.util.zip.ZipInputStream.read(ZipInputStream.java:222)
        at java.base/java.io.FilterInputStream.read(FilterInputStream.java:107)
        at jdk.jartool/sun.tools.jar.Main.copy(Main.java:1249)
        at jdk.jartool/sun.tools.jar.Main.copy(Main.java:1277)
        at jdk.jartool/sun.tools.jar.Main.extractFile(Main.java:1454)
        at jdk.jartool/sun.tools.jar.Main.extract(Main.java:1364)
        at jdk.jartool/sun.tools.jar.Main.run(Main.java:409)
        at jdk.jartool/sun.tools.jar.Main.main(Main.java:1681)

I tried several system image including the newest android-s-beta 3.1 , the result seems same, all apex file is croupted while the other jar file is good to unzip.

Any idea if some log I could help to catch to debug this ? the tool build is using the HEAD version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions