idevice 1.1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. data/.gitignore +18 -0
  2. data/.rspec +2 -0
  3. data/Gemfile +4 -0
  4. data/NOTICE +202 -0
  5. data/README.md +74 -0
  6. data/Rakefile +37 -0
  7. data/examples/idevimgmount +58 -0
  8. data/examples/idumplockdownvalues +64 -0
  9. data/examples/ifetchcrashreports +54 -0
  10. data/examples/ilistapps +38 -0
  11. data/examples/ilistudids +26 -0
  12. data/examples/ilog +35 -0
  13. data/examples/installipa +51 -0
  14. data/examples/iremoveapp +42 -0
  15. data/examples/irestart +26 -0
  16. data/examples/iscreenshotr +39 -0
  17. data/idevice.gemspec +33 -0
  18. data/lib/idevice.rb +69 -0
  19. data/lib/idevice/afc.rb +518 -0
  20. data/lib/idevice/c.rb +129 -0
  21. data/lib/idevice/diagnostics_relay.rb +185 -0
  22. data/lib/idevice/file_relay.rb +83 -0
  23. data/lib/idevice/heartbeat.rb +99 -0
  24. data/lib/idevice/house_arrest.rb +138 -0
  25. data/lib/idevice/idevice.rb +208 -0
  26. data/lib/idevice/image_mounter.rb +117 -0
  27. data/lib/idevice/installation_proxy.rb +193 -0
  28. data/lib/idevice/lockdown.rb +350 -0
  29. data/lib/idevice/misagent.rb +112 -0
  30. data/lib/idevice/mobilebackup.rb +183 -0
  31. data/lib/idevice/mobilebackup2.rb +174 -0
  32. data/lib/idevice/mobilesync.rb +306 -0
  33. data/lib/idevice/notification_proxy.rb +168 -0
  34. data/lib/idevice/plist.rb +366 -0
  35. data/lib/idevice/restore.rb +176 -0
  36. data/lib/idevice/sbservices.rb +152 -0
  37. data/lib/idevice/screenshotr.rb +88 -0
  38. data/lib/idevice/version.rb +3 -0
  39. data/lib/idevice/webinspector.rb +96 -0
  40. data/spec/afc_devicespec.rb +409 -0
  41. data/spec/diagnostics_relay_devicespec.rb +125 -0
  42. data/spec/file_relay_devicespec.rb +45 -0
  43. data/spec/heartbeat_devicespec.rb +39 -0
  44. data/spec/idevice_devicespec.rb +93 -0
  45. data/spec/idevice_spec.rb +29 -0
  46. data/spec/image_mounter_devicespec.rb +65 -0
  47. data/spec/installation_proxy_devicespec.rb +54 -0
  48. data/spec/lockdown_devicespec.rb +106 -0
  49. data/spec/misagent_devicespec.rb +43 -0
  50. data/spec/mobilebackup2_devicespec.rb +58 -0
  51. data/spec/mobilebackup_devicespec.rb +41 -0
  52. data/spec/mobilesync_devicespec.rb +62 -0
  53. data/spec/notification_proxy_devicespec.rb +45 -0
  54. data/spec/plist_spec.rb +176 -0
  55. data/spec/restore_devicespec.rb +72 -0
  56. data/spec/samples/plist.bin +0 -0
  57. data/spec/samples/plist.xml +10 -0
  58. data/spec/sbservices_devicespec.rb +64 -0
  59. data/spec/screenshotr_devicespec.rb +39 -0
  60. data/spec/spec_helper.rb +73 -0
  61. data/spec/webinspector_devicespec.rb +36 -0
  62. metadata +233 -0
@@ -0,0 +1,72 @@
1
+ #
2
+ # Copyright (c) 2013 Eric Monti - Bluebox Security
3
+ #
4
+ # Licensed to the Apache Software Foundation (ASF) under one
5
+ # or more contributor license agreements. See the NOTICE file
6
+ # distributed with this work for additional information
7
+ # regarding copyright ownership. The ASF licenses this file
8
+ # to you under the Apache License, Version 2.0 (the
9
+ # "License"); you may not use this file except in compliance
10
+ # with the License. You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing,
15
+ # software distributed under the License is distributed on an
16
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
+ # KIND, either express or implied. See the License for the
18
+ # specific language governing permissions and limitations
19
+ # under the License.
20
+
21
+ require_relative 'spec_helper'
22
+
23
+ describe Idevice::RestoreClient do
24
+ before :each do
25
+ @rc = Idevice::RestoreClient.attach(idevice:shared_idevice)
26
+ end
27
+
28
+ before :each do
29
+ @rc.goodbye rescue nil
30
+ end
31
+
32
+ it "should attach" do
33
+ @rc.should be_a Idevice::RestoreClient
34
+ end
35
+
36
+ it "should set the client label" do
37
+ @rc.set_label("idev-unit-tests")
38
+ end
39
+
40
+ it "should start a restore"
41
+
42
+ it "should get the query type of the service daemon" do
43
+ pending "getting PLIST_ERROR on iOS 7.x"
44
+ res = @rc.query_type
45
+ end
46
+
47
+ it "should 'query' a value from the device specified by a key" do
48
+ pending "getting PLIST_ERROR on iOS 7.x"
49
+ res = @rc.query_value "foo"
50
+ end
51
+
52
+ it "should 'get' a value from information plist based by a key" do
53
+ pending "getting NOT_ENOUGH_DATA on iOS 7.x"
54
+ res = @rc.get_value "foo"
55
+ end
56
+
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
61
+ end
62
+
63
+ it "should say goodbye" do
64
+ pending "getting PLIST_ERROR on iOS 7.x"
65
+ @rc.goodbye.should be_true
66
+ end
67
+
68
+ it "should send a plist"
69
+
70
+ it "should receive a plist"
71
+
72
+ end
Binary file
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>Label</key>
6
+ <string>idevspecs</string>
7
+ <key>Request</key>
8
+ <string>QueryType</string>
9
+ </dict>
10
+ </plist>
@@ -0,0 +1,64 @@
1
+ #
2
+ # Copyright (c) 2013 Eric Monti - Bluebox Security
3
+ #
4
+ # Licensed to the Apache Software Foundation (ASF) under one
5
+ # or more contributor license agreements. See the NOTICE file
6
+ # distributed with this work for additional information
7
+ # regarding copyright ownership. The ASF licenses this file
8
+ # to you under the Apache License, Version 2.0 (the
9
+ # "License"); you may not use this file except in compliance
10
+ # with the License. You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing,
15
+ # software distributed under the License is distributed on an
16
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
+ # KIND, either express or implied. See the License for the
18
+ # specific language governing permissions and limitations
19
+ # under the License.
20
+
21
+ require_relative 'spec_helper'
22
+
23
+ describe Idevice::SBSClient do
24
+ before :each do
25
+ @sbs = Idevice::SBSClient.attach(idevice:shared_idevice)
26
+ end
27
+
28
+ it "should attach" do
29
+ @sbs.should be_a Idevice::SBSClient
30
+ end
31
+
32
+
33
+ it "should get the icon state of the connected device" do
34
+ state = @sbs.get_icon_state
35
+ state.should be_a Array
36
+ end
37
+
38
+ it "should set the icon state" do
39
+ pending "dont actually mess with icon state"
40
+ @sbs.set_icon_state({"somthing" => 'here'})
41
+ end
42
+
43
+ it "should get icon pngdata" do
44
+ data = @sbs.get_icon_pngdata("com.apple.Preferences")
45
+ data.should be_a String
46
+ shell_pipe(data[0..256], "file -").should =~ /PNG image data/
47
+ end
48
+
49
+ it "should get device orientation" do
50
+ orientation = @sbs.get_interface_orientation
51
+ [ :PORTRAIT, # => 1,
52
+ :PORTRAIT_UPSIDE_DOWN, # => 2,
53
+ :LANDSCAPE_RIGHT, # => 3,
54
+ :LANDSCAPE_LEFT, # => 4,
55
+ ].should include(orientation)
56
+ end
57
+
58
+ it "should get the homes screen wallpaper pngdata" do
59
+ data = @sbs.get_home_screen_wallpaper_pngdata
60
+ data.should be_a String
61
+ shell_pipe(data[0..256], "file -").should =~ /PNG image data/
62
+ end
63
+ end
64
+
@@ -0,0 +1,39 @@
1
+ #
2
+ # Copyright (c) 2013 Eric Monti - Bluebox Security
3
+ #
4
+ # Licensed to the Apache Software Foundation (ASF) under one
5
+ # or more contributor license agreements. See the NOTICE file
6
+ # distributed with this work for additional information
7
+ # regarding copyright ownership. The ASF licenses this file
8
+ # to you under the Apache License, Version 2.0 (the
9
+ # "License"); you may not use this file except in compliance
10
+ # with the License. You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing,
15
+ # software distributed under the License is distributed on an
16
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
+ # KIND, either express or implied. See the License for the
18
+ # specific language governing permissions and limitations
19
+ # under the License.
20
+
21
+ require_relative 'spec_helper'
22
+
23
+ describe Idevice::ScreenShotrClient do
24
+ before :each do
25
+ pending "needs developer disk mounted" unless ENV["DEVTESTS"]
26
+ @ss = Idevice::ScreenShotrClient.attach(idevice:shared_idevice)
27
+ end
28
+
29
+ it "should attach" do
30
+ @ss.should be_a Idevice::ScreenShotrClient
31
+ end
32
+
33
+ it "should take a screenshot" do
34
+ data = @ss.take_screenshot
35
+ data.should be_a String
36
+ shell_pipe(data[0..256], "file -").should =~ /image data/
37
+ end
38
+ end
39
+
@@ -0,0 +1,73 @@
1
+ #
2
+ # Copyright (c) 2013 Eric Monti - Bluebox Security
3
+ #
4
+ # Licensed to the Apache Software Foundation (ASF) under one
5
+ # or more contributor license agreements. See the NOTICE file
6
+ # distributed with this work for additional information
7
+ # regarding copyright ownership. The ASF licenses this file
8
+ # to you under the Apache License, Version 2.0 (the
9
+ # "License"); you may not use this file except in compliance
10
+ # with the License. You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing,
15
+ # software distributed under the License is distributed on an
16
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
+ # KIND, either express or implied. See the License for the
18
+ # specific language governing permissions and limitations
19
+ # under the License.
20
+
21
+ require 'pathname'
22
+ require 'open3'
23
+ $SPECROOT = Pathname(__FILE__).dirname
24
+ require 'tmpdir'
25
+ require 'tempfile'
26
+ require 'rubygems'
27
+ require 'rspec'
28
+ require 'pry'
29
+
30
+ $LOAD_PATH << $SPECROOT.join("..", "lib").expand_path
31
+ require 'idevice'
32
+
33
+ RSpec.configure do |config|
34
+ def sample_file(filename)
35
+ $SPECROOT.join("samples", filename)
36
+ end
37
+
38
+ def relative_paths(paths, reldir)
39
+ paths.map{|p| Pathname(p).relative_path_from(Pathname(reldir)).to_s}
40
+ end
41
+
42
+ def spec_logger
43
+ $logger ||=
44
+ if ENV["SPEC_LOGGING"]
45
+ logger = Logger.new($stdout)
46
+ #logger.level = Logger::INFO
47
+ logger
48
+ end
49
+ end
50
+
51
+ def shared_idevice
52
+ $shared_idevice ||= Idevice::Idevice.attach
53
+ end
54
+
55
+ def shell_pipe(data, cmd)
56
+ ret=nil
57
+ Open3.popen3(cmd) do |w,r,e|
58
+ w.write data
59
+ w.close
60
+ ret = r.read
61
+ r.close
62
+ end
63
+ return ret
64
+ end
65
+ end
66
+
67
+ if ENV["DEBUG"]
68
+ Idevice.debug_level=9
69
+ end
70
+
71
+ if ENV["GC_STRESS"]
72
+ GC.stress = true
73
+ end
@@ -0,0 +1,36 @@
1
+ #
2
+ # Copyright (c) 2013 Eric Monti - Bluebox Security
3
+ #
4
+ # Licensed to the Apache Software Foundation (ASF) under one
5
+ # or more contributor license agreements. See the NOTICE file
6
+ # distributed with this work for additional information
7
+ # regarding copyright ownership. The ASF licenses this file
8
+ # to you under the Apache License, Version 2.0 (the
9
+ # "License"); you may not use this file except in compliance
10
+ # with the License. You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing,
15
+ # software distributed under the License is distributed on an
16
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
+ # KIND, either express or implied. See the License for the
18
+ # specific language governing permissions and limitations
19
+ # under the License.
20
+
21
+ require_relative 'spec_helper'
22
+
23
+ describe Idevice::WebInspectorClient do
24
+ before :each do
25
+ @wic = Idevice::WebInspectorClient.attach(idevice:shared_idevice)
26
+ end
27
+
28
+ it "should attach" do
29
+ @wic.should be_a Idevice::WebInspectorClient
30
+ end
31
+
32
+ it "should send a plist"
33
+
34
+ it "should receive a plist"
35
+ end
36
+
metadata ADDED
@@ -0,0 +1,233 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: idevice
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.5.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Eric Monti
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-12-03 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: ffi
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: plist
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: bundler
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: '1.3'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.3'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rake
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
+ - !ruby/object:Gem::Dependency
79
+ name: rspec
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: pry
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ description: Ruby FFI bindings for libimobiledevice
111
+ email:
112
+ - monti@bluebox.com
113
+ executables: []
114
+ extensions: []
115
+ extra_rdoc_files: []
116
+ files:
117
+ - .gitignore
118
+ - .rspec
119
+ - Gemfile
120
+ - NOTICE
121
+ - README.md
122
+ - Rakefile
123
+ - examples/idevimgmount
124
+ - examples/idumplockdownvalues
125
+ - examples/ifetchcrashreports
126
+ - examples/ilistapps
127
+ - examples/ilistudids
128
+ - examples/ilog
129
+ - examples/installipa
130
+ - examples/iremoveapp
131
+ - examples/irestart
132
+ - examples/iscreenshotr
133
+ - idevice.gemspec
134
+ - lib/idevice.rb
135
+ - lib/idevice/afc.rb
136
+ - lib/idevice/c.rb
137
+ - lib/idevice/diagnostics_relay.rb
138
+ - lib/idevice/file_relay.rb
139
+ - lib/idevice/heartbeat.rb
140
+ - lib/idevice/house_arrest.rb
141
+ - lib/idevice/idevice.rb
142
+ - lib/idevice/image_mounter.rb
143
+ - lib/idevice/installation_proxy.rb
144
+ - lib/idevice/lockdown.rb
145
+ - lib/idevice/misagent.rb
146
+ - lib/idevice/mobilebackup.rb
147
+ - lib/idevice/mobilebackup2.rb
148
+ - lib/idevice/mobilesync.rb
149
+ - lib/idevice/notification_proxy.rb
150
+ - lib/idevice/plist.rb
151
+ - lib/idevice/restore.rb
152
+ - lib/idevice/sbservices.rb
153
+ - lib/idevice/screenshotr.rb
154
+ - lib/idevice/version.rb
155
+ - lib/idevice/webinspector.rb
156
+ - spec/afc_devicespec.rb
157
+ - spec/diagnostics_relay_devicespec.rb
158
+ - spec/file_relay_devicespec.rb
159
+ - spec/heartbeat_devicespec.rb
160
+ - spec/idevice_devicespec.rb
161
+ - spec/idevice_spec.rb
162
+ - spec/image_mounter_devicespec.rb
163
+ - spec/installation_proxy_devicespec.rb
164
+ - spec/lockdown_devicespec.rb
165
+ - spec/misagent_devicespec.rb
166
+ - spec/mobilebackup2_devicespec.rb
167
+ - spec/mobilebackup_devicespec.rb
168
+ - spec/mobilesync_devicespec.rb
169
+ - spec/notification_proxy_devicespec.rb
170
+ - spec/plist_spec.rb
171
+ - spec/restore_devicespec.rb
172
+ - spec/samples/plist.bin
173
+ - spec/samples/plist.xml
174
+ - spec/sbservices_devicespec.rb
175
+ - spec/screenshotr_devicespec.rb
176
+ - spec/spec_helper.rb
177
+ - spec/webinspector_devicespec.rb
178
+ homepage: https://github.com/blueboxsecurity/idevice
179
+ licenses:
180
+ - Apache License, Version 2.0
181
+ post_install_message:
182
+ rdoc_options: []
183
+ require_paths:
184
+ - lib
185
+ required_ruby_version: !ruby/object:Gem::Requirement
186
+ none: false
187
+ requirements:
188
+ - - ! '>='
189
+ - !ruby/object:Gem::Version
190
+ version: '0'
191
+ segments:
192
+ - 0
193
+ hash: -2031219263689271253
194
+ required_rubygems_version: !ruby/object:Gem::Requirement
195
+ none: false
196
+ requirements:
197
+ - - ! '>='
198
+ - !ruby/object:Gem::Version
199
+ version: '0'
200
+ segments:
201
+ - 0
202
+ hash: -2031219263689271253
203
+ requirements: []
204
+ rubyforge_project:
205
+ rubygems_version: 1.8.25
206
+ signing_key:
207
+ specification_version: 3
208
+ summary: Ruby FFI bindings for libimobiledevice. The ruby Idevice library was written
209
+ primarily as a research tool for prototyping iOS tools that use USB as well as a
210
+ tool to aid in reverse-engineering new areas of the iOS USB protocols.
211
+ test_files:
212
+ - spec/afc_devicespec.rb
213
+ - spec/diagnostics_relay_devicespec.rb
214
+ - spec/file_relay_devicespec.rb
215
+ - spec/heartbeat_devicespec.rb
216
+ - spec/idevice_devicespec.rb
217
+ - spec/idevice_spec.rb
218
+ - spec/image_mounter_devicespec.rb
219
+ - spec/installation_proxy_devicespec.rb
220
+ - spec/lockdown_devicespec.rb
221
+ - spec/misagent_devicespec.rb
222
+ - spec/mobilebackup2_devicespec.rb
223
+ - spec/mobilebackup_devicespec.rb
224
+ - spec/mobilesync_devicespec.rb
225
+ - spec/notification_proxy_devicespec.rb
226
+ - spec/plist_spec.rb
227
+ - spec/restore_devicespec.rb
228
+ - spec/samples/plist.bin
229
+ - spec/samples/plist.xml
230
+ - spec/sbservices_devicespec.rb
231
+ - spec/screenshotr_devicespec.rb
232
+ - spec/spec_helper.rb
233
+ - spec/webinspector_devicespec.rb