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.png
Initially, 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...