|
|
@ -1006,22 +1006,22 @@ public class Helper {
|
|
|
|
prefs.edit().remove("last_authentication").apply();
|
|
|
|
prefs.edit().remove("last_authentication").apply();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void selectKeyAlias(final Activity activity, final LifecycleOwner owner, final String email, final IKeyAlias intf) {
|
|
|
|
static void selectKeyAlias(final Activity activity, final LifecycleOwner owner, final String alias, final IKeyAlias intf) {
|
|
|
|
final Context context = activity.getApplicationContext();
|
|
|
|
final Context context = activity.getApplicationContext();
|
|
|
|
final Handler handler = new Handler();
|
|
|
|
final Handler handler = new Handler();
|
|
|
|
|
|
|
|
|
|
|
|
new Thread(new Runnable() {
|
|
|
|
new Thread(new Runnable() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
public void run() {
|
|
|
|
if (email != null)
|
|
|
|
if (alias != null)
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (KeyChain.getPrivateKey(context, email) != null) {
|
|
|
|
if (KeyChain.getPrivateKey(context, alias) != null) {
|
|
|
|
Log.i("Private key available alias=" + email);
|
|
|
|
Log.i("Private key available alias=" + alias);
|
|
|
|
handler.post(new Runnable() {
|
|
|
|
handler.post(new Runnable() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
public void run() {
|
|
|
|
if (owner.getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
|
|
|
if (owner.getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
|
|
|
intf.onSelected(email);
|
|
|
|
intf.onSelected(alias);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -1063,7 +1063,7 @@ public class Helper {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
null, null, null, -1, email);
|
|
|
|
null, null, null, -1, alias);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|