androguard: --silent option not working properly causes errno 36 file name too long on terminal

I wanted to do decompile an apk file

  • is this error specific to a single file? apparently it will happen whenever a file’s name is too long OR it is nested deep

  • if possible give a minimal working example where the error happens

setting --silent option like: androguard --silent decompile app.apk --output ./outputdir

Describe what you expected

not expected to ocurr when --silent is set

Describe what actually happened

Androguard runs silently but starts echoing logs after a while

System Information

  • Androguard Version: androguard --version

androguard, version 3.3.5

  • Python Version: 2.7 (from error log below)
  • Operating System uname -r

4.19.0-kali5-amd64

uname -a

Linux device_name 4.19.0-kali5-amd64 #1 SMP Debian 4.19.37-6kali1 (2019-07-22) x86_64 GNU/Linux

cat /proc/version

Linux version 4.19.0-kali5-amd64 (devel@kali.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.37-6kali1 (2019-07-22)

###Output

everything runs smooth and goes on dumping until the error appears as:

File “/usr/local/bin/androguard”, line 10, in <module> sys.exit(entry_point()) File “/usr/lib/python2.7/dist-packages/click/core.py”, line 764, in call return self.main(args, kwargs) File “/usr/lib/python2.7/dist-packages/click/core.py”, line 717, in main rv = self.invoke(ctx) File “/usr/lib/python2.7/dist-packages/click/core.py”, line 1137, in invoke return process_result(sub_ctx.command.invoke(sub_ctx)) File “/usr/lib/python2.7/dist-packages/click/core.py”, line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File “/usr/lib/python2.7/dist-packages/click/core.py”, line 555, in invoke return callback(*args, **kwargs) File “/usr/local/lib/python2.7/dist-packages/androguard/cli/entry_points.py”, line 395, in decompile jar, decompiler, format) File “/usr/local/lib/python2.7/dist-packages/androguard/cli/main.py”, line 275, in export_apps_to_format with open(filename + “.ag”, “w”) as fd: IOError: [Errno 36] File name too long: u’./outputdir/nine/subdirs/deep/* buildFeedbackEvent (String String String D D String String I I I Date String [Location [Location I I I String String String String Z String String String I I String String String String String String String String String I I I I I I)Hashtable.ag’

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 21 (12 by maintainers)

Most upvoted comments

I pushed a fix to master. Can you test if this works for you?

The meaning of this command is to redirect the standard input/output/error to null in the situation of successful decompilation, but since your output is still due to the filename limitation problem, so this cannot be avoided

So, I came to notice I’ve misunderstood the issue here, right? It is not a problem of echoing the name of the file, but the memory for storing a file with such a long string. Is it?

It is the file system limiting the length of the file name.

you could see the limitations on wiki