EFForg / apkeep

MIT License
838 stars 54 forks source link

apkeep names files .apk that are not APKs #89

Closed eighthave closed 2 years ago

eighthave commented 2 years ago

An APK has a pretty clear definition, including:

apkeep downloads somethings which seem to be related to Android App Bundles (AAB) aka app "splits" and calls them .apk. It should use a different file extension, so that automated things can know how to handle them.

$ apksigner verify repo/at.wienerlinien.wienmobillab@4.1.2.apk
Exception in thread "main" com.android.apksig.apk.ApkFormatException: Missing AndroidManifest.xml
    at com.android.apksig.ApkSigner.getAndroidManifestFromApk(ApkSigner.java:898)
    at com.android.apksig.ApkVerifier.getAndroidManifestFromApk(ApkVerifier.java:981)
    at com.android.apksig.ApkVerifier.verifyAndGetMinSdkVersion(ApkVerifier.java:587)
    at com.android.apksig.ApkVerifier.verify(ApkVerifier.java:181)
    at com.android.apksig.ApkVerifier.verify(ApkVerifier.java:149)
    at com.android.apksigner.ApkSignerTool.verify(ApkSignerTool.java:516)
    at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:88)
$ unzip -l repo/at.wienerlinien.wienmobillab@4.1.2.apk 
Archive:  repo/at.wienerlinien.wienmobillab@4.1.2.apk
  Length      Date    Time    Name
---------  ---------- -----   ----
 12147636  1980-00-00 00:00   at.wienerlinien.wienmobillab.apk
ApkPure.com
    23383  1980-00-00 00:00   icon.png
ApkPure.com
  1513423  1980-00-00 00:00   config.xxhdpi.apk
ApkPure.com
   221843  1980-00-00 00:00   config.de.apk
ApkPure.com
    33177  1980-00-00 00:00   config.en.apk
ApkPure.com
  7070415  1980-00-00 00:00   config.arm64_v8a.apk
ApkPure.com
      939  1980-00-00 00:00   manifest.json
ApkPure.com
---------                     -------
 21010816                     7 files
eighthave commented 2 years ago

It seems that these ZIP bundles from apkpure are "XAPK" format: https://apkpure.com/how-to/how-to-install-xapk-apk

Hainish commented 2 years ago

Fixed in https://github.com/EFForg/apkeep/commit/15478279b69b451357550481539b48c65155582b