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

FileNotFoundError classes-dex2jar.jar #23

Open
UnknowUsername opened this issue Apr 8, 2021 · 5 comments
Open

FileNotFoundError classes-dex2jar.jar #23

UnknowUsername opened this issue Apr 8, 2021 · 5 comments

Comments

@UnknowUsername
Copy link

PS C:\Users\misti\Desktop\Begin\PrivacySecurityReversProtection\revers\pbtk-1.0.5> ./gui.py
C:\Users\misti\Desktop\Begin\PrivacySecurityReversProtection\revers\pbtk-1.0.5\gui.py:442: DeprecationWarning: an integer is required (got type float). Implicit conversion to integers using int is deprecated, and may be
removed in a future version of Python.
view.move((resolution.width() / 2) - (view.frameSize().width() / 2),
Traceback (most recent call last):
File "C:\Users\misti\Desktop\Begin\PrivacySecurityReversProtection\revers\pbtk-1.0.5\gui.py", line 462, in run
for name, contents in self.extractor'func':
File "C:\Users\misti\Desktop\Begin\PrivacySecurityReversProtection\revers\pbtk-1.0.5\extractors\jar_extract.py", line 51, in handle_jar
with JarWrapper(path) as jar:
File "C:\Users\misti\Desktop\Begin\PrivacySecurityReversProtection\revers\pbtk-1.0.5\utils\java_wrapper.py", line 25, in init
self.handle_file(fname)
File "C:\Users\misti\Desktop\Begin\PrivacySecurityReversProtection\revers\pbtk-1.0.5\utils\java_wrapper.py", line 43, in handle_file
self.handle_file(self.name + '/' + cls)
File "C:\Users\misti\Desktop\Begin\PrivacySecurityReversProtection\revers\pbtk-1.0.5\utils\java_wrapper.py", line 34, in handle_file
with ZipFile(fname) as jar:
File "C:\Python\Python38\lib\zipfile.py", line 1251, in init
self.fp = io.open(file, filemode)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\misti\AppData\Local\Temp\tmpkxi_mopf/classes-dex2jar.jar' ****

@erob8
Copy link

erob8 commented Apr 13, 2021

Yeah I'm getting this same error on Windows when i use the jar_extract with an apk file.
Linux works fine.

@UnknowUsername
Copy link
Author

UnknowUsername commented Apr 13, 2021 via email

@Nadimibox
Copy link

I got the solution ( it worked on all system operations )

  • Downloading the latest release of DexPatcher and unzip that
  • Delete all files and folders from pbtk/utils/external/dex2jar directory and Replace all files and folders from dex-tools-2.1-20190905-lanchon (unziped DexPatcher folder) to pbtk/utils/external/dex2jar directory

This method will definitely solve the problem
Regards.

@nref
Copy link

nref commented Nov 30, 2023

This happens on Ubuntu 22, Windows 10, and WSL2, and the method given by @Nadimibox did not fix it.

@nref
Copy link

nref commented Nov 30, 2023

Fixed it. dex2jar was too old. The latest version worked.

Moreover, when dex2jar fails, the error is suppressed by subprocess.run:

com.googlecode.d2j.DexException: not support version.
        at com.googlecode.d2j.reader.DexFileReader.<init>(DexFileReader.java:151)
        at com.googlecode.d2j.reader.DexFileReader.<init>(DexFileReader.java:211)
        at com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Dex2jarCmd.java:104)
        at com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:288)
        at com.googlecode.dex2jar.tools.Dex2jarCmd.main(Dex2jarCmd.java:32)

I changed the call to run to bail if dex2jar fails. Note that version 2.1 always returned 0, even in the case of an exception, but this is fixed as of 2.4.

r = run([dex2jar, fname, '-f', '-o', new_jar], cwd=self.name, capture_output=True)

if r.returncode != 0:
    stderr = r.stderr.decode()
    print("dex2jar failed: ", stderr)
    return

Changes available in my fork.

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

No branches or pull requests

4 participants