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

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

问题描述

我们有一个框架或库的想法,对任何iOS开发人员都非常有帮助。所以我们认真考虑从应用程序开发切换到框架/库开发。



但是,当我们想要为库/框架收费时,我们必须以某种方式保护代码。我们如何构建一个框架,使得框架的用户无法看到源代码,类似于我们无法看到Apples框架的源代码?我猜这只是将头文件和一些奇怪的Unix exe文件与编译后的框架一起发送。



或者如果不能编译一个编译的框架/库iOS开发人员无需复制和粘贴我们的源代码就可以使用,那么是否有一种方法来混淆objective-c代码?

解决方案

是的,可以构建框架,以便框架用户无法看到源代码。



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

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。他们将能够看到你复制到包中的头文件(参见上面的文章),但不是源文件(因为它不包括在内 - 只有编译的输出在包中)。



这也可以是一种很好的方式来分发用于公司内多个项目的代码。






更新:



检查下面添加的无羽毛链接 - 这是更近和全部在一个页面上: http://github.com/jverkoey/iOS-Framework 。它还用其他几种方法列出了这些问题。这是我在尝试记住建立新框架时该怎么做的时候遵循的指南。 :)

Update2(带有Xcode 6版本)



有一个选项, for:
iOS通用框架


是我的代码对其他人是否可见?答:不可以。该框架将导出已编译的二进制文件,以便任何人都可以在其中看到。您可以对其他文件(如XIB)进行相同处理。



为什么我需要这个?答:这适用于想要开发人员/团队分享他们的代码而不显示整个代码(.m / .c / .cpp文件)。此外,这是谁想要组织编译代码+资源(图像,视频,声音,XIB,plist等)到一个地方。这也适用于那些希望在同一基地(框架)之上一起工作的团队。


(c) http://blog.db-in.com/universal-framework-for-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.

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.

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/

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.


Update:

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. :)

Update2 (with Xcode 6 release)

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

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.

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/universal-framework-for-ios/

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

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