SwiftShield: Obfuscation using SwiftShield gives error

与世无争的帅哥 提交于 2020-05-14 12:01:46

问题


I want to obfuscate Swift code using SwiftShield. I have integrated using Cocoapods.

To run it, I am using below SwiftShield tool in terminal:

swiftshield -automatic -project-root /app/MyApp -automatic-project-file 
/app/MyApp/MyApp.xcworkspace -automatic-project-scheme MyApp-AppStore

Getting error:

-bash: swiftshield: command not found

I have copied swiftshield executable from pods to /usr/local/bin and tried the same command, but still getting below error

dyld: Library not loaded: @rpath/sourcekitd.framework/Versions/A/sourcekitd
Referenced from: /usr/local/bin/swiftshield
Reason: image not found
Abort trap: 6

What could be the issue? How to install SwiftShield


回答1:


Issue was related with Xcode path. I had 2 Xcode versions were installed on my machine.

/Applications/Xcode10.3.1.app

/Applications/Xcode11.1.app

I deleted Xcode10.3.1.app and renamed Xcode11.1.app to Xcode.app. Issue got resolved now. https://github.com/rockbruno/swiftshield/issues/71#event-2832206369

Steps to use swiftshield(Manual mode):

  1. Download swiftshield executable on desktop https://github.com/rockbruno/swiftshield/releases
  2. Command line - Go to desktop and give executable permission
sudo chmod 755 swiftshield
  1. Move swiftlint to /usr/bin
sudo cp swiftshield /usr/local/bin
  1. Check if it is installed properly
swiftshield --help
  1. Change permission of project root folder in order to rename obfuscated code
chmod -R 774 ./ProjectRootDir
  1. Obfuscate code using manual mode
swiftshield -project-root ./ProjectRootDir -tag __obf -verbose


来源:https://stackoverflow.com/questions/54304648/swiftshield-obfuscation-using-swiftshield-gives-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!