Compare commits
	
		
			2 Commits
		
	
	
		
			v1.12-r1
			...
			bugfix/aut
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					07f08a8851 | ||
| 
						 | 
					d2e0ae6394 | 
@@ -445,6 +445,9 @@ namespace Kp2aAutofillParser
 | 
			
		||||
 | 
			
		||||
        public static string ToCanonicalHint(string hint)
 | 
			
		||||
        {
 | 
			
		||||
            //avoid crash when looking up a null key
 | 
			
		||||
            if (hint == null)
 | 
			
		||||
                return "";
 | 
			
		||||
            string canonicalHint;
 | 
			
		||||
            if (!hintToCanonicalReplacement.TryGetValue(hint, out canonicalHint))
 | 
			
		||||
                canonicalHint = hint;
 | 
			
		||||
@@ -841,6 +844,7 @@ namespace Kp2aAutofillParser
 | 
			
		||||
                        continue;
 | 
			
		||||
                    if (viewHints.Where(h => h != null).Select(AutofillHintsHelper.ToCanonicalHint).Intersect(_autofillHintsForLogin).Any())
 | 
			
		||||
                    {
 | 
			
		||||
 | 
			
		||||
                        AddFieldToHintMap(viewNode, viewHints.Where(h => h != null).Select(AutofillHintsHelper.ToCanonicalHint).ToHashSet().ToArray());
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										24
									
								
								src/keepass2android-app/NullActivity.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								src/keepass2android-app/NullActivity.cs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
using Android.Content.PM;
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
 | 
			
		||||
namespace keepass2android
 | 
			
		||||
{
 | 
			
		||||
    [Activity(Label = AppNames.AppName,
 | 
			
		||||
        MainLauncher = false,
 | 
			
		||||
        Theme = "@style/Kp2aTheme_BlueNoActionBar",
 | 
			
		||||
        Exported = true)] 
 | 
			
		||||
    ///For autofill, we sometimes need to pass an intent to an inline presentation which never gets fired. We use this as a dummy activity.
 | 
			
		||||
    public class NullActivity: Activity
 | 
			
		||||
    {
 | 
			
		||||
        protected override void OnCreate(Bundle savedInstanceState)
 | 
			
		||||
        {
 | 
			
		||||
            Kp2aLog.Log("NullActivity.OnCreate - this is unexpected.");
 | 
			
		||||
            base.OnCreate(savedInstanceState);
 | 
			
		||||
            Finish();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -30,10 +30,9 @@ namespace keepass2android.services.AutofillBase
 | 
			
		||||
            {
 | 
			
		||||
                return null;
 | 
			
		||||
            }
 | 
			
		||||
            //make sure we have a pendingIntent always not null
 | 
			
		||||
            pendingIntent ??= PendingIntent.GetService(context, 0, new Intent(),
 | 
			
		||||
                Util.AddMutabilityFlag(PendingIntentFlags.OneShot | PendingIntentFlags.UpdateCurrent, PendingIntentFlags.Mutable));
 | 
			
		||||
            
 | 
			
		||||
            // If the pending intent is null, we need to create a dummy one to avoid a crash
 | 
			
		||||
            pendingIntent ??= PendingIntent.GetActivity(context, 0, new Intent(context, typeof(NullActivity)), PendingIntentFlags.OneShot | PendingIntentFlags.UpdateCurrent | PendingIntentFlags.Immutable);
 | 
			
		||||
 | 
			
		||||
            var slice = CreateInlinePresentationSlice(
 | 
			
		||||
                inlinePresentationSpec,
 | 
			
		||||
                text,
 | 
			
		||||
 
 | 
			
		||||
@@ -405,7 +405,7 @@ namespace keepass2android.services.AutofillBase
 | 
			
		||||
            var datasetBuilder = new Dataset.Builder(presentation);
 | 
			
		||||
            datasetBuilder.SetAuthentication(pendingIntent?.IntentSender);
 | 
			
		||||
 | 
			
		||||
            AutofillHelper.AddInlinePresentation(this, inlinePresentationSpec, text, datasetBuilder, Resource.Drawable.baseline_close_24, null);
 | 
			
		||||
            AutofillHelper.AddInlinePresentation(this, inlinePresentationSpec, text, datasetBuilder, Resource.Drawable.baseline_close_24, pendingIntent);
 | 
			
		||||
 | 
			
		||||
            foreach (var autofillId in autofillIds)
 | 
			
		||||
            {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user