public static void Launch(Activity act, SearchUrlTask task, ActivityLaunchMode launchMode) { Intent i = new Intent(act, typeof(ShareUrlResults)); task.ToIntent(i); launchMode.Launch(act, i); }
public static void Launch(Activity act, PwGroup g, AppTask appTask, ActivityLaunchMode launchMode) { Intent i = new Intent(act, typeof(GroupActivity)); if (g != null) { i.PutExtra(KeyEntry, g.Uuid.ToHexString()); } appTask.ToIntent(i); launchMode.Launch(act, i); }
public static bool AutoOpenEntry(Activity activity, AutoExecItem item, bool bManual, ActivityLaunchMode launchMode) { string str; PwEntry pe = item.Entry; SprContext ctxNoEsc = new SprContext(pe, item.Database, SprCompileFlags.All); IOConnectionInfo ioc; if (!TryGetDatabaseIoc(item, out ioc)) { return(false); } var ob = GetBoolEx(pe, "SkipIfNotExists", ctxNoEsc); if (!ob.HasValue) // Backw. compat. { ob = GetBoolEx(pe, "Skip if not exists", ctxNoEsc); } if (ob.HasValue && ob.Value) { if (!CheckFileExsts(ioc)) { return(false); } } CompositeKey ck = new CompositeKey(); if (GetString(pe, PwDefs.PasswordField, ctxNoEsc, false, out str)) { ck.AddUserKey(new KcpPassword(str)); } if (GetString(pe, PwDefs.UserNameField, ctxNoEsc, false, out str)) { string strAbs = str; IOConnectionInfo iocKey = IOConnectionInfo.FromPath(strAbs); if (iocKey.IsLocalFile() && !UrlUtil.IsAbsolutePath(strAbs)) { //local relative paths not supported on Android return(false); } ob = GetBoolEx(pe, "SkipIfKeyFileNotExists", ctxNoEsc); if (ob.HasValue && ob.Value) { IOConnectionInfo iocKeyAbs = IOConnectionInfo.FromPath(strAbs); if (!CheckFileExsts(iocKeyAbs)) { return(false); } } try { ck.AddUserKey(new KcpKeyFile(strAbs)); } catch (InvalidOperationException) { Toast.MakeText(Application.Context, Resource.String.error_adding_keyfile, ToastLength.Long).Show(); return(false); } catch (Exception) { throw; } } else // Try getting key file from attachments { ProtectedBinary pBin = pe.Binaries.Get("KeyFile.bin"); if (pBin != null) { ck.AddUserKey(new KcpKeyFile(IOConnectionInfo.FromPath( StrUtil.DataToDataUri(pBin.ReadData(), null)))); } } GetString(pe, "Focus", ctxNoEsc, true, out str); bool bRestoreFocus = str.Equals("Restore", StrUtil.CaseIgnoreCmp); PasswordActivity.Launch(activity, ioc, ck, launchMode, ! bRestoreFocus); App.Kp2a.RegisterChildDatabase(ioc); return(true); }
public static void Launch(Activity act, AppTask appTask, ActivityLaunchMode launchMode) { Launch(act, null, appTask, launchMode); }