iPhone/iPad 应用程序代码混淆 - 有可能吗?值得? [英] iPhone/iPad App Code Obfuscation - Is it Possible? Worth it?

查看:21
本文介绍了iPhone/iPad 应用程序代码混淆 - 有可能吗?值得?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经研究了很多,包括 SO,以及到处都是 google-ing,但我似乎无法找到关于 iPhone/iPad 应用程序代码混淆的直接答案目标-C.

I've researched quite a bit, both on SO, as well google-ing all over the place, but I can't seem to find a straight-forward answer in regards to code obfuscation for iPhone/iPad apps written in Objective-C.

我的问题是:

  1. 有没有办法做到这一点?如果是这样,怎么办?
  2. 值得吗?
  3. 在向 Apple 提交应用程序时,Apple 是否允许这样做或对此存在问题?

推荐答案

Objective-C 似乎没有代码混淆器.但让我们暂时假设一个确实存在.

There doesn't seem to a code obfuscator for Objective-C. But let's assume for a moment that one does exist.

Apple 可能不会拒绝混淆的应用程序,只要它不会崩溃.主要问题是:混淆的重点是什么?通常,您希望混淆代码以保护您的知识,例如,如果您的程序使用复制保护,您想让潜在的破解者更难,或者如果您使用一些高级算法,您不希望商业竞争对手成为能够反编译它.

Apple will probably not reject an obfuscated app as long as it doesn't crash. The main question is: what is the point of obfuscation ? Normally, you want to obfuscate code to protect your knowledge, for example if your program uses a copy protection you want to make it harder for a potential cracker or if you're using some advanced algorithm you don't want the business competitors to be able to decompile it.

复制保护已在 iOS 上得到处理.虽然通过越狱可以复制和运行普通应用程序,但我认为这样做的实际用户数量相当低(至少比 PC 和 Mac 等常规"计算机低很多).您认为盗版是一个需要混淆的大问题吗?

The copy protection is already been taken care of on iOS. Although through jailbreaking a normal app can be copied and run, I'd say the actual number of users who do this is fairly low (at least a lot lower than on "regular" computers like PC and Mac). Do you expect piracy such a big problem that you need to obfuscate ?

如果您确实有重要的知识需要保护,那么混淆可能是值得的.混淆有它的缺点:你不能再调试你的混淆应用程序.崩溃报告将毫无用处.

If you do have important knowledge to protect then obfuscation might be worthwhile. Obfuscation has its downsides: you can't debug your obfuscated app any more. Crash reports will be useless.

您可能还想阅读文章混淆可可.

回到似乎没有混淆器的事实:你可以做的是这个技巧:假设你有一个这样的标题:

Back to the fact there doesn't seem to be an obfuscator: What you can do is this trick: say you have a header like this:

@interface MyClass : NSObject {
}

- (void)myMethod;

你可以像这样进行廉价的混淆:

You could do a cheap obfuscation like this:

#ifndef DEBUG
#define MyClass aqwe
#define myMethod oikl
#endif

@interface MyClass : NSObject {
}

- (void)myMethod;

这样您仍然可以在源代码中使用有意义的符号,但是编译器在不编译用于调试时会将其变成垃圾".

This way you can still use meaningful symbols in your source, but the compiler would turn it into "garbage" when not compiling for debugging.

这篇关于iPhone/iPad 应用程序代码混淆 - 有可能吗?值得?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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