chenquincy / app-info-parser

A javascript parser for parsing .ipa or .apk files. IPA/APK文件 js 解析器
MIT License
492 stars 116 forks source link

Feature request: parse aab format #63

Open sunnylqm opened 3 years ago

sunnylqm commented 3 years ago

https://developer.android.com/guide/app-bundle/app-bundle-format

It seems that there is just one more base folder compared to apk:

image

chenquincy commented 3 years ago

@sunnylqm Please provide a aab file for testing.

chenquincy commented 3 years ago

@sunnylqm I tried to parse the AAB file base on the current version. It seems not just one more folder. The AAB file's AndroidManifest.xml has a different chunk type compare to APK file, that make a parse error in xml-parser/binary.js. I will try it later but no sure when it will be resolved(because I'm working for a busy project).

sunnylqm commented 3 years ago

@chenquincy Appreciate your effort! I'd like to buy you some coffee 👍

chenquincy commented 3 years ago

@sunnylqm I just checked some document of AAB file and found that things are more complicated than we thought.

image

Refer to this document.

The manifest.xml in AAB file is compiled with a protocol buffer format different from apk's manifest.xml(binary format).

It means that we need the detail of protocol buffer format to parse AAB file's manifest.xml. Unfortunately, I didn't find it.

chenquincy commented 3 years ago

If you can find or provide the protocol, I think I can resolve the issue with the protocol.

sunnylqm commented 3 years ago

i think it means this one https://developers.google.com/protocol-buffers right?

chenquincy commented 3 years ago

@sunnylqm Yes, that's it. But we also need the proto file or json of the xml to decode it. Here is a js tool to decode protocol buffer format content: protobufjs. I have no idea about the structure of the manifest.xml's proto.

sunnylqm commented 3 years ago

Check this out https://gist.github.com/Farious/e841ef85a8f4280e4f248ba8037ea2c0#file-rollback_aab-sh-L51

chenquincy commented 3 years ago

@sunnylqm Thanks for your help. I parsed it success just now, is this result you want:

{
  "element": {...},
  "source": {...}
}
chenquincy commented 3 years ago

@sunnylqm I had simplified the result, because the original result is too long.

sunnylqm commented 3 years ago

I don't know but I think it is 😅

sunnylqm commented 3 years ago

Very cool! Looking forward for a new version!

chenquincy commented 3 years ago

@sunnylqm OK, I have removed the parse result. I still should take a while to write the final version. Be patient, not sure for the finish time. Thanks for your help and support again!

DreamPWJ commented 2 years ago

希望尽快啊,辛苦

R1p4eg commented 2 years ago

Hi there!

Any update on this issue/feature?)

thekhegay commented 2 years ago

@chenquincy helllo! any updates?

reyesmfabian commented 1 month ago

Hi, is there any update or new version with this feature? Thank you very much :)