itlgl / smali

Automatically exported from code.google.com/p/smali
0 stars 0 forks source link

disassembleDexFile: File name too long #164

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to decode a sample with localApkDecoder.decode();

What is the expected output? What do you see instead?
Excpected: Decoding process fnishes without exception
Received: 
Error occured while disassembling class <redacted> - skipping class
java.io.IOException: File name too long
        at java.io.UnixFileSystem.createFileExclusively(Native Method)
        at java.io.File.createNewFile(File.java:900)
        at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:176)

(The apk is malware and I don't want to tip of the authors so I redacted the 
name)

What version of the product are you using? On what operating system?
apktool-1.5.2.jar
smali-1.2.6.jar
Linux 3.2.0-38-generic #61-Ubuntu SMP Tue Feb 19 12:18:21 UTC 2013 x86_64 
x86_64 x86_64 GNU/Linux

Please provide any additional information below.
I cannot attach the apk file here. In this case it is android MALWARE (our 
software uses smali to unpack and analyze it)
I can provide you with the file via dropbox/email.

Original issue reported on code.google.com by linux.ni...@gmail.com on 12 Mar 2013 at 5:29

GoogleCodeExporter commented 9 years ago
Thanks for the report. I've known this one for a while, but I've been a bit 
lazy about fixing it. The real fix will be somewhat involved, but if you just 
want to get it working for the moment, you can modify baksmali and truncate the 
filename before it creates the smali file - and hope it doesn't have multiple 
classes with the same truncated name.

Original comment by bgruv@google.com on 12 Mar 2013 at 5:58

GoogleCodeExporter commented 9 years ago
You could also achieve a constant filename by appending some kind of hash. That 
would guarantee constant length and still make sure the filenames are unique 
per file.

Original comment by linux.ni...@gmail.com on 13 Mar 2013 at 3:43

GoogleCodeExporter commented 9 years ago
I plan on basically truncating and adding a numeric suffix. I already have some 
support for similar types of filename remapping for things like reserved 
filenames in windows, and for case insensitive file systems.

Original comment by bgruv@google.com on 13 Mar 2013 at 9:29

GoogleCodeExporter commented 9 years ago
I had this problem too, and made the necessary fix (hash of filename) to the 
appropriate java file. If you're looking for a temporary fix, I can send the 
corrected java file or compiled jar file.

Original comment by arungane...@gmail.com on 8 Aug 2013 at 9:24