idevice 1.1.6.0 → 1.1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZDgzZWIwNTkzZjg0ZTc4OWNjYmUzZWFmOTBkNGFhNDI4Mzg3Njk0YQ==
5
- data.tar.gz: !binary |-
6
- YTIzMzdkNmJhMGI0YTc4MTE0MzkxOTcwYTFmZmQ5NzViYjkxOGZjZQ==
2
+ SHA1:
3
+ metadata.gz: f503fdd0e7e3b4150930b3e77dbadf65b70d0100
4
+ data.tar.gz: b13f584e785bf58693f315942d016340e9020acf
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MDk0YTcyZmQxOTllYmIwMjNkODA2ODkyY2M4Y2NlNDUzMDg3YTZhY2I3ODYy
10
- MmNlZTMyOTEyMzhkYjk5MWNhNDg3YTE3OGMxZWE2Nzc3NDRmZTExNTcwOWE5
11
- YjkyYzdjNjg2MTQxMTcwOTI4OTNhZGQ5ODFlMjQwMTM1ZWQzNDQ=
12
- data.tar.gz: !binary |-
13
- NTJlNjQwZDQ1ZmM5NmQzNGZjNGQ3MWI2MDhiZDQwZGE2NTExYzFmMWJkYmE0
14
- Yzc3Yjk1ZmY0ODQxNGU1YTg4ZTM2MjIwOThkMzYxM2I3NWEyY2JhZTQ4MGQy
15
- MzlmYjE5ZTUyM2M0OWE0YjllY2E4YjRiMzk0NmNkNzcyYzgyODA=
6
+ metadata.gz: 5e2f2518f4dffec0d4f95bf31ef83fd9a790bc4c7c053f8ce351997807d5defa08ab6d518c1cb27058725e8cea8d1f489e7b66f7c3e9cf60ae56c04a7ef6f942
7
+ data.tar.gz: 35f02bceaa7c735dafa2a8b782a22423cd7ec11960b6f5cf046a582b1e8acdb5f6bb7a8e30e7cc20c30ccf117a99aa973b42cc9f098661d6e06981ed05d56afa
data/README.md CHANGED
@@ -36,18 +36,20 @@ Or install it yourself as:
36
36
 
37
37
  See
38
38
 
39
- - https://github.com/blueboxsecurity/idevice/tree/master/examples
40
- - https://github.com/blueboxsecurity/idevice/tree/master/spec
39
+ - https://github.com/emonti/idevice/tree/master/examples
40
+ - https://github.com/emonti/idevice/tree/master/spec
41
41
 
42
- ## Author
42
+ ## Contact
43
43
 
44
- Eric Monti - monti@bluebox.com
44
+ Eric Monti - esmonti@gmail.com (Author)
45
45
 
46
+ This code is released under the ASF license by Bluebox Security
47
+ - https://www.bluebox.com
46
48
 
47
49
  ## Issues / Contributing
48
50
 
49
51
  Please submit pull requests using github.
50
- Report issues at https://github.com/blueboxsecurity/idevice/issues
52
+ Report issues at https://github.com/emonti/idevice/issues
51
53
 
52
54
 
53
55
  ## License
@@ -15,7 +15,7 @@ The ruby Idevice library was written primarily as a research tool for
15
15
  prototyping iOS tools that use USB as well as a tool to aid in
16
16
  reverse-engineering new areas of the iOS USB protocols.
17
17
  }
18
- spec.homepage = "https://github.com/blueboxsecurity/idevice"
18
+ spec.homepage = "https://github.com/emonti/idevice"
19
19
  spec.license = "Apache License, Version 2.0"
20
20
 
21
21
  spec.files = `git ls-files`.split($/)
@@ -28,6 +28,6 @@ reverse-engineering new areas of the iOS USB protocols.
28
28
 
29
29
  spec.add_development_dependency "bundler", "~> 1.3"
30
30
  spec.add_development_dependency "rake"
31
- spec.add_development_dependency "rspec"
31
+ spec.add_development_dependency "rspec", "~> 3.0"
32
32
  spec.add_development_dependency "pry"
33
33
  end
@@ -127,9 +127,13 @@ module Idevice
127
127
  res = nil
128
128
  FFI::MemoryPointer.new(:pointer) do |p_val|
129
129
  err = C.lockdownd_get_value(self, domain, key, p_val)
130
- raise LockdownError, "Lockdownd error: #{err}" if err != :SUCCESS
131
-
132
- res = p_val.read_pointer.read_plist_t
130
+ if err == :SUCCESS
131
+ res = p_val.read_pointer.read_plist_t
132
+ elsif err == :UNKNOWN_ERROR
133
+ res = nil
134
+ else
135
+ raise LockdownError, "Lockdownd error: #{err}"
136
+ end
133
137
  end
134
138
  return res
135
139
  end
@@ -93,27 +93,25 @@ module Idevice
93
93
  return true
94
94
  end
95
95
 
96
- def observe_notification
97
- FFI::MemoryPointer.new(:pointer) do |p_notification|
98
- err = C.np_observe_notification(self, p_notification)
99
- raise NotificationProxyError, "Notification Proxy Error: #{err}" if err != :SUCCESS
96
+ def observe_notification(notification_type)
97
+ err = C.np_observe_notification(self, notification_type)
98
+ raise NotificationProxyError, "Notification Proxy Error: #{err}" if err != :SUCCESS
100
99
 
101
- notification = p_notification.read_pointer
102
- unless notification.null?
103
- ret = notification.read_string
104
- C.free(notification)
105
- return ret
106
- end
107
- end
108
100
  end
109
101
 
110
- def observe_notifications
111
- FFI::MemoryPointer.new(:pointer) do |p_notifications|
112
- err = C.np_observe_notifications(self, p_notifications)
113
- raise NotificationProxyError, "Notification Proxy Error: #{err}" if err != :SUCCESS
102
+ def observe_notifications(notification_types)
103
+ ntypes_ary = []
104
+ notification_types.each do |ntype|
105
+ ntypes_ary << FFI::MemoryPointer.from_string(ntype)
106
+ end
107
+ ntypes_ary << nil
108
+ ntypes = FFI::MemoryPointer.new(:pointer, ntypes_ary.length)
109
+ ntypes_ary.each_with_index do |p, i|
110
+ ntypes[i].put_pointer(0, p)
111
+ end
112
+ err = C.np_observe_notifications(self, ntypes)
113
+ raise NotificationProxyError, "Notification Proxy Error: #{err}" if err != :SUCCESS
114
114
 
115
- return _unbound_list_to_array(p_notifications)
116
- end
117
115
  end
118
116
 
119
117
  def set_notify_callback(&block)
@@ -1,3 +1,3 @@
1
1
  module Idevice
2
- VERSION = "1.1.6.0"
2
+ VERSION = "1.1.7.0"
3
3
  end
@@ -81,13 +81,13 @@ describe Idevice::AFCClient do
81
81
  remotepath='TOTALLYATESTFILECREATEDTEST'
82
82
 
83
83
  @afc.put_path(@fromfile.to_s, remotepath).should == @fromfile.size
84
- @afc.remove_path(remotepath).should be_true
84
+ @afc.remove_path(remotepath).should == true
85
85
  end
86
86
 
87
87
  it "should remove an (empty) directory path" do
88
88
  remotepath='TOTALLYATESTDIRCREATEDTEST'
89
- @afc.make_directory(remotepath).should be_true
90
- @afc.remove_path(remotepath).should be_true
89
+ @afc.make_directory(remotepath).should == true
90
+ @afc.remove_path(remotepath).should == true
91
91
  end
92
92
 
93
93
  it "should rename a file path" do
@@ -97,13 +97,13 @@ describe Idevice::AFCClient do
97
97
  begin
98
98
  @afc.put_path(@fromfile.to_s, remotepath).should == @fromfile.size
99
99
  originfo = @afc.file_info(remotepath)
100
- @afc.rename_path(remotepath, renamepath).should be_true
100
+ @afc.rename_path(remotepath, renamepath).should == true
101
101
  lambda{ @afc.file_info(remotepath) }.should raise_error Idevice::AFCError
102
102
  info = @afc.file_info(renamepath)
103
103
  info.should == originfo
104
104
  ensure
105
105
  @afc.remove_path(remotepath) rescue nil
106
- @afc.remove_path(renamepath).should be_true
106
+ @afc.remove_path(renamepath).should == true
107
107
  end
108
108
 
109
109
  end
@@ -112,22 +112,22 @@ describe Idevice::AFCClient do
112
112
  remotepath = 'TOTALLYATESTDIRCREATEDTEST'
113
113
  renamepath = remotepath+'2'
114
114
  begin
115
- @afc.make_directory(remotepath).should be_true
115
+ @afc.make_directory(remotepath).should == true
116
116
  originfo = @afc.file_info(remotepath)
117
- @afc.rename_path(remotepath, renamepath).should be_true
117
+ @afc.rename_path(remotepath, renamepath).should == true
118
118
  lambda{ @afc.file_info(remotepath) }.should raise_error Idevice::AFCError
119
119
  info = @afc.file_info(renamepath)
120
120
  info.should == originfo
121
121
  ensure
122
122
  @afc.remove_path(remotepath) rescue nil
123
- @afc.remove_path(renamepath).should be_true
123
+ @afc.remove_path(renamepath).should == true
124
124
  end
125
125
  end
126
126
 
127
127
  it "should make a directory" do
128
128
  remotepath = 'TOTALLYATESTDIR'
129
129
  begin
130
- @afc.make_directory(remotepath).should be_true
130
+ @afc.make_directory(remotepath).should == true
131
131
  result = @afc.file_info(remotepath)
132
132
  result[:st_ifmt].should == :S_IFDIR
133
133
  ensure
@@ -137,7 +137,7 @@ describe Idevice::AFCClient do
137
137
 
138
138
  it "should make a symbolic link to a directory" do
139
139
  begin
140
- @afc.symlink('.', 'TOTALLYATESTSYMLINKTOCURRENTDIR').should be_true
140
+ @afc.symlink('.', 'TOTALLYATESTSYMLINKTOCURRENTDIR').should == true
141
141
  result = @afc.file_info('TOTALLYATESTSYMLINKTOCURRENTDIR')
142
142
  result[:st_ifmt].should == :S_IFLNK
143
143
  ensure
@@ -150,8 +150,8 @@ describe Idevice::AFCClient do
150
150
  remotelink = 'TOTEALLYATESTSYMLINK3'
151
151
 
152
152
  begin
153
- @afc.touch(remotefile).should be_true
154
- @afc.symlink(remotefile, remotelink).should be_true
153
+ @afc.touch(remotefile).should == true
154
+ @afc.symlink(remotefile, remotelink).should == true
155
155
  @afc.file_info(remotefile)[:st_ifmt].should == :S_IFREG
156
156
  @afc.file_info(remotelink)[:st_ifmt].should == :S_IFLNK
157
157
 
@@ -172,8 +172,8 @@ describe Idevice::AFCClient do
172
172
  remotelink = 'TOTEALLYATESTHARDLINK'
173
173
 
174
174
  begin
175
- @afc.touch(remotefile).should be_true
176
- @afc.hardlink(remotefile, remotelink).should be_true
175
+ @afc.touch(remotefile).should == true
176
+ @afc.hardlink(remotefile, remotelink).should == true
177
177
  @afc.file_info(remotefile)[:st_ifmt].should == :S_IFREG
178
178
  @afc.file_info(remotelink)[:st_ifmt].should == :S_IFREG
179
179
 
@@ -212,7 +212,7 @@ describe Idevice::AFCClient do
212
212
  gotblock=true
213
213
  (0..2).should include(chunksz)
214
214
  end.should == @fromfile.size
215
- gotblock.should be_true
215
+ gotblock.should == true
216
216
 
217
217
  catsize = 0
218
218
  catbuf = StringIO.new
@@ -227,7 +227,7 @@ describe Idevice::AFCClient do
227
227
 
228
228
  catsize.should == @fromfile.size
229
229
  catbuf.string.should == @fromfile.read()
230
- gotblock.should be_true
230
+ gotblock.should == true
231
231
  ensure
232
232
  @afc.remove_path(remotepath) rescue nil
233
233
  end
@@ -252,10 +252,10 @@ describe Idevice::AFCClient do
252
252
  remotepath = 'TESTFILEUPLOADFORTRUNCATE'
253
253
 
254
254
  begin
255
- (@fromfile.size > 10).should be_true
255
+ (@fromfile.size > 10).should == true
256
256
  @afc.put_path(@fromfile.to_s, remotepath).should == @fromfile.size
257
257
  @afc.size(remotepath).should == @fromfile.size
258
- @afc.truncate(remotepath, 10).should be_true
258
+ @afc.truncate(remotepath, 10).should == true
259
259
  @afc.size(remotepath).should == 10
260
260
  ensure
261
261
  @afc.remove_path(remotepath) rescue nil
@@ -281,7 +281,7 @@ describe Idevice::AFCClient do
281
281
  it "should touch a file" do
282
282
  remotefile = "TESTFILETOUCH"
283
283
  begin
284
- @afc.touch(remotefile).should be_true
284
+ @afc.touch(remotefile).should == true
285
285
  @afc.cat(remotefile).should == ""
286
286
  @afc.ctime(remotefile).should == @afc.mtime(remotefile)
287
287
  ensure
@@ -293,11 +293,11 @@ describe Idevice::AFCClient do
293
293
  remotefile = "TESTINGFILETIMESETTING"
294
294
  settime = Time.parse("June 29, 2007 4:20 UTC")
295
295
  begin
296
- @afc.touch(remotefile).should be_true
296
+ @afc.touch(remotefile).should == true
297
297
  @afc.ctime(remotefile).should_not == settime
298
298
  @afc.mtime(remotefile).should_not == settime
299
299
 
300
- @afc.set_file_time(remotefile, settime).should be_true
300
+ @afc.set_file_time(remotefile, settime).should == true
301
301
  @afc.ctime(remotefile).should == settime
302
302
  @afc.mtime(remotefile).should == settime
303
303
  ensure
@@ -99,22 +99,22 @@ describe Idevice::DiagnosticsRelayClient do
99
99
  end
100
100
 
101
101
  it "should say goodbye to disconnect from the service" do
102
- @drc.goodbye.should be_true
102
+ @drc.goodbye.should == true
103
103
  lambda{ @drc.diagnostics }.should raise_error(Idevice::DiagnosticsRelayError)
104
104
  end
105
105
 
106
106
  it "should put a device to sleep" do
107
- pending "don't actually put the device to sleep"
107
+ skip "don't actually put the device to sleep"
108
108
  @drc.sleep
109
109
  end
110
110
 
111
111
  it "should restart a device" do
112
- pending "don't actually reboot the device"
112
+ skip "don't actually reboot the device"
113
113
  @drc.restart(0) #(with optional flags arg)
114
114
  end
115
115
 
116
116
  it "should shutdown a device" do
117
- pending "don't actually shutdown the device"
117
+ skip "don't actually shutdown the device"
118
118
  @drc.shutdown(0) #(with optional flags arg)
119
119
  end
120
120
 
@@ -30,10 +30,10 @@ describe Idevice::HeartbeatClient do
30
30
  end
31
31
 
32
32
  it "should send and receive a heartbeat" do
33
- pending "Heartbeat is not working on my test device"
33
+ skip "Heartbeat is not working on my test device"
34
34
  marco = @hb.receive_plist
35
35
  marco.should be_a Hash
36
- @hb.send_plist("Command" => "Polo").should be_true
36
+ @hb.send_plist("Command" => "Polo").should == true
37
37
  end
38
38
  end
39
39
 
@@ -56,7 +56,7 @@ describe Idevice::ImageMounterClient do
56
56
  end
57
57
 
58
58
  it "should hangup" do
59
- @imgmounter.hangup.should be_true
59
+ @imgmounter.hangup.should == true
60
60
  lambda{ @imgmounter.lookup_image }.should raise_error(Idevice::ImageMounterError)
61
61
  end
62
62
 
@@ -95,7 +95,7 @@ describe Idevice::LockdownClient do
95
95
  ldsvc = @lockdown.start_service("com.apple.afc")
96
96
  ldsvc.should_not be_nil
97
97
  ldsvc[:port].should > 1024
98
- [0,1].include?(ldsvc[:ssl_enabled]).should be_true
98
+ [0,1].include?(ldsvc[:ssl_enabled]).should == true
99
99
  end
100
100
 
101
101
  it "should raise an error starting a nonexistent lockdown service" do
@@ -35,7 +35,7 @@ if ENV["TEST_MOBILEBACKUP1"]
35
35
  end
36
36
 
37
37
  it "needs functional tests" do
38
- pending "writing more specs for MobileBackupClient"
38
+ skip "writing more specs for MobileBackupClient"
39
39
  end
40
40
  end
41
41
  end
@@ -40,29 +40,29 @@ describe Idevice::RestoreClient do
40
40
  it "should start a restore"
41
41
 
42
42
  it "should get the query type of the service daemon" do
43
- pending "getting PLIST_ERROR on iOS 7.x"
43
+ skip "getting PLIST_ERROR on iOS 7.x"
44
44
  res = @rc.query_type
45
45
  end
46
46
 
47
47
  it "should 'query' a value from the device specified by a key" do
48
- pending "getting PLIST_ERROR on iOS 7.x"
48
+ skip "getting PLIST_ERROR on iOS 7.x"
49
49
  res = @rc.query_value "foo"
50
50
  end
51
51
 
52
52
  it "should 'get' a value from information plist based by a key" do
53
- pending "getting NOT_ENOUGH_DATA on iOS 7.x"
53
+ skip "getting NOT_ENOUGH_DATA on iOS 7.x"
54
54
  res = @rc.get_value "foo"
55
55
  end
56
56
 
57
57
  it "should request a device reboot" do
58
- pending "don't actually reboot"
59
- pending "getting PLIST_ERROR on iOS 7.x"
60
- @rc.reboot.should be_true
58
+ skip "don't actually reboot"
59
+ skip "getting PLIST_ERROR on iOS 7.x"
60
+ # @rc.reboot.should == true
61
61
  end
62
62
 
63
63
  it "should say goodbye" do
64
- pending "getting PLIST_ERROR on iOS 7.x"
65
- @rc.goodbye.should be_true
64
+ skip "getting PLIST_ERROR on iOS 7.x"
65
+ @rc.goodbye.should == true
66
66
  end
67
67
 
68
68
  it "should send a plist"
@@ -36,7 +36,7 @@ describe Idevice::SBSClient do
36
36
  end
37
37
 
38
38
  it "should set the icon state" do
39
- pending "dont actually mess with icon state"
39
+ skip "dont actually mess with icon state"
40
40
  @sbs.set_icon_state({"somthing" => 'here'})
41
41
  end
42
42
 
@@ -22,7 +22,7 @@ require_relative 'spec_helper'
22
22
 
23
23
  describe Idevice::ScreenShotrClient do
24
24
  before :each do
25
- pending "needs developer disk mounted" unless ENV["DEVTESTS"]
25
+ skip "needs developer disk mounted" unless ENV["DEVTESTS"]
26
26
  @ss = Idevice::ScreenShotrClient.attach(idevice:shared_idevice, lockdown_client:shared_lockdown_client)
27
27
  end
28
28
 
@@ -31,6 +31,10 @@ $LOAD_PATH << $SPECROOT.join("..", "lib").expand_path
31
31
  require 'idevice'
32
32
 
33
33
  RSpec.configure do |config|
34
+ config.expect_with :rspec do |c|
35
+ c.syntax = [:should, :expect]
36
+ end
37
+
34
38
  def sample_file(filename)
35
39
  $SPECROOT.join("samples", filename)
36
40
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idevice
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6.0
4
+ version: 1.1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Monti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-31 00:00:00.000000000 Z
11
+ date: 2015-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: plist
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
@@ -56,42 +56,42 @@ dependencies:
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '3.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '3.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: pry
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: Ruby FFI bindings for libimobiledevice
@@ -166,7 +166,7 @@ files:
166
166
  - spec/screenshotr_devicespec.rb
167
167
  - spec/spec_helper.rb
168
168
  - spec/webinspector_devicespec.rb
169
- homepage: https://github.com/blueboxsecurity/idevice
169
+ homepage: https://github.com/emonti/idevice
170
170
  licenses:
171
171
  - Apache License, Version 2.0
172
172
  metadata: {}
@@ -176,17 +176,17 @@ require_paths:
176
176
  - lib
177
177
  required_ruby_version: !ruby/object:Gem::Requirement
178
178
  requirements:
179
- - - ! '>='
179
+ - - '>='
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
182
  required_rubygems_version: !ruby/object:Gem::Requirement
183
183
  requirements:
184
- - - ! '>='
184
+ - - '>='
185
185
  - !ruby/object:Gem::Version
186
186
  version: '0'
187
187
  requirements: []
188
188
  rubyforge_project:
189
- rubygems_version: 2.2.1
189
+ rubygems_version: 2.4.1
190
190
  signing_key:
191
191
  specification_version: 4
192
192
  summary: Ruby FFI bindings for libimobiledevice. The ruby Idevice library was written