CryptoNOTE Open Source
Android Open Source
We read a file with text and do the simplest decoding.
//==========================================================
// READ oflameron.txt file
//==========================================================
public void Load(View view) {
if (enterpwd == dinpwd + 10) { //Here's the processing of the dynamic password algorithm. Entered a number 10 more?
try {//Read data file oflameron.txt
// Opening a stream for reading
BufferedReader br = new BufferedReader(new InputStreamReader(
openFileInput(FILENAME)));
// читаем содержимое
while ((str = br.readLine()) != null) {
lenght = str.length(); //Number of data read from the oflameron.txt file. Needed for decoding
str2 = str; //Save read data
// (c) by Valery Shmelev http://oflameron.com
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
DECode(); //Decode data file oflameron.txt The decoded text will be written to a variable str2
EditText EText = findViewById(R.id.editText1);//Let's find EditText
EText.setText(str2);//Let's show the decoded text - write it from a variable str2 to EditText
Log.d(LOG_TAG, "== == Password OK == ==" + enterpwd + " " + dinpwd);
} else {
EditText EText = findViewById(R.id.editText1);//Let's find EditText
EText.setText("== PASSWORD ERROR ==");
Log.d(LOG_TAG, "== == Incorrect Password == ==" + enterpwd + " " + dinpwd);
}
}
Comments
Post a Comment