首页 \ 问答 \ 你是否模糊了商业Java代码?(Do you obfuscate your commercial Java code? [closed])

你是否模糊了商业Java代码?(Do you obfuscate your commercial Java code? [closed])

我想知道有没有人在自己的商业产品上使用商业/免费的java混淆器。 我只知道一个实际上在蚂蚁构建步骤中发生混淆的项目。

你模糊吗 如果是这样,为什么你会混淆?

它是真正的保护代码的一种方式,还是开发人员/管理者更好的感觉?

编辑:好的,我确切地说,关于我的观点:你是否混淆了保护你的IP(你的算法,你放在你的产品中的工作)? 出于安全考虑,我不会混淆,那感觉不对。 所以我只是在谈论保护您的应用程序代码与竞争对手。

@staffan有一个好点:

远离链接代码流的原因是,其中一些更改使得JVM无法有效地优化代码。 实际上它实际上会降低应用程序的性能。


I wonder if anyone uses commercial/free java obfuscators on his own commercial product. I know only about one project that actually had an obfuscating step in the ant build step for releases.

Do you obfuscate? And if so, why do you obfuscate?

Is it really a way to protect the code or is it just a better feeling for the developers/managers?

edit: Ok, I to be exact about my point: Do you obfuscate to protect your IP (your algorithms, the work you've put into your product)? I won't obfuscate for security reasons, that doesn't feel right. So I'm only talking about protecting your applications code against competitors.

@staffan has a good point:

The reason to stay away from chaining code flow is that some of those changes makes it impossible for the JVM to efficiently optimize the code. In effect it will actually degrade the performance of your application.


原文:https://stackoverflow.com/questions/12088
更新时间:2023-08-19 16:08

最满意答案

在Objective-C中,属性中的copy属性意味着合成的setter将如下所示:

-(void)setMasterBirdSightingList:(NSMutableArray*)newValue
{
    if (_masterBirdSightingList == newValue) return;
//  NSMutableArray* oldValue = _masterBirdSightingList;
    _masterBirdSightingList = [newValue copy];
//  [oldValue release];    // <-- not applicable in ARC.
}

并且点语法将始终转换为

[self setMasterBirdSightingList:sightingList];

无论属性的属性如何。

“分配给另一个空间以保存来自sightingList的内容”的东西是通过-copy方法完成的。 将参数传递给setter的newValue参数的方式无关紧要。


编辑 :正如注释中提到的@David一样 ,可变类型的-copy方法返回一个不可变对象。 您必须覆盖setter才能调用-mutableCopy 。 请参阅使用可变对象的Obj-C 2.0属性的最佳方法是什么,例如NSMutableArray?


In Objective-C, the copy attribute in a property means the setter synthesized will look like this:

-(void)setMasterBirdSightingList:(NSMutableArray*)newValue
{
    if (_masterBirdSightingList == newValue) return;
//  NSMutableArray* oldValue = _masterBirdSightingList;
    _masterBirdSightingList = [newValue copy];
//  [oldValue release];    // <-- not applicable in ARC.
}

and that dot syntax will always be translated to

[self setMasterBirdSightingList:sightingList];

regardless of the attribute of the property.

The "allocated for another space to preserve stuffs from sightingList" stuff is done via the -copy method. The way you pass the argument to the setter's newValue parameter is irrelevant.


Edit: As @David mentioned in the comment, the -copy method of a mutable type returns an immutable object. You have to override the setter to call -mutableCopy instead. See What's the best way to use Obj-C 2.0 Properties with mutable objects, such as NSMutableArray?.

相关问答

更多

相关文章

更多

最新问答

更多
  • Runnable上的NetworkOnMainThreadException(NetworkOnMainThreadException on Runnable)
  • C ++ 11 + SDL2 + Windows:多线程程序在任何输入事件后挂起(C++11 + SDL2 + Windows: Multithreaded program hangs after any input event)
  • AccessViolationException未处理[VB.Net] [Emgucv](AccessViolationException was unhandled [VB.Net] [Emgucv])
  • 计算时间和日期差异(Calculating Time and Date difference)
  • 以编程方式标签NSMutableAttributedString swift 4(Label NSMutableAttributedString programmatically swift 4)
  • C#对象和代码示例(C# objects and code examples)
  • 在python中是否有数学nCr函数?(Is there a math nCr function in python? [duplicate])
  • 检索R中列的最大值和第二个最大值的行名(Retrieve row names of maximum and second maximum values of a column in R)
  • 给定md5哈希时如何查找特定文件(How to find specific file when given md5 Hash)
  • Python字典因某些原因引发KeyError(Python Dictionary Throwing KeyError for Some Reason)
  • 如何让Joomla停止打开新标签中的每个链接?(How do I get Joomla to stop opening every link in a new tab?)
  • DNS服务器上的NS记录不匹配(Mismatched NS records at DNS server)
  • Python屏幕捕获错误(Python screen capture error)
  • 如何在帧集上放置div叠加?(How to put a div overlay over framesets?)
  • 页面刷新后是否可以保留表单(html)内容数据?(Is it possible to retain the form(html) content data after page refreshed?)
  • 使用iTeardownMyAppFrame和iStartMyAppInAFrame在OPA5测试中重新启动应用程序超时(Restart app within OPA5 test using iTeardownMyAppFrame and iStartMyAppInAFrame timed out)
  • 自动拆分文本内容到列(Automatically splitting text content into even columns)
  • 在r中的循环中将模型名称分配给gbm.step(assigning model names to gbm.step in loop in r)
  • 昆明哪里有电脑等级考试二级C培训?
  • C ++模板实例化,究竟是什么意思?(C++ template instantiation, what exactly does it mean?)
  • 帮助渲染来自fields_for的部分内容(Help to render a partial from fields_for)
  • 将url.action作为json对象返回mvc(return url.action as json object mvc)
  • 使用.BAT中的.application文件类型运行ac#Console App(Run a c# Console App with .application file type from a .BAT)
  • 将bindingRedirect添加到.Net标准库(Adding a bindingRedirect to a .Net Standard library)
  • Laravel版本升级会影响您的控制器吗?(Laravel version upgrade affects your controller?)
  • imaplib.error:命令SEARCH在状态AUTH中非法,只允许在SELECTED状态(imaplib.error: command SEARCH illegal in state AUTH, only allowed in states SELECTED)
  • 如何在eclipse debug impala前端
  • 如何通过Ajax API处理多个请求?(How to handle multiple requests through an Ajax API? [closed])
  • 使用Datetime索引来分析数据框数据(Using Datetime indexing to analyse dataframe data)
  • JS 实现一个菜单效果