Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error extracting from jar or apk #18

Open
jackz314 opened this issue Dec 14, 2020 · 1 comment
Open

Error extracting from jar or apk #18

jackz314 opened this issue Dec 14, 2020 · 1 comment

Comments

@jackz314
Copy link

I'm trying to extract proto files from an APK, but it fails when extracting content from the jar:

In vfo:
Traceback (most recent call last):
  File "./gui.py", line 462, in run
    for name, contents in self.extractor['func'](input_):
  File "/home/jack/Desktop/phone/pbtk/extractors/jar_extract.py", line 236, in handle_jar
    extract_lite(jar, cls, enums, gen_classes_nodollar, codedinputstream, codedoutputstream, map_entry_cls, out_additional_cls,
  File "/home/jack/Desktop/phone/pbtk/extractors/jar_extract.py", line 326, in extract_lite
    ftype = {0: 'int32', 1: 'fixed64', 2: 'bytes', 3: 'group', 5: 'fixed32'}[lazy_tag & 7]
KeyError: 4

I checked the code and the lazy_tag I'm getting when this error occurs is 68, so it's trying to find key 4 in the ftype dict, but it doesn't exist. Is this intentional?

@savandriy
Copy link

I get a similar error, but in a different place:

In apau:
Traceback (most recent call last):
  File "jar_extract.py", line 962, in <module>
    extractor_main('jar_extract')
  File "/home/andriy/pbtk/extractors/../utils/common.py", line 261, in extractor_main
    nb_written, wrote_endpoints = extractor_save(args.output_dir, '', extractor['func'](args.input_))
  File "/home/andriy/pbtk/extractors/../utils/common.py", line 217, in extractor_save
    for name, contents in outputs:
  File "jar_extract.py", line 236, in handle_jar
    extract_lite(jar, cls, enums, gen_classes_nodollar, codedinputstream, codedoutputstream, map_entry_cls, out_additional_cls,
  File "jar_extract.py", line 326, in extract_lite
    ftype = {0: 'int32', 1: 'fixed64', 2: 'bytes', 3: 'group', 5: 'fixed32'}[lazy_tag & 7]
KeyError: 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants