0

I have an iOS app that uses both Objective C and Swift. Before including Swift code, the app used a logger which uses c macros. For security reasons, the c macros then implement a mechanism that strips down the logs when building a release version, and that works perfectly fine.

When the Swift code kicked in, a Swift wrapper was made on top of the c macros. So now a log from the Swift code actually calls the swift wrapper which then calls the c macros. And that is not secure, the arguments sent to the swift wrapper should also be hidden otherwise an attacker may still extract some data.

I was thinking about running a custom build phase (shell script) that would delete all the function calls before creating a release build, but am doubtful this is possible.

So my question is: Can adding a custom build phase (run script phase) or maybe even a build rule modify a file before compiling it? Or will I have to write a script that I will need to run manually each time before releasing?

Thanks.

Objectif
  • 364
  • 1
  • 4
  • 12

1 Answers1

0

Yes, it's perfectly acceptable to add a pre-compilation build step to run a script.

NRitH
  • 13,441
  • 4
  • 41
  • 44
  • I know you can add it, but my question was whether that script may modify the Input files. I've been trying out different input and output files, but the scripts don't even run. They are not listed in the build reports. – Objectif Nov 19 '18 at 19:46
  • I don't see why it wouldn't be able to. Even if it couldn't, it should still show up in the build reports. Weird. – NRitH Nov 19 '18 at 21:35