Я пытаюсь смоделировать атаку грубой силой (чтобы объяснить, как она работает).Я хочу показать процесс взлома пароля «abc».Это требует, чтобы я показал, какой пароль пытается взломать пароль «abc» в этот момент (поэтому начинайте с «a», затем «b», затем «c», пока не достигнете «abc».
MyВопрос в том, как я могу получить пароль, который пытаются в этот момент отобразить на экране, пока код выполняет код?
Было бы проще сделать видео, показывающее этот процесс?
Спасибо
Джейми
edit Вот код, который я написал с комментариями, поясняющими каждую часть. Надеюсь, это поможет мне объяснить проблему.
спасибо за ответы до сих пор
// the simulation
Button btnSim = (Button) findViewById(R.id.btnSim);
btnSim.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
TextView currentSimPword = (TextView) findViewById(R.id.currentSimPword);
int i = 0;//i would be replaced by the string it is trying e.g. a then b then c
//until it reaches abc
while (i < 100) {//this would loop until i reaches abc
//this would show what the brute force attack is attempting against the real password
currentSimPword.setText("comparing password " + i + " against the real password 'abc'");
//at this point i want it to be displayed on screen (and at every time it reaches here)
//here i would need a way to pause it long enough for the user to see what is being tried
//this increases the password tried by one each time in the loop
i = i + 1;
}
}
});