Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'C:/Program' is not recognized as an internal or external command, operable program or batch file. #61

Open
ItsIgnacioPortal opened this issue Feb 2, 2022 · 5 comments · May be fixed by #68

Comments

@ItsIgnacioPortal
Copy link

ItsIgnacioPortal commented Feb 2, 2022

Issue exists on Apkleaks v2.6.1, running on Windows 10, with python 3.9.0.

This is probably because of the space in name of the Program Files folder. The error message appears after ** Decompiling APK...

@ahopelesshadow
Copy link

Put it in "" ?

@ItsIgnacioPortal
Copy link
Author

ItsIgnacioPortal commented Jun 4, 2022

I didn't make myself clear. I'm trying to scan the APK for Aurora-Droid.
Both of these commands:

  • apkleaks -f "C:\Users\REDACTED\Downloads\Aurora.Droid.ver.1.0.8.build.8.apk"
  • apkleaks -f Aurora.Droid.ver.1.0.8.build.8.apk

show the same error.

'C:/Program' is not recognized as an internal or external command, operable program or batch file.

Since the time I encoutered this issue, I've created a little program called "improper-quotes monitor"; What it does is that it keeps a log of the parameters that are passed to C:\Program whenever a program attempts to access a path under C:\Program Files without quotes. Thanks to this, I've been able to detect that some library within python is trying to run:

C:/Program Files/Python39/Lib/site-packages/jadx/bin/jadx.bat Aurora.Droid.ver.1.0.8.build.8.apk -d C:\Users\REDACTED\AppData\Local\Temp\apkleaks-t996o3tz

But because it doesn't have quotes in the path, it actually runs C:\Program.exe with Files/Python39/Lib/site-packages/jadx/bin/jadx.bat Aurora.Droid.ver.1.0.8.build.8.apk -d C:\Users\REDACTED\AppData\Local\Temp\apkleaks-t996o3tz as its parameters.

@ahopelesshadow
Copy link

Yea i think i understand you but you dont understand me, your typing a path in terminal... you always need to quote it if it has spaces... thats why its trying to run program... because thats the last str before the space.

@ItsIgnacioPortal
Copy link
Author

ItsIgnacioPortal commented Jun 4, 2022

Yea i think i understand you but you dont understand me, your typing a path in terminal... you always need to quote it if it has spaces... thats why its trying to run program... because thats the last str before the space.

I have already tried using quotes. Look at my comment carefully.

Both of these commands:

  • apkleaks -f "C:\Users\REDACTED\Downloads\Aurora.Droid.ver.1.0.8.build.8.apk"
  • apkleaks -f Aurora.Droid.ver.1.0.8.build.8.apk

show the same error.

The full path to the APK doesn't even have spaces. It doesn't need to be quoted. This is not my error. It's an error within apkleaks

By the way, please refrain from using dots (...) in your comments. It makes you seem condescending

ItsIgnacioPortal added a commit to ItsIgnacioPortal/apkleaks that referenced this issue Jun 4, 2022
@ItsIgnacioPortal
Copy link
Author

ItsIgnacioPortal commented Jun 4, 2022

TL;DR: When installing apkleaks from PyPi on Windows, jadx.bat was installed in the path C:\Program Files\Python39\Lib\site-packages\jadx\bin\jadx.bat. This caused #61, because apkleaks was trying to run C:/Program Files/Python39/Lib/site-packages/jadx/bin/jadx.bat Aurora.Droid.ver.1.0.8.build.8.apk -d C:\Users\REDACTED\AppData\Local\Temp\apkleaks-t996o3tz without quoting the jadx.bat path.

I've fixed this and opened a pull request. See: #68

@ItsIgnacioPortal ItsIgnacioPortal linked a pull request Jun 4, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants