This repository contains the source code for the Proton Pass iOS application.
The app targets iOS 15 and above. Make sure you have Xcode 14+ installed, check out the repo and open ProtonPass.xcworkspace
to run the project.
- All the views are written in SwiftUI
- Navigation between views are done using UIKit:
UINavigationController
when running on iPhonesUISplitViewController
when running on iPads
CocoaPods & Swift Package Manager
The project is modularized into targets:
- iOS: the main app target
- AutoFill: the AutoFill extension
- Client: network layer, database operation & models
- Core: coordinator, domain parser, password/passphrase generator, 2FA token generator, useful extensions...
- UIComponents: UI utilities (custom views, view modifiers, icons, colors...)
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.
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.
The main DI tool used is Factory. It is very light but yet very powerful.
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.
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
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 futur.
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
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