complete authentication flow and email verification link implementation ()

* complete authentication flow and email verification link implementation
* send appVersion and deviceId with authentication request
This commit is contained in:
Akinwale Ariwodola 2018-08-16 10:48:34 +01:00 committed by GitHub
parent 1e91a53a8a
commit 413ef66701
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 490 additions and 78 deletions
src/main/java/io/lbry/browser

View file

@ -172,19 +172,10 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
Toast.makeText(context, "Rewards cannot be claimed because we could not identify your device.", Toast.LENGTH_LONG).show();
}
try {
MessageDigest md = MessageDigest.getInstance("SHA-384");
md.update(id.getBytes("UTF-8"));
String hash = new BigInteger(1, md.digest()).toString(16);
SharedPreferences sp = context.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.putString(DEVICE_ID_KEY, hash);
editor.commit();
} catch (NoSuchAlgorithmException | UnsupportedEncodingException ex) {
// SHA-384 not found, UTF-8 encoding not supported
Toast.makeText(context, "Rewards cannot be claimed because we could not identify your device.", Toast.LENGTH_LONG).show();
}
SharedPreferences sp = context.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.putString(DEVICE_ID_KEY, id);
editor.commit();
return id;
}