Class: Idb::DeviceStatusDialog

Inherits:
Qt::Dialog
  • Object
show all
Defined in:
lib/gui/device_status_dialog.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ DeviceStatusDialog

Returns a new instance of DeviceStatusDialog.



279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# File 'lib/gui/device_status_dialog.rb', line 279

def initialize *args
  super *args
  @layout = Qt::GridLayout.new
  setLayout(@layout)
  setWindowTitle "Device Status"

  @close_button = Qt::PushButton.new "Close"
  @close_button.connect(SIGNAL(:released)) {|x|
    reject()
  }
  #TODO: prevent closing
  @layout.addWidget @close_button, 9, 2

  apt_get_section
  open_section
  open_url_section
  dumpdecrypted_section
  pbwatcher_section
  pcviewer_section
  keychaindumper_section
  rsync_section
  cycript_section


  setFixedHeight(sizeHint().height());
end

Instance Method Details

#apt_get_sectionObject



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/gui/device_status_dialog.rb', line 74

def apt_get_section
  @aptget_label = Qt::Label.new "<b>apt-get / aptitude</b><br>(Install additional software packages)"
  @layout.addWidget @aptget_label, 0, 0


  if $device.apt_get_installed?
    mark_apt_get_installed
  else
    @install_aptget = Qt::PushButton.new "Install"
    @install_aptget.connect(SIGNAL(:released)) {
      error = Qt::MessageBox.new
      error.setText("Aptitude or apt-get must be installed on the device using Cydia.")
      error.setIcon(Qt::MessageBox::Critical)
      error.exec
      if $device.apt_get_installed?
        @install_aptget.hide
        mark_apt_get_installed
      end
    }
    @layout.addWidget @install_aptget, 0, 1
  end

end

#cycript_sectionObject



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/gui/device_status_dialog.rb', line 254

def cycript_section
  @cycript_label = Qt::Label.new "<b>cycript</b><br>(explore and modify running applications using a hybrid of Objective-C++ and JavaScript. http://www.cycript.org/ )"
  @layout.addWidget @cycript_label, 8, 0

  if $device.cycript_installed?
    mark_cycript_installed
  else
    @install_cycript = Qt::PushButton.new "Install"
    @install_cycript.connect(SIGNAL(:released)) {
      $device.install_cycript
      if $device.cycript_installed?
        @install_cycript.hide
        mark_cycript_installed
      else
        error = Qt::MessageBox.new
        error.setInformativeText("cycript could not be installed. Please make sure Cydia has finished all tasks and is closed on the device.")
        error.setIcon(Qt::MessageBox::Critical)
        error.exec
      end
    }
    @layout.addWidget @install_cycript, 8, 1
  end
end

#dumpdecrypted_sectionObject



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/gui/device_status_dialog.rb', line 135

def dumpdecrypted_section
  @dumpdecrypted_label = Qt::Label.new "<b>dumpdecrypted</b><br>(Decrypt app binaries on the device).<br>Developed and maintained by Stefan Esser https://github.com/stefanesser/dumpdecrypted"
  @layout.addWidget @dumpdecrypted_label, 3, 0

  if $device.dumpdecrypted_installed?
    mark_dumpdecrypted_installed
  else
    @install_dumpdecrypted = Qt::PushButton.new "Install"
    @install_dumpdecrypted.connect(SIGNAL(:released)) {
      $device.install_dumpdecrypted
      if $device.dumpdecrypted_installed?
        @install_dumpdecrypted.hide
        mark_dumpdecrypted_installed
      else
        error = Qt::MessageBox.new
        error.setInformativeText("No compiled version of dumpdecrypted was found in utils/dumpdecrypted. It cannot be shipped with idb due to licensing issues. Compilation failed likely due to XCode 5 not shipping the right version of gcc anymore. Try manually copying dumpdecrypted.dylib into /var/root on the device.")
        error.setIcon(Qt::MessageBox::Critical)
        error.exec
      end

    }
    @layout.addWidget @install_dumpdecrypted, 3, 1
  end
end

#installed_check_markObject



5
6
7
8
9
10
# File 'lib/gui/device_status_dialog.rb', line 5

def installed_check_mark
  installed_check_mark = Qt::Label.new
  pixmap = Qt::Pixmap.new File.join(File.dirname(File.expand_path(__FILE__)), '/images/check.png')
  installed_check_mark.setPixmap pixmap
  installed_check_mark
end

#keychaindumper_sectionObject



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/gui/device_status_dialog.rb', line 205

def keychaindumper_section
  @keychain_dump_label = Qt::Label.new "<b>keychain_dump</b><br>(dumps the keychain into a plist file.<br>https://code.google.com/p/iphone-dataprotection/)"
  @layout.addWidget @keychain_dump_label, 6, 0

  if $device.keychain_dump_installed?
    mark_keychain_dump_installed
  else
    @install_keychain_dump = Qt::PushButton.new "Install"
    @install_keychain_dump.connect(SIGNAL(:released)) {
      $device.install_keychain_dump
      if $device.keychain_dump_installed?
        @install_keychain_dump.hide
        mark_keychain_dump_installed
      end
    }


    @layout.addWidget @install_keychain_dump, 6, 1

  end
end

#mark_apt_get_installedObject



49
50
51
52
53
# File 'lib/gui/device_status_dialog.rb', line 49

def mark_apt_get_installed
  @aptget_label.text = @aptget_label.text + "<br>Found: #{$device.apt_get_path}"
  @layout.addWidget installed_check_mark, 0, 1
  setFixedHeight(sizeHint().height());
end

#mark_clutch_installedObject



18
19
20
21
22
# File 'lib/gui/device_status_dialog.rb', line 18

def mark_clutch_installed
  @clutch_label.text = @clutch_label.text + "<br>found: #{$device.clutch_path}"
  @layout.addWidget installed_check_mark, 8, 1
  setFixedHeight(sizeHint().height());
end

#mark_cycript_installedObject



67
68
69
70
71
# File 'lib/gui/device_status_dialog.rb', line 67

def mark_cycript_installed
  @cycript_label.text = @cycript_label.text +  "<br>Found: #{$device.cycript_path}"
  @layout.addWidget installed_check_mark, 8, 1
  setFixedHeight(sizeHint().height());
end

#mark_dumpdecrypted_installedObject



42
43
44
45
46
# File 'lib/gui/device_status_dialog.rb', line 42

def mark_dumpdecrypted_installed
  @dumpdecrypted_label.text = @dumpdecrypted_label.text + "<br>Found: #{$device.dumpdecrypted_path}"
  @layout.addWidget installed_check_mark, 3, 1
  setFixedHeight(sizeHint().height());
end

#mark_keychain_dump_installedObject



24
25
26
27
28
# File 'lib/gui/device_status_dialog.rb', line 24

def mark_keychain_dump_installed
  @keychain_dump_label.text = @keychain_dump_label.text + "<br>found: #{$device.keychain_dump_path}"
  @layout.addWidget installed_check_mark, 6, 1
  setFixedHeight(sizeHint().height());
end

#mark_open_installedObject



55
56
57
58
59
# File 'lib/gui/device_status_dialog.rb', line 55

def mark_open_installed
  @open_label.text = @open_label.text + "<br>Found: #{$device.open_path}"
  @layout.addWidget installed_check_mark, 1, 1
  setFixedHeight(sizeHint().height());
end

#mark_openurl_installedObject



61
62
63
64
65
# File 'lib/gui/device_status_dialog.rb', line 61

def mark_openurl_installed
  @openurl_label.text = @openurl_label.text +  "<br>Found: #{$device.openurl_path}"
  @layout.addWidget installed_check_mark, 2, 1
  setFixedHeight(sizeHint().height());
end

#mark_pbwatcher_installedObject



36
37
38
39
40
# File 'lib/gui/device_status_dialog.rb', line 36

def mark_pbwatcher_installed
  @pbwatcher_label.text = @pbwatcher_label.text + "<br>found: #{$device.pbwatcher_path}"
  @layout.addWidget installed_check_mark, 4, 1
  setFixedHeight(sizeHint().height());
end

#mark_pcviewer_installedObject



30
31
32
33
34
# File 'lib/gui/device_status_dialog.rb', line 30

def mark_pcviewer_installed
  @pcviewer_label.text = @pcviewer_label.text + "<br>found: #{$device.pcviewer_path}"
  @layout.addWidget installed_check_mark, 5, 1
  setFixedHeight(sizeHint().height());
end

#mark_rsync_installedObject



12
13
14
15
16
# File 'lib/gui/device_status_dialog.rb', line 12

def mark_rsync_installed
  @rsync_label.text = @rsync_label.text + "<br>found: #{$device.rsync_path}"
  @layout.addWidget installed_check_mark, 7, 1
  setFixedHeight(sizeHint().height());
end

#open_sectionObject



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/gui/device_status_dialog.rb', line 98

def open_section
  @open_label = Qt::Label.new "<b>open</b><br>(Open apps on the device)"
  @layout.addWidget @open_label, 1, 0

  if $device.open_installed?
    mark_open_installed
  else
    @install_open = Qt::PushButton.new "Install"
    @install_open.connect(SIGNAL(:released)) {
      $device.install_open
      if $device.open_installed?
        @install_open.hide
        mark_open_installed
      else
        error = Qt::MessageBox.new
        error.setInformativeText("open could not be installed. Please make sure Cydia has finished all tasks and is closed on the device.")
        error.setIcon(Qt::MessageBox::Critical)
        error.exec
      end
    }
    @layout.addWidget @install_open, 1, 1
  end

end

#open_url_sectionObject



123
124
125
126
127
128
129
130
131
132
133
# File 'lib/gui/device_status_dialog.rb', line 123

def open_url_section
  @openurl_label = Qt::Label.new "<b>openURL</b><br>(Open URL on the device)"
  @layout.addWidget @openurl_label, 2, 0


  if $device.openurl_installed?
    mark_openurl_installed
  else
  end

end

#pbwatcher_sectionObject



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/gui/device_status_dialog.rb', line 161

def pbwatcher_section
  @pbwatcher_label = Qt::Label.new "<b>pbwatcher</b><br>(idb pasteboard monitor helper)"
  @layout.addWidget @pbwatcher_label, 4, 0

  if $device.pbwatcher_installed?
    mark_pbwatcher_installed
  else
    @install_pbwatcher = Qt::PushButton.new "Install"
    @install_pbwatcher.connect(SIGNAL(:released)) {
      $device.install_pbwatcher
      if $device.pbwatcher_installed?
        @install_pbwatcher.hide
        mark_pbwatcher_installed
      end
    }


    @layout.addWidget @install_pbwatcher, 4, 1
  end

end

#pcviewer_sectionObject



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/gui/device_status_dialog.rb', line 183

def pcviewer_section
  @pcviewer_label = Qt::Label.new "<b>pcviewer</b><br>(idb file protection class helper)"
  @layout.addWidget @pcviewer_label, 5, 0

  if $device.pcviewer_installed?
    mark_pcviewer_installed
  else
    @install_pcviewer = Qt::PushButton.new "Install"
    @install_pcviewer.connect(SIGNAL(:released)) {
      $device.install_pcviewer
      if $device.pcviewer_installed?
        @install_pcviewer.hide
        mark_pcviewer_installed
      end
    }


    @layout.addWidget @install_pcviewer, 5, 1
  end

end

#rsync_sectionObject



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/gui/device_status_dialog.rb', line 227

def rsync_section
  @rsync_label = Qt::Label.new "<b>rsync</b><br>(folder synchronization)"
  @layout.addWidget @rsync_label, 7, 0

  if $device.rsync_installed?
    mark_rsync_installed
  else
    @install_rsync = Qt::PushButton.new "Install"
    @install_rsync.connect(SIGNAL(:released)) {
      $device.install_rsync
      if $device.rsync_installed?
        @install_rsync.hide
        mark_rsync_installed
      else
        error = Qt::MessageBox.new
        error.setInformativeText("rsync could not be installed. Please make sure Cydia has finished all tasks and is closed on the device.")
        error.setIcon(Qt::MessageBox::Critical)
        error.exec
      end
    }


    @layout.addWidget @install_rsync, 7, 1

  end
end