forked from MaxCamillo/android-keystore-password-recover
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSmartWordlistConsumer.java
More file actions
41 lines (33 loc) · 1.02 KB
/
SmartWordlistConsumer.java
File metadata and controls
41 lines (33 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package AndroidKeystoreBrute;
/** ravensbane
*
* @version 1.0 on 20.2.2016
* @author
*/
import java.util.concurrent.LinkedTransferQueue;
public class SmartWordlistConsumer implements Runnable {
private final LinkedTransferQueue<String> queueRef;
public SmartWordlistConsumer(LinkedTransferQueue<String> queue) {
this.queueRef = queue;
}
@Override
public void run() {
String comboToTest = new String();
while (!SmartWordlistPasswd.found && !SmartWordlistPasswd.allPwdsTested) {
try {
comboToTest = queueRef.take();
} catch (InterruptedException e) {
}
if (AndroidKeystoreBrute.minlength > 0 && comboToTest.length() < AndroidKeystoreBrute.minlength) {
// faster not to check length if -l arg isn't specified
} else {
if (SmartWordlistPasswd.keyIsRight(comboToTest.toCharArray())) {
SmartWordlistPasswd.found = true;
SmartWordlistPasswd.complete(comboToTest);
break;
}
}
SmartWordlistPasswd.testedPwds++;
}
}
}