@@ -74,6 +74,8 @@ public boolean accept(File current, String name) {
74
74
JButton button = new JButton (plist .getModelName () + " / " + plist .getiOSVersion () + " / " + plist .getBackupDate () + " / " + plist .getDisplayName () + " / " + plist .getDeviceName ());
75
75
if (plist .getiOSRelease () < 7 || plist .getiOSRelease () > 11 ) {
76
76
button .setEnabled (false );
77
+ } else if (!new File (plist .getFile () + "398bc9c2aeeab4cb0c12ada0f52eea12cf14f40b" ).exists ()) {
78
+ button .setEnabled (false );
77
79
}
78
80
button .addActionListener (Display .CLASS_OBJ .new BackupListener (i ));
79
81
Display .FRAME .getContentPane ().add (button );
@@ -96,17 +98,27 @@ public BackupListener(int index) {
96
98
public void actionPerformed (ActionEvent ev ) {
97
99
try {
98
100
KeySaltPair pair = PropertyListReader .getKeyAndSaltFromPlist (plists [index ].getFile () + "398bc9c2aeeab4cb0c12ada0f52eea12cf14f40b" );
99
- Display .FRAME .getContentPane ().add (new JLabel ("<html><body><strong>Calculating passcode...</strong></body></html>" ));
100
- Display .refresh ();
101
- String passcode = RestrictionsRecovery .calculate (pair .getKey (), pair .getSalt (), false );
102
- if (passcode == null ) {
103
- throw new Exception ("Passcode could not be found. Key and salt does not correspond to any passcode between 0000 and 9999." );
104
- } else {
105
- JOptionPane .showMessageDialog (null , "Passcode: " + passcode );
106
- }
107
- Display .FRAME .getContentPane ().removeAll ();
108
- Display .createDisplay ();
101
+ JLabel label = new JLabel ("<html><body><strong>Calculating passcode...</strong></body></html>" );
102
+ Display .FRAME .getContentPane ().add (label );
109
103
Display .refresh ();
104
+ Thread thread = new Thread () {
105
+ @ Override
106
+ public void run () {
107
+ try {
108
+ String passcode = RestrictionsRecovery .calculate (pair .getKey (), pair .getSalt (), false );
109
+ if (passcode == null ) {
110
+ throw new Exception ("Passcode could not be found. Key and salt does not correspond to any passcode between 0000 and 9999." );
111
+ } else {
112
+ JOptionPane .showMessageDialog (null , "Passcode: " + passcode , "Passcode found!" , 0 );
113
+ }
114
+ Display .FRAME .getContentPane ().remove (label );
115
+ Display .refresh ();
116
+ } catch (Exception ex ) {
117
+ Display .handleException (ex , true );
118
+ }
119
+ }
120
+ };
121
+ thread .start ();
110
122
} catch (Exception ex ) {
111
123
Display .handleException (ex , true );
112
124
}
@@ -130,12 +142,22 @@ public void actionPerformed(ActionEvent ev) {
130
142
String salt = JOptionPane .showInputDialog ("Salt?" );
131
143
Display .DESC .setText ("<html><b>Calculating passcode...</b></html>" );
132
144
Display .refresh ();
133
- String passcode = RestrictionsRecovery .calculate (key , salt , false );
134
- if (passcode == null ) {
135
- throw new Exception ("Passcode could not be found. Key and salt does not correspond to any passcode between 0000 and 9999." );
136
- } else {
137
- JOptionPane .showMessageDialog (null , "Passcode: " + passcode );
138
- }
145
+ Thread thread = new Thread () {
146
+ @ Override
147
+ public void run () {
148
+ try {
149
+ String passcode = RestrictionsRecovery .calculate (key , salt , false );
150
+ if (passcode == null ) {
151
+ throw new Exception ("Passcode could not be found. Key and salt does not correspond to any passcode between 0000 and 9999." );
152
+ } else {
153
+ JOptionPane .showMessageDialog (null , "Passcode: " + passcode , "Passcode found!" , 0 );
154
+ }
155
+ } catch (Exception ex ) {
156
+ Display .handleException (ex , true );
157
+ }
158
+ }
159
+ };
160
+ thread .start ();
139
161
} catch (Exception ex ) {
140
162
Display .handleException (ex , true );
141
163
}
@@ -150,12 +172,22 @@ public void actionPerformed(ActionEvent ev) {
150
172
KeySaltPair pair = PropertyListReader .getKeyAndSaltFromPlist (file );
151
173
Display .DESC .setText ("<html><b>Calculating passcode...</b></html>" );
152
174
Display .refresh ();
153
- String passcode = RestrictionsRecovery .calculate (pair .getKey (), pair .getSalt (), false );
154
- if (passcode == null ) {
155
- throw new Exception ("Passcode could not be found. Key and salt does not correspond to any passcode between 0000 and 9999." );
156
- } else {
157
- JOptionPane .showMessageDialog (null , "Passcode: " + passcode );
158
- }
175
+ Thread thread = new Thread () {
176
+ @ Override
177
+ public void run () {
178
+ try {
179
+ String passcode = RestrictionsRecovery .calculate (pair .getKey (), pair .getSalt (), false );
180
+ if (passcode == null ) {
181
+ throw new Exception ("Passcode could not be found. Key and salt does not correspond to any passcode between 0000 and 9999." );
182
+ } else {
183
+ JOptionPane .showMessageDialog (null , "Passcode: " + passcode , "Passcode found!" , 0 );
184
+ }
185
+ } catch (Exception ex ) {
186
+ Display .handleException (ex , true );
187
+ }
188
+ }
189
+ };
190
+ thread .start ();
159
191
} catch (Exception ex ) {
160
192
Display .handleException (ex , true );
161
193
}
@@ -171,14 +203,26 @@ public void actionPerformed(ActionEvent ev) {
171
203
String port = JOptionPane .showInputDialog ("Device SSH port?" );
172
204
Display .DESC .setText ("<html><b>Calculating passcode...</b></html>" );
173
205
Display .refresh ();
174
- RestrictionsRecovery .downloadViaSSH (ip , Integer .parseInt (port ), password , false );
175
- KeySaltPair pair = PropertyListReader .getKeyAndSaltFromPlist ("password.plist" );
176
- String passcode = RestrictionsRecovery .calculate (pair .getKey (), pair .getSalt (), false );
177
- if (passcode == null ) {
178
- throw new Exception ("Passcode could not be found. Key and salt does not correspond to any passcode between 0000 and 9999." );
179
- } else {
180
- JOptionPane .showMessageDialog (null , "Passcode: " + passcode );
181
- }
206
+ Thread thread = new Thread () {
207
+ @ Override
208
+ public void run () {
209
+ try {
210
+ Display .DESC .setText ("Downloading passcode from device..." );
211
+ RestrictionsRecovery .downloadViaSSH (ip , Integer .parseInt (port ), password , false );
212
+ Display .DESC .setText ("Bruteforcing passcode..." );
213
+ KeySaltPair pair = PropertyListReader .getKeyAndSaltFromPlist ("password.plist" );
214
+ String passcode = RestrictionsRecovery .calculate (pair .getKey (), pair .getSalt (), false );
215
+ if (passcode == null ) {
216
+ throw new Exception ("Passcode could not be found. Key and salt does not correspond to any passcode between 0000 and 9999." );
217
+ } else {
218
+ JOptionPane .showMessageDialog (null , "Passcode: " + passcode , "Passcode found!" , 0 );
219
+ }
220
+ } catch (Exception ex ) {
221
+ Display .handleException (ex , true );
222
+ }
223
+ }
224
+ };
225
+ thread .start ();
182
226
} catch (Exception ex ) {
183
227
Display .handleException (ex , true );
184
228
}
@@ -194,7 +238,7 @@ public void actionPerformed(ActionEvent ev) {
194
238
private static void handleException (Exception ex , boolean message ) {
195
239
ex .printStackTrace ();
196
240
if (message ) {
197
- JOptionPane .showMessageDialog (null , "Error: " + ex .getClass ().toString ().split (" " )[1 ] + ": " + ex .getMessage ());
241
+ JOptionPane .showMessageDialog (null , "Error: " + ex .getClass ().toString ().split (" " )[1 ] + ": " + ex .getMessage (), "An exception has occurred" , 0 );
198
242
}
199
243
}
200
244
}
0 commit comments