idevice 1.1.5.5 → 1.1.5.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MWMwMTkyNmExNWI5OTIyMzEzMjE2OGYyYWMzZTg1YmNiNzNjM2Y2Mw==
5
+ data.tar.gz: !binary |-
6
+ MDA4NDRkYjc4YzVlYzNlZTI4ZTA3YmU4ZTZjZGZjMTAzOWUwYWM1ZA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ OWY5NjZjNzIzYWEwMjRkNTViZmNiNTYxZjdmNjQ3M2E1NmM2ZDU0MGZhYjEy
10
+ YjBmN2E1ZmVjMjdkYzNiNGVjZmQ2Zjk1NWQ2OTg5ODAxNDkzNTA5OTA2NjA3
11
+ ODcyMzQzZGIzZGE1ZWVjYjliNzAxNDQzNzI0ZjQyNWVmZGZkMWY=
12
+ data.tar.gz: !binary |-
13
+ ODJjOGE3NzBhNTk5ZWNjODk5M2ViMTU4NDVlOGRkNWVmMmE3Y2MxOTUxOTU2
14
+ NTg2YWFmMTM0ZDBjNmFkZjBiYjllMzNjNzE4MTVmZWMyMDM1MDRhMTkwZWM1
15
+ YTE4ZjQ0OWQxOWM4OTgzM2VlNGVhZjcwZDE1NWEyN2ExMTA4NjY=
data/lib/idevice/afc.rb CHANGED
@@ -22,6 +22,7 @@ require 'idevice/c'
22
22
  require 'idevice/idevice'
23
23
  require 'idevice/lockdown'
24
24
  require 'idevice/house_arrest'
25
+ require 'pathname'
25
26
 
26
27
  module Idevice
27
28
  class AFCError < IdeviceLibError
@@ -189,8 +190,52 @@ module Idevice
189
190
  return info[:st_birthtime]
190
191
  end
191
192
 
192
- def put_path(frompath, topath, chunksz=nil)
193
- chunksz ||= AFC_DEFAULT_CHUNKSIZE
193
+ # puts files recursively from the local machine to the remove idevice.
194
+ # topath should be a directory that exists on the remote device or '.'
195
+ # for the top-level directory.
196
+ # opts are passed as-is back to put_path (allowing :chunksize or other options to be set).
197
+ # opts[:recurse] will be ignored.
198
+ def put_recursively(frompath, topath, opts={})
199
+ frompath = Pathname(frompath)
200
+ opts = opts.dup
201
+ opts.delete(:recurse)
202
+
203
+ if frompath.directory?
204
+ # remove trailing slash(es)
205
+ while topath[-1] == '/'
206
+ topath = topath[0..-2]
207
+ end
208
+
209
+ base_frompath = Pathname(File.basename(frompath.expand_path))
210
+ self.mkdir("#{topath}/#{base_frompath.basename}") rescue nil
211
+
212
+ Dir[frompath.join("**", "*")].each do |rpath|
213
+ rtopath = "#{topath}/#{Pathname(rpath).relative_path_from(frompath.dirname)}"
214
+ if File.directory?(rpath)
215
+ self.mkdir(rtopath)
216
+ else
217
+ self.put_path(rpath, rtopath, opts)
218
+ end
219
+ end
220
+ else
221
+ return self.put_path(frompath, topath, opts)
222
+ end
223
+ end
224
+
225
+ # supported options:
226
+ # chunksize: (Integer) chunksize for file transfer
227
+ # recurse: (Boolean) if true, will recursively transfer using put_recursively
228
+ def put_path(frompath, topath, opts={})
229
+ opts = opts.dup
230
+ chunksz = opts[:chunksize] || AFC_DEFAULT_CHUNKSIZE
231
+ recurse = opts.delete(:recurse)
232
+
233
+ return put_recursively(frompath, topath, opts) if recurse
234
+
235
+ if File.directory?(frompath)
236
+ raise ArgumentError, "#{frompath.inspect} is a directory and can only be put on the device using the 'recurse: true' option)"
237
+ end
238
+
194
239
  wlen = 0
195
240
 
196
241
  File.open(frompath, 'r') do |from|
@@ -1,3 +1,3 @@
1
1
  module Idevice
2
- VERSION = "1.1.5.5"
2
+ VERSION = "1.1.5.8"
3
3
  end
@@ -208,7 +208,7 @@ describe Idevice::AFCClient do
208
208
 
209
209
  begin
210
210
  gotblock=false
211
- @afc.put_path(@fromfile.to_s, remotepath, 2) do |chunksz|
211
+ @afc.put_path(@fromfile.to_s, remotepath, chunksize: 2) do |chunksz|
212
212
  gotblock=true
213
213
  (0..2).should include(chunksz)
214
214
  end.should == @fromfile.size
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idevice
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5.5
5
- prerelease:
4
+ version: 1.1.5.8
6
5
  platform: ruby
7
6
  authors:
8
7
  - Eric Monti
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-12-19 00:00:00.000000000 Z
11
+ date: 2014-01-08 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: ffi
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: plist
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: bundler
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rake
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ! '>='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ! '>='
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rspec
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ! '>='
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ! '>='
92
81
  - !ruby/object:Gem::Version
@@ -94,7 +83,6 @@ dependencies:
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: pry
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ! '>='
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ! '>='
108
95
  - !ruby/object:Gem::Version
@@ -180,33 +167,26 @@ files:
180
167
  homepage: https://github.com/blueboxsecurity/idevice
181
168
  licenses:
182
169
  - Apache License, Version 2.0
170
+ metadata: {}
183
171
  post_install_message:
184
172
  rdoc_options: []
185
173
  require_paths:
186
174
  - lib
187
175
  required_ruby_version: !ruby/object:Gem::Requirement
188
- none: false
189
176
  requirements:
190
177
  - - ! '>='
191
178
  - !ruby/object:Gem::Version
192
179
  version: '0'
193
- segments:
194
- - 0
195
- hash: 3300865769966044297
196
180
  required_rubygems_version: !ruby/object:Gem::Requirement
197
- none: false
198
181
  requirements:
199
182
  - - ! '>='
200
183
  - !ruby/object:Gem::Version
201
184
  version: '0'
202
- segments:
203
- - 0
204
- hash: 3300865769966044297
205
185
  requirements: []
206
186
  rubyforge_project:
207
- rubygems_version: 1.8.25
187
+ rubygems_version: 2.2.1
208
188
  signing_key:
209
- specification_version: 3
189
+ specification_version: 4
210
190
  summary: Ruby FFI bindings for libimobiledevice. The ruby Idevice library was written
211
191
  primarily as a research tool for prototyping iOS tools that use USB as well as a
212
192
  tool to aid in reverse-engineering new areas of the iOS USB protocols.