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

Hardcoded dex2jar version #7

Open
Mr-TWX opened this issue Oct 21, 2022 · 0 comments
Open

Hardcoded dex2jar version #7

Mr-TWX opened this issue Oct 21, 2022 · 0 comments

Comments

@Mr-TWX
Copy link

Mr-TWX commented Oct 21, 2022

Hi @ajitsing , thanks for this Gem

Issue

I've tried to run it on MacOs and found and received the following error

user@MacBook-Pro-di-User ~ % apkToJava /Users/myuser/Desktop/base.apk
Initializing setup!!
checking for curl... yes
Installing dex2jar..
Warning: dex2jar 2.1 is already installed and up-to-date.
To reinstall 2.1, run:
  brew reinstall dex2jar
Done!
Setup done :)
Converting to dex..
Done!
Converting dex to jar..
/Users/myuser/.gem/ruby/2.6.0/gems/apkToJava-1.3.1/lib/apk_to_java.rb:53:in ``': No such file or directory - /usr/local/Cellar/dex2jar/2.0/bin/d2j-dex2jar (Errno::ENOENT)
	from /Users/myuser/.gem/ruby/2.6.0/gems/apkToJava-1.3.1/lib/apk_to_java.rb:53:in `create_jar'
	from /Users/myuser/.gem/ruby/2.6.0/gems/apkToJava-1.3.1/lib/apk_to_java.rb:82:in `dex_to_jar'
	from /Users/myuser/.gem/ruby/2.6.0/gems/apkToJava-1.3.1/lib/apk_to_java.rb:88:in `view_as_java_code'
	from /Users/myuser/.gem/ruby/2.6.0/gems/apkToJava-1.3.1/bin/apkToJava:61:in `execute'
	from /Users/myuser/.gem/ruby/2.6.0/gems/apkToJava-1.3.1/bin/apkToJava:65:in `<top (required)>'
	from /Users/myuser/gems/bin/apkToJava:23:in `load'
	from /Users/myuser/gems/bin/apkToJava:23:in `<main>'

Cause

Looking at the source code for mac_setup.rb, the DEX_TO_JARconstant is hardcoded to the 2.0 version.

Since the latest version available is 2.1, the error above is thrown.

Possible solutions

At the moment, I've managed to fix the issue by changing the mac_setup.rb file by updating the hardcoded reference from 2.0 to 2.1.

It would be nicer to have the apkToJava to automatically use the latest version of dex2jar

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

1 participant