apkToJava 1.1 → 1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/README.md +36 -13
- data/lib/apk_to_java.rb +13 -13
- data/lib/apk_to_java/linux_setup.rb +11 -3
- data/lib/apk_to_java/mac_setup.rb +17 -4
- data/lib/apk_to_java/setup.rb +10 -0
- data/lib/apk_to_java/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 444b60d60c2095a28e673463eed4827327d34724
|
4
|
+
data.tar.gz: 004d1e06ad2c0e7e3e94c4c94723155aca423b1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b98d4de3776baab98dbdfa328465c0b436ff09eb21aa08e2ec61e91c5699037efb6b68709310248c623358406bd17c5d374f3e2aad742bd299a67ef88cfa508
|
7
|
+
data.tar.gz: 70bf658562492e7c93104e79e094b2273f392777bf5d9ee37eeca563e78fef9c864e46a308c60badea5a87c7e85ae42bdb7695f41286bfcbb53893a684d98ee2
|
data/.gitignore
ADDED
data/README.md
CHANGED
@@ -9,19 +9,28 @@ If not it downloads the required tools and continues with the process.
|
|
9
9
|
## Documentation
|
10
10
|
http://www.singhajit.com/convert-apk-file-to-java-code/
|
11
11
|
|
12
|
+
## Demo Video
|
13
|
+
[![IMAGE ALT TEXT](http://img.youtube.com/vi/YDWg-bgsAfc/0.jpg)](https://www.youtube.com/watch?v=YDWg-bgsAfc "Demo")
|
14
|
+
|
12
15
|
## Installation
|
13
16
|
|
14
|
-
```
|
17
|
+
```shell
|
18
|
+
gem install apkToJava
|
19
|
+
```
|
15
20
|
|
16
21
|
## Usage
|
17
22
|
|
18
23
|
Below command will install the required tools for ```apkToJava``` to work
|
19
24
|
|
20
|
-
```
|
25
|
+
```shell
|
26
|
+
apkToJava setup
|
27
|
+
```
|
21
28
|
|
22
29
|
Below command will process the apk file and open the code in jadx gui
|
23
30
|
|
24
|
-
```
|
31
|
+
```shell
|
32
|
+
apkToJava path/to/apk/file.apk
|
33
|
+
```
|
25
34
|
|
26
35
|
## Supported Operatiing Systems
|
27
36
|
- Mac
|
@@ -30,13 +39,27 @@ Below command will process the apk file and open the code in jadx gui
|
|
30
39
|
## Todo
|
31
40
|
Add Windows support
|
32
41
|
|
33
|
-
##
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
42
|
+
## License
|
43
|
+
```LICENSE
|
44
|
+
The MIT License (MIT)
|
45
|
+
|
46
|
+
Copyright (c) 2016 Ajit Singh
|
47
|
+
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
49
|
+
of this software and associated documentation files (the "Software"), to deal
|
50
|
+
in the Software without restriction, including without limitation the rights
|
51
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
52
|
+
copies of the Software, and to permit persons to whom the Software is
|
53
|
+
furnished to do so, subject to the following conditions:
|
54
|
+
|
55
|
+
The above copyright notice and this permission notice shall be included in all
|
56
|
+
copies or substantial portions of the Software.
|
57
|
+
|
58
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
59
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
60
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
61
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
62
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
63
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
64
|
+
SOFTWARE.
|
65
|
+
```
|
data/lib/apk_to_java.rb
CHANGED
@@ -15,14 +15,14 @@ module ApkToJava
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def initialize_setup
|
18
|
-
print_info(
|
18
|
+
print_info('Initializing setup!!')
|
19
19
|
os = supported_os
|
20
20
|
if !os.nil?
|
21
|
-
os.install_dex2jar
|
22
|
-
os.install_jadx
|
23
|
-
print_success(
|
21
|
+
os.install_dex2jar unless os.dex_to_jar_installed?
|
22
|
+
os.install_jadx unless os.jadx_installed?
|
23
|
+
print_success('Setup done :)')
|
24
24
|
else
|
25
|
-
print_error
|
25
|
+
print_error 'Sorry! apkToJava supports only MAC and Linux'
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -58,9 +58,9 @@ module ApkToJava
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def clean_up
|
61
|
-
print_info
|
61
|
+
print_info 'Cleaning the mess..'
|
62
62
|
`rm -rf #{TEMP_DIR}`
|
63
|
-
print_success
|
63
|
+
print_success 'done!'
|
64
64
|
end
|
65
65
|
|
66
66
|
def open_code_in_gui(jar_file)
|
@@ -68,27 +68,27 @@ module ApkToJava
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def convert_to_dex(apk)
|
71
|
-
print_info
|
71
|
+
print_info 'Converting to dex..'
|
72
72
|
copy_apk apk
|
73
73
|
apk_name = apk.split('/').last.split('.').first
|
74
74
|
unzip apk_name
|
75
|
-
print_success
|
75
|
+
print_success 'Done!'
|
76
76
|
path_to_dex
|
77
77
|
end
|
78
78
|
|
79
79
|
def dex_to_jar(apk)
|
80
80
|
dex_file = convert_to_dex apk
|
81
|
-
print_info
|
81
|
+
print_info 'Converting dex to jar..'
|
82
82
|
create_jar dex_file
|
83
|
-
print_success
|
83
|
+
print_success 'Done!'
|
84
84
|
path_to_jar
|
85
85
|
end
|
86
86
|
|
87
87
|
def view_as_java_code(apk)
|
88
88
|
jar_file = dex_to_jar apk
|
89
89
|
clean_up
|
90
|
-
print_info
|
91
|
-
print_success
|
90
|
+
print_info 'Opening in gui interface..'
|
91
|
+
print_success 'Please be patient, apkToJava might take some time to load your project in gui interface'
|
92
92
|
open_code_in_gui jar_file
|
93
93
|
end
|
94
94
|
end
|
@@ -5,7 +5,7 @@ module ApkToJava
|
|
5
5
|
JADX = '/lib/jadx/bin/jadx-gui'
|
6
6
|
|
7
7
|
def dex2jar
|
8
|
-
|
8
|
+
'sudo sh ' + DEX_TO_JAR
|
9
9
|
end
|
10
10
|
|
11
11
|
def jadx
|
@@ -17,13 +17,21 @@ module ApkToJava
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def install_dex2jar
|
20
|
-
|
20
|
+
unless wget_present?
|
21
|
+
print_error 'Please install wget and try again..'
|
22
|
+
exit 1
|
23
|
+
end
|
24
|
+
print_info('Installing dex2jar..')
|
21
25
|
`cd /lib && sudo #{download_dex2jar} && cd -`
|
22
26
|
print_success "Done!"
|
23
27
|
end
|
24
28
|
|
25
29
|
def install_jadx
|
26
|
-
|
30
|
+
unless wget_present?
|
31
|
+
print_error 'Please install wget and try again..'
|
32
|
+
exit 1
|
33
|
+
end
|
34
|
+
print_info('Installing jadx..')
|
27
35
|
`cd /lib && sudo #{download_jadx} && cd -`
|
28
36
|
print_success "Done!"
|
29
37
|
end
|
@@ -6,10 +6,11 @@ module ApkToJava
|
|
6
6
|
JADX = '/usr/local/Cellar/jadx/bin/jadx-gui'
|
7
7
|
|
8
8
|
def install_dex2jar
|
9
|
-
|
9
|
+
install_curl unless curl_present?
|
10
|
+
print_info('Installing dex2jar..')
|
10
11
|
`ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null`
|
11
12
|
`brew install dex2jar`
|
12
|
-
print_success
|
13
|
+
print_success 'Done!'
|
13
14
|
end
|
14
15
|
|
15
16
|
def dex2jar
|
@@ -21,9 +22,21 @@ module ApkToJava
|
|
21
22
|
end
|
22
23
|
|
23
24
|
def install_jadx
|
24
|
-
|
25
|
+
install_wget unless wget_present?
|
26
|
+
print_info('Installing jadx..')
|
25
27
|
`cd /usr/local/Cellar && #{download_jadx} && cd -`
|
26
|
-
print_success
|
28
|
+
print_success 'Done!'
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
def install_wget
|
33
|
+
print_info('Installing wget..')
|
34
|
+
`brew install wget`
|
35
|
+
end
|
36
|
+
|
37
|
+
def install_curl
|
38
|
+
print_info('Installing curl..')
|
39
|
+
`brew install curl`
|
27
40
|
end
|
28
41
|
end
|
29
42
|
end
|
data/lib/apk_to_java/setup.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'mkmf'
|
2
|
+
|
1
3
|
module ApkToJava
|
2
4
|
class Setup
|
3
5
|
JADX_URL = "'https://drive.google.com/uc?id=0BxXHKToe2BBtMGZMQXR5NFhGSUE&export=download'"
|
@@ -17,5 +19,13 @@ module ApkToJava
|
|
17
19
|
def env_setup?
|
18
20
|
dex_to_jar_installed? && jadx_installed?
|
19
21
|
end
|
22
|
+
|
23
|
+
def wget_present?
|
24
|
+
!find_executable('wget').nil?
|
25
|
+
end
|
26
|
+
|
27
|
+
def curl_present?
|
28
|
+
!find_executable('curl').nil?
|
29
|
+
end
|
20
30
|
end
|
21
31
|
end
|
data/lib/apk_to_java/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apkToJava
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ajit Singh
|
@@ -17,6 +17,7 @@ executables:
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- ".gitignore"
|
20
21
|
- LICENSE.txt
|
21
22
|
- README.md
|
22
23
|
- apkToJava.gemspec
|
@@ -48,7 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
49
|
version: '0'
|
49
50
|
requirements: []
|
50
51
|
rubyforge_project:
|
51
|
-
rubygems_version: 2.
|
52
|
+
rubygems_version: 2.6.7
|
52
53
|
signing_key:
|
53
54
|
specification_version: 4
|
54
55
|
summary: View android apk as java code in GUI
|