应用程序编译后是否可以或应该可以修改它的 GUI?
我是一名 Linux 用户,一直很犹豫是否使用 Glade 来设计 GUI,因为它生成的 xml 文件很容易被修改。我知道这听起来不是一个主要问题,但如果它是一个商业应用程序,您只是不希望人们改变怎么办?
我偶尔使用 Mac OS X,我发现它们使用名为“.nib”的文件作为 GUI。我认为它们本质上与 Nextstep 和 Openstep 中使用的类型相同(甚至有一个 Linux 应用程序可以让您编辑这些文件)。无论如何,这些文件包含在应用程序包中,并且根据一些人,是完全可编辑的。此人声称他甚至成功编辑了 Keynote 的界面。
现在,为什么这可能呢?最终用户完全可以更改界面吗?或者像传统的 GTK 应用程序一样,直接在编译的应用程序代码中使用 GUI 更好吗?
I'm a Linux user, and I have been very hesitant to use Glade to design GUIs, since the xml files it produces can easily be modified. I know it doesn't sound like a major issue, but what if it's a commercial app that you just don't want people changing?
I use Mac OS X every once in a while, and I figured out that they use files called ".nib"s for GUIs. I think they're essentially the same type used in Nextstep and Openstep (there's even a Linux app which lets you edit these files). Anyway, these files are included in the application bundle, and according to some people, are completely editable. This person claims he even successfully edited Keynote's interface.
Now, why would that be possible? Is it completely okay for the end user to change the interface? Or is it better to have the GUI directly in the compiled application code, like traditional GTK apps?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
OS X nib 文件是一种选择;另一种选择是以编程方式执行操作。对于android来说,XML文件可以定义GUI,或者程序代码也可以做到。在 Windows WPF 中,UI 是用 XML 制作的。火狐/Mozilla? XUL,另一种基于 XML 的 UI 语言。
大多数现代 GUI 工具包都具有这两个选项,甚至仅在文件中定义 UI。
但即使是二进制文件也是可以修改的。有了一个好的二进制逆向工程工具,它是开放的。真正确定的唯一方法是像苹果在 iOS 上所做的那样,运行签名的代码;整个包由密钥签名,如果修改则无法运行。
这对大多数人来说都不是问题。为什么要关心UI是否被修改?底层代码不是,因此无法添加或修改功能。
作为一个推论(有点偏离主题),您可能有一个合理的担忧是 更像这样的东西。
OS X nib files are one option; the other option is to do things programmatically. For android, XML files can define the GUI or program code can do it. In Windows WPF, the UI is made in XML. Firefox/Mozilla? XUL, another XML-based UI language.
Most modern GUI toolkits have either both of these options or even just defining UIs in files.
But even binaries are modifiable. With a good binary reverse engineering tool, it's wide open. The only way to be really certain is to do what Apple did with iOS, and run signed code; the entire bundle is signed by a key and can't be run if modified.
This isn't a problem for most everyone. Why do you care if the UI is modified? The underlying code isn't, so functionality can't be added or modified.
As a corollary (and a little off-topic) something that you might have a valid concern about is stuff a little more like this.
我真的不认为这有什么问题。如果用户弄乱了他的用户界面,那就是他的问题。把它想象成可模组游戏。用户总是喜欢它们,最终,大多数游戏都从中受益。应用程序的用户界面通常没有什么秘密。如果有,您总是可以进行某种加密。
正如其他人所说,如果您只想禁止编辑,也可以添加校验和。
I don't really see a problem with it. If a user messes up his UI, then it's his problem. Think of it like moddable games. Users always loved them, and in the end, most games benefit from it. There is usually nothing secret about an application's user interface. If there is, you could always do some sort of encryption.
As others have said, you can also add checksums if you just want to disallow editing.
xml 仅仅指定了界面的外观。如果没有编译的事件处理代码,它几乎毫无用处。我的观点是客户自行承担更改它的风险,并且您实际上可能会从他们的黑客攻击中获得一些免费的有用改进。
如果您真的很担心人们会更改它,那么您总是可以在加载 xml 时添加 MD5 摘要验证步骤或其他内容,或者将 xml 字符串编译到头文件中,但这会抵消许多好处。
The xml specifies little more than what the interface looks like. Without the compiled-in event handling code, it's pretty much useless. My opinion is customers change it at their own risk, and you might actually get some free useful improvements out of their hacks.
If you're really paranoid about people changing it, you could always add an MD5 digest verification step or something when you load the xml, or compile the xml string into a header file, but that defeats many of the benefits.
主题引擎可以对 GUI 进行实质性的更改,Parasite 等工具也可以。更新 Glade 布局(风险自负)比其中任何一个都要安全得多。
用户自定义 UI 有什么问题吗?
The theming engine can make substantial-looking changes to your GUI, as can tools like Parasite. Updating the Glade layout — at their own risk — is much safer than either of those.
What's wrong with users customizing the UI anyway?