{"id":21748307,"url":"https://github.com/surfstudio/surf-swiftobfuscator","last_synced_at":"2025-04-13T07:13:30.162Z","repository":{"id":185302655,"uuid":"508161223","full_name":"surfstudio/Surf-SwiftObfuscator","owner":"surfstudio","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-26T15:21:02.000Z","size":27,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-13T07:13:25.660Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/surfstudio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-06-28T05:04:11.000Z","updated_at":"2024-09-26T15:02:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"472b5ee7-2f94-4b55-93e4-c588f0288f98","html_url":"https://github.com/surfstudio/Surf-SwiftObfuscator","commit_stats":null,"previous_names":["surfstudio/surf-swiftobfuscator"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surfstudio%2FSurf-SwiftObfuscator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surfstudio%2FSurf-SwiftObfuscator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surfstudio%2FSurf-SwiftObfuscator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surfstudio%2FSurf-SwiftObfuscator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/surfstudio","download_url":"https://codeload.github.com/surfstudio/Surf-SwiftObfuscator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248675422,"owners_count":21143768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-26T08:13:00.245Z","updated_at":"2025-04-13T07:13:29.333Z","avatar_url":"https://github.com/surfstudio.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftObfuscator\n\n[![GitHubActions Build Status](https://github.com/surfstudio/Surf-SwiftObfuscator/workflows/Build/badge.svg)](https://github.com/surfstudio/Surf-SwiftObfuscator/actions)\n[![SPM Compatible](https://img.shields.io/badge/SPM-compatible-blue.svg)](https://github.com/apple/swift-package-manager)\n\nByte Code Obfuscator for Strings Encrypting.\n\n[![SwiftObfuscator](https://i.ibb.co/g9wMLyb/Surf-Obfuscator.png)](https://github.com/surfstudio/SurfPlaybook)\n\n## About\n\nEncrypts a string literal, adds a decryption extension to the file with the encrypted string.\n\n## Installation\n\n#### Swift Package Manager\n\n- Into the Xcode `File \u003e Swift Packages \u003e Add Package Dependency`\n- Enter repository URL `https://github.com/surfstudio/Surf-SwiftObfuscator`\n\n## Usage\n\n- Right click on the package and select \"Show in Finder\"\n- Right-click on the folder with the \"Surf-SwiftObfuscator\" package and select \"new terminal by folder adress\" from the context menu\n- In the terminal `swift run SwiftObfuscator [Parameters]`\n\nParameters:\n\n`-f` or `--file-path \u003cfile-path\u003e` Path to the file where you want to obfuscate strings.\n\n`-s` or `--salt \u003csalt\u003e` Salt that the strings should be obfuscated with.\n\n`-l` or `--line \u003cline\u003e` The line number on which strings should be obfuscated. By default, all lines will be obfuscated.\n\n\n#### Example\n\nTo obfuscate all lines in a file in the terminal that opens, type:\n\n```bash\nswift run SwiftObfuscator -f ../MyProject/Tokens.swift -s somesalt\n```\nIf you need to obfuscate a specific string then use:\n\n```bash\nswift run SwiftObfuscator -f ../MyProject/Tokens.swift -s somesalt -l 135\n```\n\n#### Result example\n\n\u003cdetails\u003e\nFile before change:\n\n```swift\nimport UIKit\n\nclass ViewController: UIViewController {\n\n    enum Tokens {\n        static let value1 = \"value1\"\n        static let value2 = \"value2\"\n        static let value3 = \"value3\"\n    }\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        print(\"string1\", \"string2\")\n    }\n\n}\n```\n\nFile after change:\n\n```swift\n// swiftlint:disable line_length\nimport Obfuscator\n\nimport UIKit\n\nclass ViewController: UIViewController {\n\n    enum Tokens {\n    // Obfuscated from \"value1\"\n        static let value1 = Obfuscator.default.reveal(key: [7, 22, 9, 7, 20, 70]) ?? \"\"\n    // Obfuscated from \"value2\"\n        static let value2 = Obfuscator.default.reveal(key: [7, 22, 9, 7, 20, 69]) ?? \"\"\n    // Obfuscated from \"value3\"\n        static let value3 = Obfuscator.default.reveal(key: [7, 22, 9, 7, 20, 68]) ?? \"\"\n    }\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        print(Obfuscator.default.reveal(key: [2, 3, 23, 27, 31, 16, 84]) ?? \"\", Obfuscator.default.reveal(key: [2, 3, 23, 27, 31, 16, 87]) ?? \"\")\n    }\n\n}\n\nfileprivate extension Obfuscator {\n\n    @inline(__always)\n    static var `default`: Obfuscator {\n        return Obfuscator(withSalt: \"qwer\")\n    }\n\n}\n```\n\n\u003c/details\u003e\n\n## Changelog\n\nYou can see list of all changes in this [file](./CHANGELOG.md).\n\n## License\n\n[MIT License](./LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurfstudio%2Fsurf-swiftobfuscator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsurfstudio%2Fsurf-swiftobfuscator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurfstudio%2Fsurf-swiftobfuscator/lists"}