Fixes #61, and other improvements.#68
Open
ItsIgnacioPortal wants to merge 5 commits intodwisiswant0:masterfrom
Open
Fixes #61, and other improvements.#68ItsIgnacioPortal wants to merge 5 commits intodwisiswant0:masterfrom
ItsIgnacioPortal wants to merge 5 commits intodwisiswant0:masterfrom
Conversation
dwisiswant0
reviewed
Jun 7, 2022
dwisiswant0
reviewed
Jun 8, 2022
dwisiswant0
reviewed
Jun 8, 2022
Comment on lines
+94
to
+119
|
|
||
| #If the path contains a space.. | ||
| #This is the case if apkleaks was installed on windows through PyPi, as apkleaks.exe ends up in the path "C:/Program Files/Python39/Lib/site-packages/jadx/bin/jadx.bat" (in this example, under python39) | ||
| #On windows, if an executable's path doesn't contain spaces but is it quoted anyway, the command fails. We must only quote the path if it has spaces. | ||
| if(self.jadx.__contains__(" ")): | ||
| args = ["\"" + self.jadx + "\"", self.file, "-d", self.tempdir] | ||
| else: | ||
| args = [self.jadx, self.file, "-d", self.tempdir] | ||
|
|
||
|
|
||
| try: | ||
| args.extend(re.split(r"\s|=", self.disarg)) | ||
| except Exception: | ||
| pass | ||
|
|
||
| #add single quotes to every parameter | ||
| comm = "%s" % (" ".join(quote(arg) for arg in args)) | ||
|
|
||
| #jadix.bat doesn't like single quotes. Replace them with double quotes | ||
| comm = comm.replace("\'","\"") | ||
|
|
||
| #If the path to jadx contains a space | ||
| if(self.jadx.__contains__(" ")): | ||
| #eliminate duplicate quotes | ||
| comm = comm.replace("\"\"","\"") | ||
|
|
Owner
There was a problem hiding this comment.
I believe that this can be reworked cleaner & less typing using pathlib module and apply it to both JADX and APK file paths.
Author
There was a problem hiding this comment.
I do realize it's a very sloppy way of doing it. I didn't want to completely refactor the logic you put in place, mostly because I didn't know what issues that could cause down the line. For example, I don't understand what the porpuse of this codeblock is:
try:
args.extend(re.split(r"\s|=", self.disarg))
except Exception:
passSo I decided to just keep it and instead modify as little as possible to make this work.
You can refactor it if you want, but I'm satisfied with it as it is. decompile() is called a single time during the execution of apkleaks, so performance doesn't really matter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 runC:/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-t996o3tzwithout quoting the jadx.bat path.