rallat / smali

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

baksmali fails on symlinks #154

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What seems to be the problem?
Under modern Windows NT, a symbolic link causes baksmali to stop processing, 
because a system provided file enumeration routine provides size equal to zero 
for symbolic links. This probably occurs in your file.exists() or file.canRead()

Symbolic links are generated by a custom tool which replaces duplicate files. 
Baksmali reports an error:
{
Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Util.ExceptionWithContext: [...]/framework/android.policy.jar: 
file too short
at 
org.jf.dexlib.Util.ExceptionWithContext.withContext(ExceptionWithContext.java:46
)
at org.jf.dexlib.Code.Analysis.ClassPath.loadBootClassPath(ClassPath.java:220)
}
Note that android.policy.jar is a symbolic link to the same, 313 bytes long 
file, located in another backup directory.

After replacing the symlink with the real file, baksmali runs without errors.

What is the exact smali/baksmali command that you ran?
java -jar /android/bin/baksmali.jar -x "file.odex" -d 
"android/backup/system2.1/framework" -o file.odex-smali

What version of smali/baksmali are you using? 1.2.2

Original issue reported on code.google.com by hrabiasa...@gmail.com on 17 Nov 2012 at 4:13

GoogleCodeExporter commented 9 years ago
Solution: don't use symbolic links :D

Joking aside, thanks for the report. I'll try and get this fixed at some point.

If you happen to have the inclination to fix this yourself, a patch would be 
muchly appreciated, especially since I don't have any windows system readily 
available to reproduce the issue or test a fix on.

Original comment by jesusfreke@jesusfreke.com on 17 Nov 2012 at 7:43