如何为其他开发人员构建框架或库,安全的方式? [英] How to build a framework or library for other developers, the secure way?

查看:20
本文介绍了如何为其他开发人员构建框架或库,安全的方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个对任何 iOS 开发人员都非常有帮助的框架或库的想法.因此,我们正在认真考虑从应用开发转向框架/库开发.

We have an idea for an framework or library that will be very helpful for any iOS developer. So we're seriously thinking about switching from app development to framework/library development.

但是当我们想为库/框架收费时,我们必须以某种方式保护代码.我们如何构建一个框架,让我们框架的用户看不到源代码,类似于我们如何看不到苹果框架的源代码?我猜他们只提供头文件和一些带有编译框架的奇怪的 Unix exe 文件.

But when we want to charge for the library/framework, we must protect the code somehow. How can we build a framework in such a way that the user of our framework can't see the source code, similar to how we can't see the source code of Apples frameworks? They only ship the header files and some weird Unix exe file with the compiled framework, I guess.

或者,如果无法制作其他 iOS 开发人员可以使用的已编译框架/库而无需复制和粘贴我们的源代码,那么有没有办法混淆 Objective-C 代码?

Or if it is not possible to make an compiled framework / library that other iOS developers can use without beeing able to copy&paste our source codes, then is there a way to obfuscate the objective-c code?

推荐答案

是的,可以构建框架,这样框架的用户就看不到源代码.

Yes, it is possible to build frameworks so the user of the framework can't see the source code.

查看这些文章(我过去已经成功使用第一个创建框架——后面的文章是对原始文章的更新):

Check out these articles (I've successfully used the first one to create frameworks in the past -- the later articles are updates to the original):

http://www.drobnik.com/touch/2010/04/making-your-own-iphone-frameworks/

http://www.drobnik.com/touch/2010/05/making-your-own-iphone-frameworks-in-xcode/

http://www.drobnik.com/touch/2010/10/embedding-binary-resources/

要使用该框架,您的用户只需将 .framework 包拖入 Xcode.他们将能够看到您复制到包中的头文件(请参阅上面的文章),但看不到源文件(因为它不包括在内——只有编译后的输出在包中).

To use the framework, your users would just drag the .framework bundle into Xcode. They will be able to see the header files you copy into the bundle (see the articles above), but not the source (as it's not included -- only the compiled output is in the bundle).

这也是分发用于公司内多个项目的代码的好方法.

This can also be a great way to distribute code that is used for multiple projects within your company.

查看下面添加的无羽毛链接——它是最新的,并且都在一页上:http://github.com/jverkoey/iOS-Framework.它还列出了其他几种方法的问题.这是我现在在尝试记住在设置新框架时要做什么时遵循的指南.:)

Check out the link featherless added below -- it is much more recent and all on one page: http://github.com/jverkoey/iOS-Framework. It also lays out the issues with several other approaches. This is the guide I now follow when trying to remember what to do when setting up a new framework. :)

有一个选项,正是您正在寻找的:iOS 通用框架

There is a option, exactly that you a re looking for: Universal Framework for iOS!

其他人可以看到我的代码吗? A:不会.这个框架会导出一个编译好的二进制文件,所以任何人都可以看到里面的内容.你可以为其他一些文件做同样的事情,比如 XIB.

Will be my code visible to others? A: No. This Framework will export a compiled binary, so anyone can see inside it. You can make the same for some other files, like XIBs.

为什么我需要这个? A:这适用于想要共享其代码而不显示完整代码(.m/.c/.cpp 文件)的开发人员/团队.除此之外,这适用于想要将编译后的代码 + 资源(图像、视频、声音、XIB、plist 等)组织到一个地方的人.这也适用于希望在同一基础(框架)上协同工作的团队.

Why I need this? A: This is for developers/teams that want to share their codes without shows the entire code (.m/.c/.cpp files). Besides this is for who want to organize compiled code + resources (images, videos, sounds, XIBs, plist, etc) into one single place. And this is also for that teams that want to work together above the same base (framework).

(c) http://blog.db-in.com/ios通用框架/

这篇关于如何为其他开发人员构建框架或库,安全的方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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