allow to use ykDroid instead of built-in activity

This commit is contained in:
Philipp Crocoll
2018-07-02 12:03:32 +02:00
parent 48f57eea66
commit 6e96021047

View File

@@ -125,10 +125,26 @@ namespace keepass2android
public Intent GetYubichallengeIntent(byte[] challenge)
{
Intent chalIntent = new Intent(this, typeof(YubiChallengeActivity));
chalIntent.PutExtra("challenge", challenge);
return chalIntent;
{
Intent chalIntent = new Intent("net.pp3345.ykdroid.intent.action.CHALLENGE_RESPONSE");
chalIntent.PutExtra("challenge", challenge);
IList<ResolveInfo> activities = PackageManager.QueryIntentActivities(chalIntent, 0);
bool isIntentSafe = activities.Count > 0;
if (isIntentSafe)
{
return chalIntent;
}
}
{
Intent chalIntent = new Intent(this, typeof(YubiChallengeActivity));
chalIntent.PutExtra("challenge", challenge);
return chalIntent;
}
}
}
}