Closed GoogleCodeExporter closed 9 years ago
I am unable to reproduce, on linux at least.
It seems to be some sort of IO issue on windows, but I have no idea what might
cause that. Did you try disassembling it again? Does the same error
consistently happen on the same class?
Original comment by jesusfreke@jesusfreke.com
on 26 Aug 2012 at 8:11
Yes...it's the same class every time. Out of curiosity, I attempted to use a
copy of Dedexer from April of this year, and it bugs on that same class as
well. As you said you weren't able to reproduce in linux, I decided I'd try
baksmali on a couple of my machines to see what's going on. Here are my results:
Win7 x64: Error, com.zynga.hanging.aux IS NOT present in dump
WinXP Pro x86: No error, com.zynga.hanging.aux IS NOT present in dump
Ubuntu x86: No error, com.zynga.hanging.aux IS present in dump
With that being said, since I'm able to decompile it without problems under
linux, I think it would be safe to say that it's a windows problem.
Original comment by putterpl...@gmail.com
on 27 Aug 2012 at 12:42
Oh! I know what the problem is.
aux is a "special" filename on windows - you can't create a file named aux.
Apparently, you can't even create it with an extension (like aux.smali).
Original comment by jesusfreke@jesusfreke.com
on 27 Aug 2012 at 12:46
That's definitely some useful information, and interesting as well. Just did
some reading about it after reading your reply. Funny that I've never known
that before. In that case, there's probably nothing that can be done about that
for windows short of renaming the class. Even then, it would probably be near
impossible to implement in the case that such a class is accessed via
reflection.
Nonetheless, thanks a TON for pointing me in the right direction with that. For
such things, I'll just use Linux. It will definitely save me from a headache if
I ever run into it again in the future. :)
Original comment by putterpl...@gmail.com
on 27 Aug 2012 at 7:15
I'm actually not sure why this is happening. baksmali has logic that *should*
rename this file to aux#.smali.
Can you try and create the following files, and let me know if they fail or
not? (i.e. just create a blank file with the given name, in your favorite text
editor, or whatever)
aux.smali (pretty sure this one fails :))
con.smali (this one should fail)
aux#.smali (this one *shouldn't* fail)
Original comment by jesusfreke@jesusfreke.com
on 4 Sep 2012 at 12:11
[deleted comment]
I have the same error.
Unable to create file smali\coN.smali - skipping class
Unable to create file smali\CoN.2.smali - skipping class
Unable to create file smali\aUX.smali - skipping class
Unable to create file smali\cOn.3.smali - skipping class
Unable to create file smali\Con.4.smali - skipping class
Unable to create file smali\AuX.2.smali - skipping class
Unable to create file smali\cON.5.smali - skipping class
Unable to create file smali\Aux.3.smali - skipping class
Unable to create file smali\AUX.4.smali - skipping class
Unable to create file smali\con.6.smali - skipping class
Unable to create file smali\COn.7.smali - skipping class
Unable to create file smali\aUx.5.smali - skipping class
Unable to create file smali\aux.6.smali - skipping class
Unable to create file smali\auX.7.smali - skipping class
Unable to create file smali\AUx.8.smali - skipping class
Unable to create file smali\CON.8.smali - skipping class
That`s due to windows fs restrictions. Maybe be can rename such files like this:
aux.1.smali > aux1.smali(we can create file with this name). If we use
aux.1.smali windows thinks that 1.smali is extension and file name is aux(we
can`t create file with such name).
Wiki says that we can`t use such names:
CON, PRN, AUX, CLOCK$, NUL
COM0, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9
LPT0, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9
So we can`t rename com.1.smali to com1.smali
As result maybe the best solution is to rename files like this:
aux.1.smali > aux_1.smali
com1.smali > com1_.smali
com.smali > com_.smali
Original comment by furn...@gmail.com
on 4 Sep 2012 at 6:12
There already is logic to rename these reserved files. I don't understand why
it's not getting triggered though.
Can either one of you test whether modifyWindowsReselvedFilenames is getting
set to true or false, in
util/src/main/java/org/jf/util/ClassFileNameHandler.java. You can just add a
System.out.println after it gets set, on line 51.
Original comment by jesusfreke@jesusfreke.com
on 4 Sep 2012 at 7:00
It returns false. But how baksmali manages to create aux.smali and con.smali? -
thats strange.
By the way. Can you fix one more windows issue. On windows baksmali shows
"test" message during disassembling. It makes me crazy. On my linux desktop
console stays clean. If you don`t want remove this message maybe you can say
how can i remove it myself?
If you need more tests to fix this issue i`ll help you.
Original comment by furn...@gmail.com
on 4 Sep 2012 at 9:24
I made more tests - tried to set modifyWindowsReselvedFilenames = true
Now baksmali decompiles con.smali(renames to con#.smali) and aux smali(renames
to aux#.smali) but still can`t decompile all other files. Baksmali don`t
renames CoN.2.smali to CoN#.2.smali and so on.
Unable to create file out\CoN.2.smali - skipping class
Unable to create file out\cOn.3.smali - skipping class
Unable to create file out\Con.4.smali - skipping class
Unable to create file out\AuX.2.smali - skipping class
Unable to create file out\cON.5.smali - skipping class
Unable to create file out\Aux.3.smali - skipping class
Unable to create file out\AUX.4.smali - skipping class
Unable to create file out\con.6.smali - skipping class
Unable to create file out\COn.7.smali - skipping class
Unable to create file out\aUx.5.smali - skipping class
Unable to create file out\aux.6.smali - skipping class
Unable to create file out\auX.7.smali - skipping class
Unable to create file out\AUx.8.smali - skipping class
Unable to create file out\CON.8.smali - skipping class
PS: maybe it`s better don`t check if we can create files, but detect OS.
Example:
http://www.mkyong.com/java/how-to-detect-os-in-java-systemgetpropertyosname/
Original comment by furn...@gmail.com
on 4 Sep 2012 at 3:13
Ok, I've fixed the Con.2.smali issue.
Now, I just need to figure out why modifyWindowsReselvedFilenames isn't working
properly. Can you try the attached baksmali.jar, and respond back with it's
output? I sprinkled in some Here<N> messages in strategic locations in
modifyWindowsResolvedFilenames
Original comment by jesusfreke@jesusfreke.com
on 5 Sep 2012 at 4:10
Attachments:
here3
testhere5
Then skipping all classes as before. And as i said - it shows test in windows.
Original comment by furn...@gmail.com
on 5 Sep 2012 at 5:39
Ha! I know what it's doing. When I open and try to write con.smali - it is
succeeding - but it doesn't open/create con.smali. It opens con (i.e. stdout),
and writes to it!
Original comment by jesusfreke@jesusfreke.com
on 5 Sep 2012 at 6:18
Can you confirm the attached version works now?
Original comment by jesusfreke@jesusfreke.com
on 5 Sep 2012 at 6:37
Attachments:
Thanks. In my case everything works now. Baksmali renames all aux and con files
and no "test" message :). Hope in Putterplace case everything will work too.
Original comment by furn...@gmail.com
on 5 Sep 2012 at 7:41
Great! The fix is committed. Thanks for the help tracking this one down.
Original comment by jesusfreke@jesusfreke.com
on 5 Sep 2012 at 7:45
Original issue reported on code.google.com by
putterpl...@gmail.com
on 26 Aug 2012 at 7:28Attachments: