A Swift Package Manager build tool plugin that supports obfuscating Swift literals embedded in libraries and executables.
Please see the Swift Confidential documentation for more detailed usage instructions.
You can use this plugin with both SwiftPM and Xcode targets, depending on your needs. Please see the relevant section below for detailed installation instructions.
To use the Swift Confidential plugin with your SwiftPM target, add it to the package's dependencies and then to your target's plugins:
// swift-tools-version: 5.7
import PackageDescription
let package = Package(
// name, platforms, products, etc.
dependencies: [
// other dependencies
.package(url: "https://github.com/securevale/swift-confidential-plugin.git", .upToNextMinor(from: "0.3.0"))
],
targets: [
.target(
// name, dependencies, resources, etc.
plugins: [
// other plugins
.plugin(name: "Confidential", package: "swift-confidential-plugin")
]
)
]
)
To use the Swift Confidential plugin directly with your Xcode target:
- Add
swift-confidential-plugin
package to your Xcode project. Please refer to the official documentation for step-by-step instructions on how to add package dependencies. - Then, navigate to your target’s
Build Phases
pane, and in theRun Build Tool Plug-ins
section, click the+
button, select theConfidential
plugin, and click theAdd
button.
Important
Due to the limitations of XcodeProjectPlugin API, the confidential.yml
configuration file must be located in the Xcode project's top-level directory, meaning that you cannot create distinct sets of secret literals for different Xcode targets. Hopefully, this behavior will be improved in the future.
This project follows semantic versioning. The plugin's releases are synced with Swift Confidential releases.
This plugin is released under Apache License v2.0 with Runtime Library Exception. Please see LICENSE for more information.