Implement Siri shortcut to sync repository per automation task

This commit is contained in:
Danny Moesch 2020-03-04 20:27:23 +01:00 committed by Mingshen Sun
parent 21b5774cc5
commit b3bde9e0e0
12 changed files with 499 additions and 4 deletions

View file

@ -141,7 +141,7 @@ class GitRepositorySettingsTableViewController: UITableViewController {
self.gitBranchName = branchName.trimmed
self.gitUsername = (gitURL.user ?? usernameTextField.text ?? "git").trimmed
if passwordStore.repositoryExisted() {
if passwordStore.repositoryExists() {
let overwriteAlert: UIAlertController = {
let alert = UIAlertController(title: "Overwrite?".localize(), message: "OperationWillOverwriteData.".localize(), preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Overwrite".localize(), style: .destructive) { _ in

View file

@ -158,7 +158,7 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
}
private func syncPasswords() {
guard passwordStore.repositoryExisted() else {
guard passwordStore.repositoryExists() else {
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(800)) {
Utils.alert(title: "Error".localize(), message: "NoPasswordStore.".localize(), controller: self, completion: nil)
}

View file

@ -37,6 +37,10 @@
<string>We need to access your camera for scanning QR codes.</string>
<key>NSFaceIDUsageDescription</key>
<string>Enable access to Face ID to unlock Pass.</string>
<key>NSUserActivityTypes</key>
<array>
<string>SyncRepositoryIntent</string>
</array>
<key>UIApplicationShortcutItems</key>
<array>
<dict>

View file

@ -0,0 +1,30 @@
"0r0NKK" = "Die Übertragung von lokalen Daten zum entfernten Repository schlug fehl.";
"2jFDLY" = "Synchronisiere das Repository.";
"H2uxch" = "Es wurde kein Passwort für die Kommunikation mit dem Server gespeichert.";
"HO0DF8" = "Es wurde kein Passwort für die Kommunikation mit dem Server gespeichert.";
"IhvhFk" = "Die Synchronisation war erfolgreich.";
"JthclV" = "Es gibt kein lokales Repository.";
"KFGEkd" = "Synchronisiere Repository";
"O9MV3m" = "Die Synchronisation schlug fehl.";
"URQN5E" = "Die Synchronisation war erfolgreich.";
"k4AscG" = "Das Laden von Änderungen vom entfernten Server schlug fehl.";
"kbRWJu" = "Das Laden von Änderungen vom entfernten Server schlug fehl.";
"nuN5Fq" = "Synchronisiere das Repository.";
"qr6SIW" = "Es gibt kein lokales Repository.";
"wB7FJn" = "Die Synchronisation schlug fehl.";
"z8bZQR" = "Die Übertragung von lokalen Daten zum entfernten Repository schlug fehl.";

View file

@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>INEnums</key>
<array/>
<key>INIntentDefinitionModelVersion</key>
<string>1.1</string>
<key>INIntentDefinitionNamespace</key>
<string>wCllDN</string>
<key>INIntentDefinitionSystemVersion</key>
<string>19D76</string>
<key>INIntentDefinitionToolsBuildVersion</key>
<string>11C29</string>
<key>INIntentDefinitionToolsVersion</key>
<string>11.3</string>
<key>INIntents</key>
<array>
<dict>
<key>INIntentCategory</key>
<string>generic</string>
<key>INIntentConfigurable</key>
<true/>
<key>INIntentDefaultImageName</key>
<string>Refresh</string>
<key>INIntentDescription</key>
<string>Sync the password repository.</string>
<key>INIntentDescriptionID</key>
<string>nuN5Fq</string>
<key>INIntentIneligibleForSuggestions</key>
<true/>
<key>INIntentManagedParameterCombinations</key>
<dict>
<key></key>
<dict>
<key>INIntentParameterCombinationSupportsBackgroundExecution</key>
<true/>
<key>INIntentParameterCombinationTitle</key>
<string>Sync repository with server</string>
<key>INIntentParameterCombinationTitleID</key>
<string>2jFDLY</string>
<key>INIntentParameterCombinationUpdatesLinked</key>
<true/>
</dict>
</dict>
<key>INIntentName</key>
<string>SyncRepository</string>
<key>INIntentResponse</key>
<dict>
<key>INIntentResponseCodes</key>
<array>
<dict>
<key>INIntentResponseCodeConciseFormatString</key>
<string>Syncing was successful.</string>
<key>INIntentResponseCodeConciseFormatStringID</key>
<string>URQN5E</string>
<key>INIntentResponseCodeFormatString</key>
<string>Syncing was successful.</string>
<key>INIntentResponseCodeFormatStringID</key>
<string>IhvhFk</string>
<key>INIntentResponseCodeName</key>
<string>success</string>
<key>INIntentResponseCodeSuccess</key>
<true/>
</dict>
<dict>
<key>INIntentResponseCodeConciseFormatString</key>
<string>Syncing failed.</string>
<key>INIntentResponseCodeConciseFormatStringID</key>
<string>wB7FJn</string>
<key>INIntentResponseCodeFormatString</key>
<string>Syncing failed.</string>
<key>INIntentResponseCodeFormatStringID</key>
<string>O9MV3m</string>
<key>INIntentResponseCodeName</key>
<string>failure</string>
</dict>
<dict>
<key>INIntentResponseCodeConciseFormatString</key>
<string>There is no saved passphrase to communicate with the remote repository.</string>
<key>INIntentResponseCodeConciseFormatStringID</key>
<string>H2uxch</string>
<key>INIntentResponseCodeFormatString</key>
<string>There is no saved passphrase to communicate with the remote repository.</string>
<key>INIntentResponseCodeFormatStringID</key>
<string>HO0DF8</string>
<key>INIntentResponseCodeName</key>
<string>noPassphrase</string>
</dict>
<dict>
<key>INIntentResponseCodeConciseFormatString</key>
<string>Pulling changes from the remote repository failed.</string>
<key>INIntentResponseCodeConciseFormatStringID</key>
<string>kbRWJu</string>
<key>INIntentResponseCodeFormatString</key>
<string>Pulling changes from the remote repository failed.</string>
<key>INIntentResponseCodeFormatStringID</key>
<string>k4AscG</string>
<key>INIntentResponseCodeName</key>
<string>pullFailed</string>
</dict>
<dict>
<key>INIntentResponseCodeConciseFormatString</key>
<string>Pushing changes to the remote repository failed.</string>
<key>INIntentResponseCodeConciseFormatStringID</key>
<string>z8bZQR</string>
<key>INIntentResponseCodeFormatString</key>
<string>Pushing changes to the remote repository failed.</string>
<key>INIntentResponseCodeFormatStringID</key>
<string>0r0NKK</string>
<key>INIntentResponseCodeName</key>
<string>pushFailed</string>
</dict>
<dict>
<key>INIntentResponseCodeConciseFormatString</key>
<string>There is no local repository.</string>
<key>INIntentResponseCodeConciseFormatStringID</key>
<string>qr6SIW</string>
<key>INIntentResponseCodeFormatString</key>
<string>There is no local repository.</string>
<key>INIntentResponseCodeFormatStringID</key>
<string>JthclV</string>
<key>INIntentResponseCodeName</key>
<string>noRepository</string>
</dict>
</array>
</dict>
<key>INIntentTitle</key>
<string>Sync Repository</string>
<key>INIntentTitleID</key>
<string>KFGEkd</string>
<key>INIntentType</key>
<string>Custom</string>
<key>INIntentUserConfirmationRequired</key>
<true/>
<key>INIntentVerb</key>
<string>Do</string>
</dict>
</array>
<key>INTypes</key>
<array/>
</dict>
</plist>

View file

@ -4,6 +4,8 @@
<dict>
<key>com.apple.developer.authentication-services.autofill-credential-provider</key>
<true/>
<key>com.apple.developer.siri</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.me.mssun.passforios</string>