mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
wpadebug: Close InputUri activity automatically on DPP URI completion
Check the entered text and stop automatically at the end of full DPP URI. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
83565fd21e
commit
c7d89a87d8
@ -10,6 +10,8 @@ package w1.fi.wpadebug;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.text.TextWatcher;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
@ -34,6 +36,28 @@ public class InputUri extends Activity {
|
|||||||
setContentView(R.layout.input_uri);
|
setContentView(R.layout.input_uri);
|
||||||
mEditText = (EditText)findViewById(R.id.edit_uri);
|
mEditText = (EditText)findViewById(R.id.edit_uri);
|
||||||
mSubmitButton = (Button)findViewById(R.id.submit_uri);
|
mSubmitButton = (Button)findViewById(R.id.submit_uri);
|
||||||
|
|
||||||
|
mEditText.addTextChangedListener(new TextWatcher() {
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before,
|
||||||
|
int count) {
|
||||||
|
mUriText = mEditText.getText().toString();
|
||||||
|
if (mUriText.startsWith("DPP:") &&
|
||||||
|
mUriText.endsWith(";;")) {
|
||||||
|
writeToFile(mUriText);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start,
|
||||||
|
int count, int after) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user