首次提交时 pre-commit 会下载并编译 swiftlint、swiftformat 等工具,耗时较长;调试日志默认关闭,需在 scheme 中手动设置 me.proton.pass.NetworkDebug 或 me.proton.pass.SentryDebug 环境变量;生成 mock 前需给协议加 // sourcery: AutoMockable 注解再运行 sourcery
ios-pass
protonpassGPL-3.0活跃维护Proton Pass 的 iOS 客户端,用端到端加密管理密码和登录凭据,方便在 iPhone 上安全存取账号信息。
iOS client for Proton Pass
brew install swiftlint
brew install swiftformat
brew install pre-commit
pre-commit install --hook-type pre-commitREADME 未说明;仅要求 iOS 16 及以上、Xcode 15+ 的 macOS 开发环境
Proton Pass 的 iOS 客户端源码,供需要构建或二次开发密码管理器的工程师使用
Proton Pass 的 iOS 客户端,用端到端加密管理密码和登录凭据,方便在 iPhone 上安全存取账号信息。
核心能力
- 用 SwiftUI 编写全部视图
- 用 UIKit 的 UINavigationController 和 UISplitViewController 处理导航
- 拆分为 iOS 主 target、AutoFill 扩展和多个本地 Swift 包
- 用 Factory 做依赖注入,用 Sourcery 生成测试 mock
- 通过环境变量开启网络与 Sentry 调试日志
容易踩的坑
暂无 release 数据(可能没有发版,或尚未同步)。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Proton Pass
This repository contains the source code for the Proton Pass iOS application.
Installation
The app targets iOS 16 and above. Make sure you have Xcode 15+ installed, check out the repo and open ProtonPass.xcodeproj to run the project.
Technical Choices
UI
- All the views are written in SwiftUI
- Navigation between views are done using UIKit:
UINavigationControllerwhen running on iPhonesUISplitViewControllerwhen running on iPads
Dependency manager
CocoaPods & Swift Package Manager
Modularization
The project is modularized into targets:
- iOS: the main app target
- AutoFill: the AutoFill extension
And local Swift packages:
- Entities: models
- Client: network layer, database operations, repositories...
- Core: coordinator, domain parser, password/passphrase generator, 2FA token generator, useful extensions...
- DesignSystem: UI utilities (custom views, view modifiers, icons, colors...)
- Macro: macro
- UseCases: use cases, interface for Rust library
Debug
Debug network traffic
You can print to the console information related to requests (HTTP method, path, headers, & parameters) and responses (HTTP method, status code, url, headers & result) by activating me.proton.pass.NetworkDebug environment variable in the scheme configuration. This is disabled by default.
Debug Sentry activities
You can print to the console Sentry activities by activating me.proton.pass.SentryDebug environment variable in the scheme configuration. This is disabled by default.
Tools
Dependency injection
The main DI tool used is Factory. It is very light but yet very powerful.
SwiftLint
This is the main linter for the project. To install run the following Homebrew command:
brew install swiftlint
If you don't have this tool installed please refer to the following link to set it up: SwiftLint
The configuration for this tool can be found in the .swiftlint.yml file.
SwiftFormat
This is the main code reformatting tool for the project. To install run the following Homebrew command:
brew install swiftformat
If you don't have this tool installed please refer to the following link to set it up: SwiftFormat
The configuration for this tool can be found in the .swiftformat file
Pre-commit
Make sure codes are properly linted and formatted before committing.
First install pre-commit
brew install pre-commit
Then create a pre-commit hook
pre-commit install --hook-type pre-commit
After initializing pre-commit for the repo, the next first commit will take a bit of time because pre-commit needs to download and compile necessary tools configured in .pre-commit-config.yaml (swiftlint, swiftformat...)
Sourcery
This is a tool to easily generate mocks for unit testing. To install it run the following Homebrew command:
brew install sourcery
If you don't have this tool installed please refer to the following link to set it up: Sourcery
The configuration for this tool can be found in the .sourcery.yml file.
At the moment the configuration only take into account iOSTests but it could be extended to take into account dependencies in the near future.
To Generate the mocks please follow these instructions:
- First you need to annotate your protocol like following:
// sourcery: AutoMockable
protocol Test {
// implementation of protocol
}
- Then run the following CLI command
sourcery
You should now see the new mocks appear in the Generated subfolder of iOSTests target
Changelog
For a detailed list of changes in each version of the project, please refer to the CHANGELOG file.
License
The code and data files in this distribution are licensed under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. See https://www.gnu.org/licenses/ for a copy of this license.
See LICENSE file