问题描述
导出IPA后,我将其发送给安全团队进行测试,他们给了我对我的源代码的路径进行分类,如何在ipa中隐藏该路径?
after exporting IPA, i send it to a security team to test it, and they give me a list of classes paths of my source code, how can i hide this path from the ipa?
当我使用 fatalError(错误消息")
函数时,传递给该函数的消息连同 fatalError(_:file:line:)
函数被调用.示例:致命错误:错误消息:文件/Users/Bart/ErrorHandling/ErrorHandling/ViewController.swift,第20行.使用" IDA Starter "并反编译ipa,我们可以找到包含fatalError函数的类的路径.
when i use fatalError("error message ")
function the message that is passed to the function is printed to the console along with the file and line on which the fatalError(_:file:line:)
function is called. exemple: fatal error: error message: file /Users/Bart/ErrorHandling/ErrorHandling/ViewController.swift, line 20 . using "IDA Starter" and decompile the ipa we can find the path of classes that contains fatalError function.
推荐答案
您可以创建对fatalError的方法调用,并将检查是否为release.并且将不包括文件和行信息.
You can create your method call to fatalError, and will check is release or not. And will not include file and line info.
func myFatalError(_ message: String, file: StaticString = #file, line: UInt = #line) {
#if DEBUG
fatalError(message, file: file)
#else
fatalError(message, file: "", line: 0)
#endif
}
只需调用 myFatalError("Message")
祝你好运
这篇关于IPA包含我的IOS源代码的相对路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!