【问题标题】:IPA contains the relative path of my source code in IOSIPA 包含我的源代码在 IOS 中的相对路径
【发布时间】:2020-01-03 05:48:27
【问题描述】:

导出 IPA 后,我将其发送给安全团队进行测试,他们给了我一个 classes paths of my source code 的列表,我如何才能从 ipa 中隐藏此路径?

当我使用fatalError("error message ") 函数时,传递给该函数的消息将与调用fatalError(_:file:line:) 函数的文件和行一起打印到控制台。示例:致命错误:错误消息:文件 /Users/Bart/ErrorHandling/ErrorHandling/ViewController.swift,第 20 行。使用“IDA Starter”反编译ipa我们可以找到包含fatalError函数的类的路径。

【问题讨论】:

  • 我的解决方案对您的问题有效吗?

标签: ios swift security reverse-engineering ipa


【解决方案1】:

您可以创建对 fatalError 的方法调用,并检查是否已发布。并且不会包含文件和行信息。

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")

祝你好运

【讨论】:

    猜你喜欢
    • 2012-01-09
    • 2013-12-21
    • 1970-01-01
    • 2014-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多