SwiftShield:使用 SwiftShield 进行混淆会导致错误 [英] SwiftShield: Obfuscation using SwiftShield gives error

查看:376
本文介绍了SwiftShield:使用 SwiftShield 进行混淆会导致错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 SwiftShield 混淆 Swift 代码.我已经使用 Cocoapods 进行了集成.

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

为了运行它,我在终端中使用了下面的 SwiftShield 工具:

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

获取错误:

-bash: swiftshield: command not found

我已将 swiftshield 可执行文件从 pod 复制到/usr/local/bin 并尝试了相同的命令,但仍然出现以下错误

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

可能是什么问题?如何安装 SwiftShield

What could be the issue? How to install SwiftShield

推荐答案

问题与 Xcode 路径有关.我的机器上安装了 2 个 Xcode 版本.

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

我删除了 Xcode10.3.1.app 并将 Xcode11.1.app 重命名为 Xcode.app.问题现已解决.https://github.com/rockbruno/swiftshield/issues/71#event-2832206369

使用 swiftshield(手动模式)的步骤:

  1. 在桌面上下载 swiftshield 可执行文件https://github.com/rockbruno/swiftshield/releases
  2. 命令行 - 转到桌面并授予可执行权限

sudo chmod 755 swiftshield

  1. 将 swiftshield 可执行文件移动到/usr/bin

sudo cp swiftshield /usr/local/bin

  1. 检查是否安装正确

swiftshield --help

  1. 更改项目根文件夹的权限以重命名混淆代码

chmod -R 774 ./ProjectRootDir

  1. 使用手动模式混淆代码

swiftshield -project-root ./ProjectRootDir -tag __obf -verbose

这篇关于SwiftShield:使用 SwiftShield 进行混淆会导致错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆