sky201503 / android-apktool-1

Automatically exported from code.google.com/p/android-apktool
0 stars 0 forks source link

Windows reserved names aren't properly handled when creating smali classes #367

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
apktool seems to fail extracting classes using Windows reserved names such as:

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

This issue is similar to #86, I'd suggest a simple workaround such as placing a 
leading underscore if the class matches one of the above names.

Find attached an APK to reproduce the issue.

Cheers,

Mario

Original issue reported on code.google.com by mball...@gmail.com on 7 Dec 2012 at 2:24

Attachments:

GoogleCodeExporter commented 9 years ago
Will see if underlying issue is baksmali or apktool.

Original comment by connor.tumbleson on 8 Dec 2012 at 8:55

GoogleCodeExporter commented 9 years ago
I don't have a Windows computer for like another month, and I'm too lazy to 
setup a VM. Do you have the actual error or anything that it says?

Original comment by connor.tumbleson on 21 Dec 2012 at 3:31

GoogleCodeExporter commented 9 years ago
It doesn't actually throw any errors, but it won't extract the file aux.smali, 
if you get to modify the code to avoid writing such filenames I can do testing 
on a Windows box for you. Alternatively, I could work on a patch myself if you 
give me some guidelines.

Thanks!,

Mario

Original comment by mball...@gmail.com on 21 Dec 2012 at 11:16

GoogleCodeExporter commented 9 years ago
Couldn't duplicate this. Tried on Windows and Linux w/ same apk. Linux handled 
it fine, and Windows just add # and numbers to escape it. I noticed no problems.

Let me know if I missed anything. I've attached the ls -l output of Windows & 
Linux. As you can see there is no problem.

Original comment by connor.tumbleson on 15 Jan 2013 at 2:26

Attachments:

GoogleCodeExporter commented 9 years ago
Guess I should pull the lines out to make it easier.

Windows:
-rw-r--r--    1 Connor   Administ      565 Jan 14 20:19 aux#.2.smali
-rw-r--r--    1 Connor   Administ     3320 Jan 14 20:19 auX#.smali

Linux:
-rw-rw-r-- 1 ibotpeaches ibotpeaches    547 Jan 14 20:20 aux.smali
-rw-rw-r-- 1 ibotpeaches ibotpeaches   3135 Jan 14 20:20 auX.smali

Original comment by connor.tumbleson on 15 Jan 2013 at 2:28

GoogleCodeExporter commented 9 years ago
I have just confirmed this bug is fixed on apktool 1.5.1 (from Dec 28), it 
wasn't working on 1.5.0 though, may have this been fixed in baksmali?

Anyway, I think we can close this issue.

Thanks!,

Mario

Original comment by mball...@gmail.com on 15 Jan 2013 at 9:56

GoogleCodeExporter commented 9 years ago

Original comment by connor.tumbleson on 15 Jan 2013 at 12:37