- Classes
- Structs
- Methods
- Properties
- Enums (except ones that inherit from
CodingKey
) - Enum cases
typealias
andassociatedtypes
: SourceKit doesn't always index them, so we avoid them to prevent broken projects. Note that these can't be reverse engineered as they are purely an editor thing, so avoiding them isn't a problem!- Module names: Not implemented yet, but possible.
- Local content inside methods (like argument names and inner properties). They aren't indexed, but they also can't be reverse engineered.
These are problems that SourceKit has that are unrelated to a specific feature, which means that we can't disable them to save you. If your project is affected by any of these problems, you will need to manually fix your project after obfuscating as it will not compile. This is not a complete list -- if you discover a problem that is not here, please open an issue.
Note: You can use the --ignore-targets
argument to completely disable the obfuscation of specific targets.
- (SR-9020) Legacy KeyPaths that include types (like
#keyPath(Foo.bar)
) will not get indexed. - (SR-12837)
@objc optional
protocol methods don't have their references indexed.
App Extensions that use NSExtensionPrincipalClass
or variants in their Info.plist
(like Rich Notifications/Watch apps and the SceneDelegate in iOS 13) will have such references obfuscated as well, but will assume that you haven't changed them from their default $(PRODUCT_MODULE_NAME).ClassName
value. If you modified these plists to point to classes in different modules, you'll have to manually update these plists after running SwiftShield.
The --ignore-public
(or SDK Mode) obfuscates your app while ignoring anything with the public
or open
access controls. However, some SourceKit bugs prevent it from working 100% as intended.
SourceKit has a problem where it can't detect content inside public extensions as such. For example, the following snippet will correctly avoid obfuscating myMethod()
:
extension Int {
public func myMethod() {}
}
This one however, will be incorrectly obfuscated as SourceKit doesn't recognize myMethod()
as being public (even though it is).
public extension Int {
func myMethod() {}
}
If you're using --ignore-public
, make sure your public extensions follow the pattern from the first snippet.