Skip to content

Commit

Permalink
v1.08.48
Browse files Browse the repository at this point in the history
Docs: update changelog
Release: version bump to 1.08.48
Fix(autoFill): add popover anchor to document pickers (blind fix attempt for #79)
Feat(autoFill): auto-select found entry if it is a perfect match (#76)
  • Loading branch information
keepassium committed Nov 27, 2019
1 parent 497ced7 commit 1888f86
Show file tree
Hide file tree
Showing 12 changed files with 206 additions and 54 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#CHANGELOG

## [1.08.48] - 2019-11-27

### Added

- AutoFill will automatically select the found entry, if there is only one (closes #76) [thanks, Igor]

### Fixed

- A possible fix for the file picker issues in AutoFill (#79) [thanks, Thorsten]


## [1.08.47] - 2019-11-25

### Changed
Expand Down
35 changes: 27 additions & 8 deletions KeePassium AutoFill/MainCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class MainCoordinator: NSObject, Coordinator {

let allRefs = FileKeeper.shared.getAllReferences(fileType: .database, includeBackup: false)
if allRefs.isEmpty {
let firstSetupVC = FirstSetupVC.make(coordinator: self)
let firstSetupVC = FirstSetupVC.make(delegate: self)
firstSetupVC.navigationItem.hidesBackButton = true
navigationController.pushViewController(firstSetupVC, animated: false)
completion?()
Expand All @@ -196,11 +196,14 @@ class MainCoordinator: NSObject, Coordinator {
}
}

func addDatabase() {
func addDatabase(popoverAnchor: PopoverAnchor) {
let picker = UIDocumentPickerViewController(
documentTypes: FileType.databaseUTIs,
in: .open)
picker.delegate = self
if let popover = picker.popoverPresentationController {
popoverAnchor.apply(to: popover)
}
navigationController.topViewController?.present(picker, animated: true, completion: nil)

addDatabasePicker = picker
Expand Down Expand Up @@ -258,9 +261,12 @@ class MainCoordinator: NSObject, Coordinator {
}
}

func addKeyFile() {
func addKeyFile(popoverAnchor: PopoverAnchor) {
let picker = UIDocumentPickerViewController(documentTypes: FileType.keyFileUTIs, in: .open)
picker.delegate = self
if let popover = picker.popoverPresentationController {
popoverAnchor.apply(to: popover)
}
navigationController.topViewController?.present(picker, animated: true, completion: nil)

addKeyFilePicker = picker
Expand All @@ -273,7 +279,6 @@ class MainCoordinator: NSObject, Coordinator {

func selectKeyFile() {
let vc = KeyFileChooserVC.instantiateFromStoryboard()
vc.coordinator = self
vc.delegate = self
navigationController.pushViewController(vc, animated: true)
}
Expand Down Expand Up @@ -357,16 +362,16 @@ extension MainCoordinator: DatabaseChooserDelegate {
dismissAndQuit()
}

func databaseChooserShouldAddDatabase(_ sender: DatabaseChooserVC) {
func databaseChooserShouldAddDatabase(_ sender: DatabaseChooserVC, popoverAnchor: PopoverAnchor) {
watchdog.restart()
if sender.databaseRefs.count > 0 {
if PremiumManager.shared.isAvailable(feature: .canUseMultipleDatabases) {
addDatabase()
addDatabase(popoverAnchor: popoverAnchor)
} else {
offerPremiumUpgrade(from: sender, for: .canUseMultipleDatabases)
}
} else {
addDatabase()
addDatabase(popoverAnchor: popoverAnchor)
}
}

Expand Down Expand Up @@ -409,7 +414,7 @@ extension MainCoordinator: DatabaseUnlockerDelegate {

extension MainCoordinator: KeyFileChooserDelegate {

func keyFileChooser(_ sender: KeyFileChooserVC, didSelectFile urlRef: URLReference?) {
func didSelectFile(in keyFileChooser: KeyFileChooserVC, urlRef: URLReference?) {
watchdog.restart()
navigationController.popViewController(animated: true)
if let databaseUnlockerVC = navigationController.topViewController as? DatabaseUnlockerVC {
Expand All @@ -418,6 +423,10 @@ extension MainCoordinator: KeyFileChooserDelegate {
assertionFailure()
}
}

func didPressAddKeyFile(in keyFileChooser: KeyFileChooserVC, popoverAnchor: PopoverAnchor) {
addKeyFile(popoverAnchor: popoverAnchor)
}
}

extension MainCoordinator: DatabaseManagerObserver {
Expand Down Expand Up @@ -777,3 +786,13 @@ extension MainCoordinator: CrashReportDelegate {
showDatabaseChooser(canPickDefaultDatabase: false, completion: nil)
}
}

extension MainCoordinator: FirstSetupDelegate {
func didPressCancel(in firstSetup: FirstSetupVC) {
dismissAndQuit()
}

func didPressAddDatabase(in firstSetup: FirstSetupVC, at popoverAnchor: PopoverAnchor) {
addDatabase(popoverAnchor: popoverAnchor)
}
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="sfT-SG-IdV">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15400" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="sfT-SG-IdV">
<device id="retina4_0" orientation="portrait" appearance="dark"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15404"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Databases-->
<scene sceneID="2Uz-Z4-ZqM">
<objects>
<tableViewController storyboardIdentifier="DatabaseChooserVC" modalTransitionStyle="crossDissolve" id="sfT-SG-IdV" customClass="DatabaseChooserVC" customModule="KeePassium_AutoFill" customModuleProvider="target" sceneMemberID="viewController">
<tableViewController storyboardIdentifier="DatabaseChooserVC" modalTransitionStyle="crossDissolve" id="sfT-SG-IdV" customClass="DatabaseChooserVC" customModule="KeePassiumPro_AutoFill" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="j87-X8-qsR">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="detailButton" indentationWidth="10" reuseIdentifier="FileItemCell" textLabel="gs3-2C-fts" detailTextLabel="wKG-yp-SZt" imageView="uJr-zo-xUb" style="IBUITableViewCellStyleSubtitle" id="aPc-lF-R7F" customClass="DatabaseFileListCell" customModule="KeePassium_AutoFill" customModuleProvider="target">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="detailButton" indentationWidth="10" reuseIdentifier="FileItemCell" textLabel="gs3-2C-fts" detailTextLabel="wKG-yp-SZt" imageView="uJr-zo-xUb" style="IBUITableViewCellStyleSubtitle" id="aPc-lF-R7F" customClass="DatabaseFileListCell" customModule="KeePassiumPro_AutoFill" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="320" height="57.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="aPc-lF-R7F" id="rEz-tF-rru">
Expand Down Expand Up @@ -92,7 +92,7 @@
<fragment content="Action"/>
</attributedString>
<connections>
<action selector="didPressAddDatabase:" destination="sfT-SG-IdV" id="GuG-Sx-O7f"/>
<action selector="didPressAddDatabase:" destination="sfT-SG-IdV" id="awm-nj-fj2"/>
</connections>
</barButtonItem>
</navigationItem>
Expand All @@ -109,7 +109,7 @@
<color red="0.23499999940395355" green="0.23499999940395355" blue="0.2630000114440918" alpha="0.60000002384185791" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="PrimaryText">
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</namedColor>
</resources>
</document>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="sWN-0A-UAO">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15400" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="sWN-0A-UAO">
<device id="retina4_7" orientation="portrait" appearance="dark"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15404"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -12,13 +12,13 @@
<!--KeePassium-->
<scene sceneID="dOW-Pb-ioh">
<objects>
<viewController storyboardIdentifier="FirstSetupVC" id="sWN-0A-UAO" customClass="FirstSetupVC" customModule="KeePassium_AutoFill" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="FirstSetupVC" id="sWN-0A-UAO" customClass="FirstSetupVC" customModule="KeePassiumPro_AutoFill" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="6Rn-iq-uS6">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="enW-gs-tra">
<rect key="frame" x="47.5" y="122" width="280" height="44"/>
<rect key="frame" x="47.5" y="124" width="280" height="44"/>
<color key="backgroundColor" name="ActionTint"/>
<constraints>
<constraint firstAttribute="width" constant="280" id="3vK-JY-mNd"/>
Expand All @@ -33,23 +33,23 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="didPressAddDatabase:" destination="sWN-0A-UAO" eventType="touchUpInside" id="F1e-av-prM"/>
<action selector="didPressAddDatabase:" destination="sWN-0A-UAO" eventType="touchUpInside" id="hfo-Mh-zRK"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" layoutMarginsFollowReadableWidth="YES" text="Please re-add databases and key files you want to use with the AutoFill feature." textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="P0M-N3-ynf">
<rect key="frame" x="16" y="63.5" width="343" height="42.5"/>
<rect key="frame" x="16" y="65.5" width="343" height="42.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" name="PrimaryText"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" layoutMarginsFollowReadableWidth="YES" text="AutoFill Setup" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pIl-6L-Msp">
<rect key="frame" x="110" y="16" width="155.5" height="31.5"/>
<rect key="frame" x="104" y="16" width="167.5" height="33.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle1"/>
<color key="textColor" name="PrimaryText"/>
<nil key="highlightedColor"/>
</label>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" verticalCompressionResistancePriority="751" layoutMarginsFollowReadableWidth="YES" editable="NO" textAlignment="natural" adjustsFontForContentSizeCategory="YES" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UAW-0G-N5G">
<rect key="frame" x="16" y="182" width="343" height="477"/>
<rect key="frame" x="16" y="184" width="343" height="475"/>
<string key="text">The AutoFill cannot automatically access the files you already have in the main KeePassium app.

Why? Behind the scenes, the system treats AutoFill as a separate app, independent from the main KeePassium process. For security reasons, an app cannot simply access any external files – unless you explicitly link these files to that app. Thus the system guarantees that the app can only access the few files you allowed it to.
Expand Down Expand Up @@ -103,7 +103,7 @@ As a result, both AutoFill and the main KeePassium app need to be given their ow
<color red="0.23499999940395355" green="0.23499999940395355" blue="0.2630000114440918" alpha="0.60000002384185791" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="PrimaryText">
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</namedColor>
</resources>
</document>
Loading

0 comments on commit 1888f86

Please sign in to comment.