Giter Club home page Giter Club logo

apktojava's Introduction

apkToJava

Maintenance Gem Version HitCount Gem Downloads Open Source Love Twitter Follow

A ruby gem to view android apk as java code in GUI

Before starting the process it checks wether the env is setup or not. If not it downloads the required tools and continues with the process.

Documentation

http://www.singhajit.com/convert-apk-file-to-java-code/

Demo Video

IMAGE ALT TEXT

Installation

gem install apkToJava

Usage

Below command will install the required tools for apkToJava to work

apkToJava setup

Below command will process the apk file and open the code in jadx gui

apkToJava path/to/apk/file.apk

Supported Operatiing Systems

  • Mac
  • Linux

Todo

Add Windows support

License

The MIT License (MIT)

Copyright (c) 2016 Ajit Singh

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

apktojava's People

Contributors

ajitsing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apktojava's Issues

Hardcoded dex2jar version

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

Not working ubuntu

I am getting the following error in ubuntu

dex2jar //apkToJavaTmp/classes.dex -> classes-dex2jar.jar
java.io.FileNotFoundException: File '/apkToJavaTmp/classes.dex' does not exist
at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:56)
at org.apache.commons.io.FileUtils.readFileToByteArray(FileUtils.java:40)
at com.googlecode.dex2jar.reader.DexFileReader.(DexFileReader.java:240)
at com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Dex2jarCmd.java:104)
at com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:174)
at com.googlecode.dex2jar.tools.Dex2jarCmd.main(Dex2jarCmd.java:34)
Done!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.