app_parser 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.3
4
+ before_install: gem install bundler -v 1.10.6
5
+ script: bundle exec rspec spec
6
+
7
+ addons:
8
+ code_climate:
9
+ repo_token: e7fe2c6792c9939a7db0162fb13e7b0c43817368772cd5dde327db5f83e3705b
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in app_parser.gemspec
4
+ gemspec
5
+
6
+ group :guard do
7
+ gem "guard-rspec"
8
+ gem "guard-bundler"
9
+ gem "rb-fsevent"
10
+ end
11
+
12
+ gem "codeclimate-test-reporter", group: :test, require: nil
@@ -0,0 +1,111 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ app_parser (0.1.0)
5
+ CFPropertyList
6
+ activesupport
7
+ image_size
8
+ pngdefry
9
+ ruby_android
10
+ rubyzip
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ CFPropertyList (2.3.2)
16
+ activesupport (4.2.5.1)
17
+ i18n (~> 0.7)
18
+ json (~> 1.7, >= 1.7.7)
19
+ minitest (~> 5.1)
20
+ thread_safe (~> 0.3, >= 0.3.4)
21
+ tzinfo (~> 1.1)
22
+ codeclimate-test-reporter (0.4.8)
23
+ simplecov (>= 0.7.1, < 1.0.0)
24
+ coderay (1.1.0)
25
+ diff-lcs (1.2.5)
26
+ docile (1.1.5)
27
+ ffi (1.9.10)
28
+ formatador (0.2.5)
29
+ guard (2.13.0)
30
+ formatador (>= 0.2.4)
31
+ listen (>= 2.7, <= 4.0)
32
+ lumberjack (~> 1.0)
33
+ nenv (~> 0.1)
34
+ notiffany (~> 0.0)
35
+ pry (>= 0.9.12)
36
+ shellany (~> 0.0)
37
+ thor (>= 0.18.1)
38
+ guard-bundler (2.1.0)
39
+ bundler (~> 1.0)
40
+ guard (~> 2.2)
41
+ guard-compat (~> 1.1)
42
+ guard-compat (1.2.1)
43
+ guard-rspec (4.6.4)
44
+ guard (~> 2.1)
45
+ guard-compat (~> 1.1)
46
+ rspec (>= 2.99.0, < 4.0)
47
+ i18n (0.7.0)
48
+ image_size (1.4.1)
49
+ json (1.8.3)
50
+ listen (3.0.5)
51
+ rb-fsevent (>= 0.9.3)
52
+ rb-inotify (>= 0.9)
53
+ lumberjack (1.0.10)
54
+ method_source (0.8.2)
55
+ minitest (5.8.4)
56
+ nenv (0.2.0)
57
+ notiffany (0.0.8)
58
+ nenv (~> 0.1)
59
+ shellany (~> 0.0)
60
+ pngdefry (0.1.2)
61
+ pry (0.10.3)
62
+ coderay (~> 1.1.0)
63
+ method_source (~> 0.8.1)
64
+ slop (~> 3.4)
65
+ rake (10.5.0)
66
+ rb-fsevent (0.9.7)
67
+ rb-inotify (0.9.5)
68
+ ffi (>= 0.5.0)
69
+ rspec (3.4.0)
70
+ rspec-core (~> 3.4.0)
71
+ rspec-expectations (~> 3.4.0)
72
+ rspec-mocks (~> 3.4.0)
73
+ rspec-core (3.4.1)
74
+ rspec-support (~> 3.4.0)
75
+ rspec-expectations (3.4.0)
76
+ diff-lcs (>= 1.2.0, < 2.0)
77
+ rspec-support (~> 3.4.0)
78
+ rspec-mocks (3.4.1)
79
+ diff-lcs (>= 1.2.0, < 2.0)
80
+ rspec-support (~> 3.4.0)
81
+ rspec-support (3.4.1)
82
+ ruby_android (0.7.7)
83
+ rubyzip (>= 1.1.6)
84
+ rubyzip (1.1.7)
85
+ shellany (0.0.1)
86
+ simplecov (0.11.2)
87
+ docile (~> 1.1.0)
88
+ json (~> 1.8)
89
+ simplecov-html (~> 0.10.0)
90
+ simplecov-html (0.10.0)
91
+ slop (3.6.0)
92
+ thor (0.19.1)
93
+ thread_safe (0.3.5)
94
+ tzinfo (1.2.2)
95
+ thread_safe (~> 0.1)
96
+
97
+ PLATFORMS
98
+ ruby
99
+
100
+ DEPENDENCIES
101
+ app_parser!
102
+ bundler (~> 1.10)
103
+ codeclimate-test-reporter
104
+ guard-bundler
105
+ guard-rspec
106
+ rake (~> 10.0)
107
+ rb-fsevent
108
+ rspec (>= 3.4.0)
109
+
110
+ BUNDLED WITH
111
+ 1.10.6
@@ -0,0 +1,82 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ guard :bundler do
19
+ require "guard/bundler"
20
+ require "guard/bundler/verify"
21
+ helper = Guard::Bundler::Verify.new
22
+
23
+ files = ["Gemfile"]
24
+ files += Dir["*.gemspec"] if files.any? { |f| helper.uses_gemspec?(f) }
25
+
26
+ # Assume files are symlinked from somewhere
27
+ files.each { |file| watch(helper.real_path(file)) }
28
+ end
29
+
30
+ # Note: The cmd option is now required due to the increasing number of ways
31
+ # rspec may be run, below are examples of the most common uses.
32
+ # * bundler: 'bundle exec rspec'
33
+ # * bundler binstubs: 'bin/rspec'
34
+ # * spring: 'bin/rspec' (This will use spring if running and you have
35
+ # installed the spring binstubs per the docs)
36
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
37
+ # * 'just' rspec: 'rspec'
38
+
39
+ guard :rspec, cmd: "bundle exec rspec" do
40
+ require "guard/rspec/dsl"
41
+ dsl = Guard::RSpec::Dsl.new(self)
42
+
43
+ # Feel free to open issues for suggestions and improvements
44
+
45
+ # RSpec files
46
+ rspec = dsl.rspec
47
+ watch(rspec.spec_helper) { rspec.spec_dir }
48
+ watch(rspec.spec_support) { rspec.spec_dir }
49
+ watch(rspec.spec_files)
50
+
51
+ # Ruby files
52
+ ruby = dsl.ruby
53
+ dsl.watch_spec_files_for(ruby.lib_files)
54
+
55
+ # Rails files
56
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
57
+ dsl.watch_spec_files_for(rails.app_files)
58
+ dsl.watch_spec_files_for(rails.views)
59
+
60
+ watch(rails.controllers) do |m|
61
+ [
62
+ rspec.spec.call("routing/#{m[1]}_routing"),
63
+ rspec.spec.call("controllers/#{m[1]}_controller"),
64
+ rspec.spec.call("acceptance/#{m[1]}")
65
+ ]
66
+ end
67
+
68
+ # Rails config changes
69
+ watch(rails.spec_helper) { rspec.spec_dir }
70
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
71
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
72
+
73
+ # Capybara features specs
74
+ watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
75
+ watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
76
+
77
+ # Turnip features and steps
78
+ watch(%r{^spec/acceptance/(.+)\.feature$})
79
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
80
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
81
+ end
82
+ end
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 tkycule
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,126 @@
1
+ # AppParser
2
+
3
+ [![Build Status](https://travis-ci.org/tkycule/app_parser.svg?branch=master)](https://travis-ci.org/tkycule/app_parser)
4
+ [![Code Climate](https://codeclimate.com/github/tkycule/app_parser/badges/gpa.svg)](https://codeclimate.com/github/tkycule/app_parser)
5
+ [![Test Coverage](https://codeclimate.com/github/tkycule/app_parser/badges/coverage.svg)](https://codeclimate.com/github/tkycule/app_parser/coverage)
6
+
7
+ Analysis tool for iOS ipa and Android apk.
8
+
9
+ ## Installation
10
+
11
+ $ gem install app_parser
12
+
13
+ ## USAGE
14
+
15
+ ### iOS ipa
16
+
17
+ irb > require "app_parser"
18
+ => true
19
+
20
+ irb > ipa = AppParser.parse("/path/to/file.ipa")
21
+ irb > ipa.class
22
+ => AppParser::Ipa
23
+
24
+ irb > ipa.os
25
+ => "ios"
26
+
27
+ irb > ipa.version # CFBundleVersion
28
+ => "1"
29
+
30
+ irb> ipa.version_string # CFBundleShortVersionString
31
+ => "1.0"
32
+
33
+ irb > ipa.display_name # CFBundleShortVersionString or CFBundleName
34
+ => "AppParserTest"
35
+
36
+ irb > ipa.bundle_id # CFBundleIdentifier
37
+ => "com.gmail.tkycule.AppParserTest"
38
+
39
+ irb > ipa.provisioned_devices # ProvisionedDevices
40
+ => ["0000000000000000000000000000000000000000"]
41
+
42
+ irb > ipa.provisions_all_devices # ProvisionsAllDevices (true if In-House)
43
+ => false
44
+
45
+ irb > ipa.icons
46
+ => [{:dimensions=>[58, 58], :file_name=>"AppIcon29x29@2x.png"}, ...]
47
+
48
+ irb > ipa.iphone_icons
49
+ => [{:dimensions=>[58, 58], :file_name=>"AppIcon29x29@2x.png"}, ...]
50
+
51
+ irb > ipa.ipad_icons
52
+ => [{:dimensions=>[58, 58], :file_name=>"AppIcon29x29@2x~ipad.png"}, ...]
53
+
54
+ irb > ipa.icon(dimensions: 58)
55
+ => {:dimensions=>[58, 58], :file_name=>"AppIcon29x29@2x.png"}
56
+
57
+ irb > ipa.icon(dimensions: [58, 58])
58
+ => {:dimensions=>[58, 58], :file_name=>"AppIcon29x29@2x.png"}
59
+
60
+ irb > ipa.largest_icon
61
+ => {:dimensions=>[180, 180], :file_name=>"AppIcon60x60@3x.png"}
62
+
63
+ irb > ipa.smallest_icon
64
+ => {:dimensions=>[29, 29], :file_name=>"AppIcon29x29~ipad.png"}
65
+
66
+ irb(main):031:0> ipa.icon_data("AppIcon29x29@2x.png")
67
+ => "\x89PNG\r\n ..."
68
+
69
+ ### Android apk
70
+
71
+ irb > require "app_parser"
72
+ => true
73
+
74
+ irb > apk = AppParser.parse("/path/to/file.apk")
75
+ irb > apk.class
76
+ => AppParser::Apk
77
+
78
+ irb > apk.version # versionCode
79
+ => "1"
80
+
81
+ irb > apk.version_string # versionName
82
+ => "1.0"
83
+
84
+ irb > apk.display_name # app_name
85
+ => "AppParserTest"
86
+
87
+ irb > apk.bundle_id # package name
88
+ => "com.gmail.tkycule.AppParserTest"
89
+
90
+ irb > apk.provisioned_devices # always blank
91
+ => []
92
+
93
+ irb > apk.provisions_all_devices # always false
94
+ => false
95
+
96
+ irb > apk.icons
97
+ => [{:dimensions=>[48, 48], :file_name=>"res/mipmap-mdpi-v4/ic_launcher.png"}, ...]
98
+
99
+ irb > apk.iphone_icons # always blank
100
+ => []
101
+
102
+ irb > apk.ipad_icons # always blank
103
+ => []
104
+
105
+ irb > apk.icon(dimensions: 48)
106
+ => {:dimensions=>[48, 48], :file_name=>"res/mipmap-mdpi-v4/ic_launcher.png"}
107
+
108
+ irb > apk.icon(dimensions: [48, 48])
109
+ => {:dimensions=>[48, 48], :file_name=>"res/mipmap-mdpi-v4/ic_launcher.png"}
110
+
111
+ irb > apk.largest_icon
112
+ => {:dimensions=>[192, 192], :file_name=>"res/mipmap-xxxhdpi-v4/ic_launcher.png"}
113
+
114
+ irb > apk.smallest_icon
115
+ => {:dimensions=>[48, 48], :file_name=>"res/mipmap-mdpi-v4/ic_launcher.png"}
116
+
117
+ irb > apk.icon_data("res/mipmap-mdpi-v4/ic_launcher.png")
118
+ => "\x89PNG\r\n ..."
119
+
120
+ ## Author
121
+
122
+ [tkycule](https://github.com/tkycule)
123
+
124
+ ## Licence
125
+
126
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,32 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "app_parser/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "app_parser"
8
+ spec.version = AppParser::VERSION
9
+ spec.authors = ["tkycule"]
10
+ spec.email = ["tky.cule+github@gmail.com"]
11
+
12
+ spec.description = "Analysis tool for iOS ipa and Android apk."
13
+ spec.summary = spec.description
14
+ spec.homepage = "https://github.com/tkycule/app_parser"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.10"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "rspec", ">= 3.4.0"
25
+
26
+ spec.add_dependency "rubyzip"
27
+ spec.add_dependency "CFPropertyList"
28
+ spec.add_dependency "activesupport"
29
+ spec.add_dependency "pngdefry"
30
+ spec.add_dependency "ruby_android"
31
+ spec.add_dependency "image_size"
32
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "app_parser"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here