iBotPeaches / Apktool

A tool for reverse engineering Android apk files
https://apktool.org/
Apache License 2.0
20.22k stars 3.59k forks source link

Very subtle crash (without apk) #1304

Closed ale5000-git closed 8 years ago

ale5000-git commented 8 years ago

Information

  1. Apktool Version (apktool -version) - 2.2.0 (but probably all versions are affected).
  2. Operating System (Mac, Linux, Windows) - Windows 8.1 (but probably happens on all Windows).
  3. APK From? (Playstore, ROM, Other) - No apk needed.

    Steps to Reproduce

I went crazy to figure out the cause of this crash and at the end was just a folder name (it possibly happens also with other special names).

  1. On Windows put it here: C:\!\apktool.jar
  2. Run: java -jar C:\!\apktool.jar -version
  3. An you get: Exception in thread "main" java.lang.NullPointerException at java.util.Properties$LineReader.readLine(Unknown Source) at java.util.Properties.load0(Unknown Source) at java.util.Properties.load(Unknown Source) at brut.androlib.ApktoolProperties.loadProps(ApktoolProperties.java:46) at brut.androlib.ApktoolProperties.get(ApktoolProperties.java:37) at brut.androlib.ApktoolProperties.get(ApktoolProperties.java:32) at brut.androlib.Androlib.getVersion(Androlib.java:692) at brut.apktool.Main._version(Main.java:251) at brut.apktool.Main.main(Main.java:98)
ale5000-git commented 8 years ago

It is related to this: https://github.com/JesusFreke/smali/issues/422 but smali just don't show version but apktool instead crash.

iBotPeaches commented 8 years ago

Pretty sure Java chokes on resource names if there is an ! in the path. Don't use an exclamation point. Problem solved. I don't want to spend my already slim amount of time on such a problem/issue that can be easily resolved.