Merge branch 'develop' into feature/passextension

This commit is contained in:
Yishi Lin 2017-06-14 20:24:11 +08:00
commit 33fff2afaf
2 changed files with 16 additions and 18 deletions

View file

@ -5,25 +5,26 @@
![Swift 3.1](https://img.shields.io/badge/Swift-3.1-orange.svg) ![Swift 3.1](https://img.shields.io/badge/Swift-3.1-orange.svg)
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/passforios/passforios) [![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/passforios/passforios)
[![Build Status](https://travis-ci.org/mssun/passforios.svg?branch=develop)](https://travis-ci.org/mssun/passforios) [![Build Status](https://travis-ci.org/mssun/passforios.svg?branch=develop)](https://travis-ci.org/mssun/passforios)
[![Donate](https://img.shields.io/badge/Paypal-donate-blue.svg)](https://www.paypal.me/mssun)
Pass is an iOS client compatible with [ZX2C4's Pass command line Pass is an iOS client compatible with [ZX2C4's Pass command line
application](http://www.passwordstore.org/). It is a password manager using application](http://www.passwordstore.org/). It is a password manager using
GPG for encryption and Git for version control. GPG for encryption and Git for version control.
Pass for iOS is under *TestFlight external testing*. Drop an email to Pass for iOS is available in the [App Store](https://appsto.re/us/DY13hb.i)
`developer@passforios.mssun.me` for testing. Thank you. with the name "Pass - Password Store". If you want to join the iOS beta via
Testflight, drop an email to `developer@passforios.mssun.me`. Thank you.
## Features ## Features
- Try to be compatible with the Password Store command line tool - Try to be compatible with the Password Store command line tool
- Support to view, copy, add, edit password entries - Support to view, copy, add, and edit password entries
- Encrypt and decrypt password entries by PGP keys - Encrypt and decrypt password entries by PGP keys
- Synchronize with your password Git repository - Synchronize with your password Git repository
- User-friendly interface: search, long press to copy, copy and open link, etc. - User-friendly interface: search, long press to copy, copy and open link, etc.
- Support one-time password (OTP) tokens (QR code and otpauth URI) - Support one-time password (OTP) tokens (QR code and otpauth URI)
- Written in Swift - Written in Swift
- No need to jailbreak your devices - No need to jailbreak your devices
- Get from App Store (stay tuned)
## Screenshots ## Screenshots
@ -34,7 +35,15 @@ Pass for iOS is under *TestFlight external testing*. Drop an email to
<img src="screenshot/screenshot3.png" width="200"/> <img src="screenshot/screenshot3.png" width="200"/>
</p> </p>
## Build ## Usages
- Setup your password-store ([official `Pass` introduction](https://www.passwordstore.org/))
- Get Pass for iOS from the App Store or build one by yourself
- Start to use Pass for iOS on your iPhone/iPad ([quick-start guide](https://github.com/mssun/passforios/wiki#quick-start-guide-for-pass-for-ios))
For more, please read the [wiki page](https://github.com/mssun/pass-ios/wiki).
## Building Pass for iOS
1. Install libtool, automake, cmake, carthage, and cocoapods: `brew install 1. Install libtool, automake, cmake, carthage, and cocoapods: `brew install
libtool automake cmake carthage cocoapods` libtool automake cmake carthage cocoapods`
@ -44,16 +53,6 @@ Pass for iOS is under *TestFlight external testing*. Drop an email to
4. Open `.xcworkspace` file in Xcode. 4. Open `.xcworkspace` file in Xcode.
5. Build & Run. 5. Build & Run.
## Usage
- Generate a PGP key pair
- Use the `pass` command line tool
- Push encrypted password store to a private Git repository
- Build Pass for iOS by yourself or download from App Store
- Start to use Pass for iOS on your iPhone/iPad
For more, please read the [wiki page](https://github.com/mssun/pass-ios/wiki).
## License ## License
MIT MIT

View file

@ -267,7 +267,7 @@ public class PasswordStore {
public func getPasswordEntity(by path: String, isDir: Bool) -> PasswordEntity? { public func getPasswordEntity(by path: String, isDir: Bool) -> PasswordEntity? {
let passwordEntityFetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: "PasswordEntity") let passwordEntityFetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: "PasswordEntity")
do { do {
passwordEntityFetchRequest.predicate = NSPredicate(format: "path = %@ and isDir = %@", path, isDir.description) passwordEntityFetchRequest.predicate = NSPredicate(format: "path = %@ and isDir = %@", path, isDir as NSNumber)
return try context.fetch(passwordEntityFetchRequest).first as? PasswordEntity return try context.fetch(passwordEntityFetchRequest).first as? PasswordEntity
} catch { } catch {
fatalError("Failed to fetch password entities: \(error)") fatalError("Failed to fetch password entities: \(error)")
@ -288,8 +288,7 @@ public class PasswordStore {
if fm.fileExists(atPath: storeURL.path) { if fm.fileExists(atPath: storeURL.path) {
try fm.removeItem(at: storeURL) try fm.removeItem(at: storeURL)
} }
try fm.copyItem(at: tempStoreURL, to: storeURL) try fm.moveItem(at: tempStoreURL, to: storeURL)
try fm.removeItem(at: tempStoreURL)
storeRepository = try GTRepository(url: storeURL) storeRepository = try GTRepository(url: storeURL)
} catch { } catch {
credential.delete() credential.delete()