Posts

Post not yet marked as solved
5 Replies
6.3k Views
Is there any compiler flag that we can use to entirely obfuscate string literals?Quick example, an app contains urls for different servers:fileprivate extension Environment { var url: String { switch self { case .dev: return "https://mydevserver.com/api" case .prod: return "https://myprodserver.com/api" } }But once the binary is compiled, it's quite easy to just open it and see the string inside.https://i.ibb.co/3M2zX0F/Screen-Shot.pngInitially, I thought this was just related to Swift literals, but further testing indicates that it also happens to Obj-C string literals.Shouldn't the compiled code be a safe binary, at least obfuscating any literals inside the code base?I would rather not take the path of manipulating the string in the code base, like using it encrypted, base64, or scrambled string literals mixing parts of string, etc...
Posted Last updated
.