Compare commits
1 Commits
2458--seed
...
1327--repl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f08e0039b |
@@ -937,9 +937,8 @@ namespace keepass2android
|
|||||||
iv.SetImageDrawable(Resources.GetDrawable(Resource.Drawable.ic00));
|
iv.SetImageDrawable(Resources.GetDrawable(Resource.Drawable.ic00));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SupportActionBar.Title = Entry.Strings.ReadSafe(PwDefs.TitleField);
|
SupportActionBar.Title = Entry.Strings.ReadSafe(PwDefs.TitleField);
|
||||||
|
SupportActionBar.Title = SprEngine.Compile(SupportActionBar.Title, new SprContext(Entry, App.Kp2a.CurrentDb.KpDatabase, SprCompileFlags.All));
|
||||||
SupportActionBar.SetDisplayHomeAsUpEnabled(true);
|
SupportActionBar.SetDisplayHomeAsUpEnabled(true);
|
||||||
SupportActionBar.SetHomeButtonEnabled(true);
|
SupportActionBar.SetHomeButtonEnabled(true);
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,17 @@ namespace PluginTOTP
|
|||||||
_muteWarnings = muteWarnings;
|
_muteWarnings = muteWarnings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if specified Entry contains Settings that are not null.
|
||||||
|
/// </summary>
|
||||||
|
internal bool SettingsCheck(IDictionary<string, string> entryFields)
|
||||||
|
{
|
||||||
|
string settings;
|
||||||
|
entryFields.TryGetValue(SettingsFieldName, out settings);
|
||||||
|
return !String.IsNullOrEmpty(settings);
|
||||||
|
}
|
||||||
|
|
||||||
internal bool HasSeed(IDictionary<string, string> entryFields)
|
internal bool SeedCheck(IDictionary<string, string> entryFields)
|
||||||
{
|
{
|
||||||
string seed;
|
string seed;
|
||||||
entryFields.TryGetValue(SeedFieldName, out seed);
|
entryFields.TryGetValue(SeedFieldName, out seed);
|
||||||
@@ -92,14 +101,14 @@ namespace PluginTOTP
|
|||||||
|
|
||||||
private string[] SettingsGet(IDictionary<string, string> entryFields)
|
private string[] SettingsGet(IDictionary<string, string> entryFields)
|
||||||
{
|
{
|
||||||
return entryFields.TryGetValue(SettingsFieldName, out var settings) ? settings.Split(';') : new[] { "30", "6" };
|
return entryFields[SettingsFieldName].Split(';');
|
||||||
}
|
}
|
||||||
|
|
||||||
public TotpData GetTotpData(IDictionary<string, string> entryFields)
|
public TotpData GetTotpData(IDictionary<string, string> entryFields)
|
||||||
{
|
{
|
||||||
TotpData res = new TotpData();
|
TotpData res = new TotpData();
|
||||||
|
|
||||||
if (HasSeed(entryFields))
|
if (SettingsCheck(entryFields) && SeedCheck(entryFields))
|
||||||
{
|
{
|
||||||
bool ValidInterval; bool ValidLength; bool ValidUrl;
|
bool ValidInterval; bool ValidLength; bool ValidUrl;
|
||||||
if (SettingsValidate(entryFields, out ValidInterval, out ValidLength, out ValidUrl))
|
if (SettingsValidate(entryFields, out ValidInterval, out ValidLength, out ValidUrl))
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ using KeePassLib;
|
|||||||
using KeePassLib.Utility;
|
using KeePassLib.Utility;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using KeePass.Util.Spr;
|
||||||
|
|
||||||
namespace keepass2android.search
|
namespace keepass2android.search
|
||||||
{
|
{
|
||||||
@@ -294,7 +295,10 @@ namespace keepass2android.search
|
|||||||
return Position.ToString(CultureInfo.InvariantCulture);
|
return Position.ToString(CultureInfo.InvariantCulture);
|
||||||
case 1: // SuggestColumnText1
|
case 1: // SuggestColumnText1
|
||||||
string username = CurrentEntry.Strings.ReadSafe(PwDefs.UserNameField);
|
string username = CurrentEntry.Strings.ReadSafe(PwDefs.UserNameField);
|
||||||
return CurrentEntry.Strings.ReadSafe(PwDefs.TitleField) + (string.IsNullOrWhiteSpace(username) ? "" : " ("+username+")");
|
username = SprEngine.Compile(username, new SprContext(CurrentEntry, App.Kp2a.CurrentDb.KpDatabase, SprCompileFlags.All));
|
||||||
|
var title = CurrentEntry.Strings.ReadSafe(PwDefs.TitleField);
|
||||||
|
title = SprEngine.Compile(title, new SprContext(CurrentEntry, App.Kp2a.CurrentDb.KpDatabase, SprCompileFlags.All));
|
||||||
|
return title + (string.IsNullOrWhiteSpace(username) ? "" : " ("+username+")");
|
||||||
case 2: // SuggestColumnText2
|
case 2: // SuggestColumnText2
|
||||||
return Internationalise(_entriesWithContexts[Position].resultContext);
|
return Internationalise(_entriesWithContexts[Position].resultContext);
|
||||||
case 3: // SuggestColumnIcon1
|
case 3: // SuggestColumnIcon1
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using Android.OS;
|
|||||||
using Android.Runtime;
|
using Android.Runtime;
|
||||||
using Android.Views;
|
using Android.Views;
|
||||||
using Android.Widget;
|
using Android.Widget;
|
||||||
|
using KeePass.Util.Spr;
|
||||||
using keepass2android.services.AutofillBase;
|
using keepass2android.services.AutofillBase;
|
||||||
using keepass2android.services.AutofillBase.model;
|
using keepass2android.services.AutofillBase.model;
|
||||||
using Keepass2android.Pluginsdk;
|
using Keepass2android.Pluginsdk;
|
||||||
@@ -108,6 +109,7 @@ namespace keepass2android.services.Kp2aAutofill
|
|||||||
|
|
||||||
|
|
||||||
fieldCollection.DatasetName = pwEntry.Strings.ReadSafe(PwDefs.TitleField);
|
fieldCollection.DatasetName = pwEntry.Strings.ReadSafe(PwDefs.TitleField);
|
||||||
|
fieldCollection.DatasetName = SprEngine.Compile(fieldCollection.DatasetName, new SprContext(pwEntry, App.Kp2a.CurrentDb.KpDatabase, SprCompileFlags.All));
|
||||||
|
|
||||||
return fieldCollection;
|
return fieldCollection;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ namespace keepass2android.view
|
|||||||
}
|
}
|
||||||
|
|
||||||
String title = pw.Strings.ReadSafe(PwDefs.TitleField);
|
String title = pw.Strings.ReadSafe(PwDefs.TitleField);
|
||||||
|
title = SprEngine.Compile(title, new SprContext(_entry, db.KpDatabase, SprCompileFlags.All));
|
||||||
var str = new SpannableString(title);
|
var str = new SpannableString(title);
|
||||||
|
|
||||||
if (isExpired)
|
if (isExpired)
|
||||||
|
|||||||
Reference in New Issue
Block a user