dryrun 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dryrun.rb +2 -2
- data/lib/dryrun/android_project.rb +17 -7
- data/lib/dryrun/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31a7a350f5f35e5214aad6a9cff0b5ca61cf0331
|
4
|
+
data.tar.gz: 9415dd1e35bbbc086a14439b0fc9eabf7a18ba51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 936abaf3c71d7c2097065fcb0bef60a3e6b7eedcf70bc8d23662e8f30f6e602a93d6885f3ecdc6020e1cb952a7226a2efbce4b86c6ef1386f9529c59f70010ff
|
7
|
+
data.tar.gz: 6ca7768fbfa671b5e3b90c434f4787d767854784c2b5b74a041e2e379c038b35bc8f6837833c8c84c86ef436b14f1706c5e36912d7343be2042af387e50d205a
|
data/lib/dryrun.rb
CHANGED
@@ -11,7 +11,7 @@ module DryRun
|
|
11
11
|
def initialize(arguments)
|
12
12
|
|
13
13
|
@url = ['-h', '--help', '-v', '--version'].include?(arguments.first) ? nil : arguments.shift
|
14
|
-
|
14
|
+
|
15
15
|
# defaults
|
16
16
|
@app_path = nil
|
17
17
|
@custom_module = nil
|
@@ -102,7 +102,7 @@ module DryRun
|
|
102
102
|
# clean and install the apk
|
103
103
|
android_project.install
|
104
104
|
|
105
|
-
puts "\n> If you want to remove the app you just installed, execute:\n#{android_project.get_uninstall_command.
|
105
|
+
puts "\n> If you want to remove the app you just installed, execute:\n#{android_project.get_uninstall_command.yellow}\n\n"
|
106
106
|
end
|
107
107
|
end
|
108
108
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'oga'
|
2
2
|
require 'fileutils'
|
3
3
|
require 'tempfile'
|
4
|
+
require 'find'
|
4
5
|
require_relative 'dryrun_utils'
|
5
6
|
|
6
7
|
module DryRun
|
@@ -152,15 +153,13 @@ module DryRun
|
|
152
153
|
end
|
153
154
|
|
154
155
|
def get_execution_line_command(path_to_sample)
|
155
|
-
|
156
|
+
manifest_file = get_manifest(path_to_sample)
|
156
157
|
|
157
|
-
if
|
158
|
+
if manifest_file.nil?
|
158
159
|
return false
|
159
160
|
end
|
160
161
|
|
161
|
-
|
162
|
-
|
163
|
-
doc = Oga.parse_xml(f)
|
162
|
+
doc = Oga.parse_xml(manifest_file)
|
164
163
|
|
165
164
|
@package = get_package(doc)
|
166
165
|
@launcher_activity = get_launcher_activity(doc)
|
@@ -169,11 +168,22 @@ module DryRun
|
|
169
168
|
return false
|
170
169
|
end
|
171
170
|
|
172
|
-
|
171
|
+
manifest_file.close
|
173
172
|
|
174
173
|
"adb shell am start -n \"#{get_launchable_activity}\" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER"
|
175
174
|
end
|
176
175
|
|
176
|
+
def get_manifest(path_to_sample)
|
177
|
+
default_path = File.join(path_to_sample, 'src/main/AndroidManifest.xml')
|
178
|
+
if File.exist?(default_path)
|
179
|
+
return File.open(default_path)
|
180
|
+
else
|
181
|
+
Find.find(path_to_sample) do |path|
|
182
|
+
return File.open(path) if path =~ /.*AndroidManifest.xml$/
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
177
187
|
def get_launchable_activity
|
178
188
|
full_path_to_launcher = "#{@package}#{@launcher_activity.gsub(@package,'')}"
|
179
189
|
"#{@package}/#{full_path_to_launcher}"
|
@@ -189,7 +199,7 @@ module DryRun
|
|
189
199
|
intent_filter = child.css('intent-filter')
|
190
200
|
|
191
201
|
if intent_filter != nil and intent_filter.length != 0
|
192
|
-
return child.
|
202
|
+
return child.attr("android:name").value
|
193
203
|
end
|
194
204
|
end
|
195
205
|
false
|
data/lib/dryrun/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dryrun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cesar ferreira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|