apk 0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +18 -0
- data/.rspec +2 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +30 -0
- data/README.md +9 -0
- data/Rakefile +5 -0
- data/apk.gemspec +21 -0
- data/bin/apk +6 -0
- data/lib/apk.rb +17 -0
- data/lib/apk/aapt.rb +26 -0
- data/lib/apk/version.rb +3 -0
- data/lib/binaries/aapt +0 -0
- data/spec/spec_helper.rb +17 -0
- metadata +18 -21
data/.gitignore
ADDED
data/.rspec
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
apk (0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://rubygems.org/
|
8
|
+
specs:
|
9
|
+
ZenTest (4.8.2)
|
10
|
+
autotest (4.4.6)
|
11
|
+
ZenTest (>= 4.4.1)
|
12
|
+
diff-lcs (1.1.3)
|
13
|
+
rake (0.9.2.2)
|
14
|
+
rspec (2.11.0)
|
15
|
+
rspec-core (~> 2.11.0)
|
16
|
+
rspec-expectations (~> 2.11.0)
|
17
|
+
rspec-mocks (~> 2.11.0)
|
18
|
+
rspec-core (2.11.1)
|
19
|
+
rspec-expectations (2.11.2)
|
20
|
+
diff-lcs (~> 1.1.3)
|
21
|
+
rspec-mocks (2.11.1)
|
22
|
+
|
23
|
+
PLATFORMS
|
24
|
+
ruby
|
25
|
+
|
26
|
+
DEPENDENCIES
|
27
|
+
apk!
|
28
|
+
autotest
|
29
|
+
rake
|
30
|
+
rspec
|
data/README.md
CHANGED
data/Rakefile
ADDED
data/apk.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require File.dirname(__FILE__) + "/lib/apk/version"
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = "apk"
|
5
|
+
s.version = APK::VERSION
|
6
|
+
s.date = Date.today.to_s
|
7
|
+
s.authors = ["Cedric Fung"]
|
8
|
+
s.email = ["wolfplanet@gmail.com"]
|
9
|
+
s.summary = "A simple Android APK parser"
|
10
|
+
s.description = "Get Android APK's label, features, api, icon, and other information"
|
11
|
+
s.homepage = "http://github.com/abitno/ruby-apk"
|
12
|
+
s.extra_rdoc_files = ["README.md"]
|
13
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
+
|
18
|
+
s.add_development_dependency "rake"
|
19
|
+
s.add_development_dependency "rspec"
|
20
|
+
s.add_development_dependency "autotest"
|
21
|
+
end
|
data/bin/apk
ADDED
data/lib/apk.rb
ADDED
data/lib/apk/aapt.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
class APK
|
2
|
+
class AAPT
|
3
|
+
@@aapt = File.dirname(__FILE__) + "/../binaries/aapt"
|
4
|
+
attr_reader :apk
|
5
|
+
|
6
|
+
def initialize(apk_path)
|
7
|
+
@apk = apk_path
|
8
|
+
end
|
9
|
+
|
10
|
+
def aapt(commands)
|
11
|
+
`#{@@aapt} #{commands} #{@apk}`
|
12
|
+
end
|
13
|
+
|
14
|
+
def dump
|
15
|
+
attrs = {}
|
16
|
+
info = aapt('dump badging')
|
17
|
+
package = info.match(/package:\s*(.*)/)[1]
|
18
|
+
attrs[:name] = package.match(/name='(\S*)'/)[1]
|
19
|
+
attrs[:version_code] = package.match(/versionCode='(\S*)'/)[1]
|
20
|
+
attrs[:version_name] = package.match(/versionName='(\S*)'/)[1]
|
21
|
+
attrs[:label] = info.match(/application-label:\s*'(\S*)'/)[1]
|
22
|
+
attrs
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
data/lib/apk/version.rb
ADDED
data/lib/binaries/aapt
ADDED
Binary file
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# Require this file using `require "spec_helper"` to ensure that it is only
|
4
|
+
# loaded once.
|
5
|
+
#
|
6
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
7
|
+
RSpec.configure do |config|
|
8
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
9
|
+
config.run_all_when_everything_filtered = true
|
10
|
+
config.filter_run :focus
|
11
|
+
|
12
|
+
# Run specs in random order to surface order dependencies. If you find an
|
13
|
+
# order dependency and want to debug it, you can fix the order by providing
|
14
|
+
# the seed, which is printed after each run.
|
15
|
+
# --seed 1234
|
16
|
+
config.order = 'random'
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -59,31 +59,28 @@ dependencies:
|
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
-
|
63
|
-
name: growl-glue
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ! '>='
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
|
-
type: :development
|
71
|
-
prerelease: false
|
72
|
-
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ! '>='
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '0'
|
78
|
-
description: Get Android apk's label, features, api, icon, and other information
|
62
|
+
description: Get Android APK's label, features, api, icon, and other information
|
79
63
|
email:
|
80
64
|
- wolfplanet@gmail.com
|
81
|
-
executables:
|
65
|
+
executables:
|
66
|
+
- apk
|
82
67
|
extensions: []
|
83
68
|
extra_rdoc_files:
|
84
69
|
- README.md
|
85
70
|
files:
|
71
|
+
- .gitignore
|
72
|
+
- .rspec
|
73
|
+
- Gemfile
|
74
|
+
- Gemfile.lock
|
86
75
|
- README.md
|
76
|
+
- Rakefile
|
77
|
+
- apk.gemspec
|
78
|
+
- bin/apk
|
79
|
+
- lib/apk.rb
|
80
|
+
- lib/apk/aapt.rb
|
81
|
+
- lib/apk/version.rb
|
82
|
+
- lib/binaries/aapt
|
83
|
+
- spec/spec_helper.rb
|
87
84
|
homepage: http://github.com/abitno/ruby-apk
|
88
85
|
licenses: []
|
89
86
|
post_install_message:
|
@@ -108,6 +105,6 @@ rubyforge_project:
|
|
108
105
|
rubygems_version: 1.8.24
|
109
106
|
signing_key:
|
110
107
|
specification_version: 3
|
111
|
-
summary: A simple Android
|
108
|
+
summary: A simple Android APK parser
|
112
109
|
test_files: []
|
113
110
|
has_rdoc:
|