【问题标题】:jar that uses jogl obfuscation使用 jogl 混淆的 jar
【发布时间】:2015-05-18 18:17:07
【问题描述】:

我使用video 中的 proguard gui 来混淆我从 Eclipse 中的项目创建的 jar,该项目使用 jogl。 将原始 jar 放在 jogl dll 文件的目录中时效果很好。由于某种原因,混淆的文件没有。应用程序启动,但出现一个空白窗口。 任何想法为什么?

【问题讨论】:

标签: java jar proguard obfuscation jogl


【解决方案1】:

这个 git 项目展示了一个正好存在这个问题的例子:

https://github.com/ArlindNocaj/jogl_gradle

运行 gradle proguard 会生成两个 jar,其中第二个是 proguard 的结果,所有混淆/收缩/优化都已停用。

java -jar build/libs/proguard-jogl_gradle.jar启动proguard的结果不起作用。

结果:

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fb8fce79b0a, pid=32750, tid=140432495699712
#
# JRE version: Java(TM) SE Runtime Environment (8.0_51-b16) (build 1.8.0_51-b16)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.51-b03 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [ld-linux-x86-64.so.2+0x9b0a]
#
# Core dump written. Default location: /home/user/git/jogl_gradle/core or core.32750
#
# An error report file with more information is saved as:
# /home/user/git/jogl_gradle/hs_err_pid32750.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

我不添加核心转储,因为问题应该很容易重现。

编辑:解决方案:添加了-keepdirectories 选项以使proguard 将目录条目添加到jar。这允许使用 getResource 方法加载类。

【讨论】:

  • 解决方案:jar 之间的区别在于目录条目默认不包含在 proguard 中。在 proguard 设置中添加 ``` -keepdirectories ``` 选项可以解决这个问题。当然,如果你使用混淆,你还必须确保 JOGL 包没有被混淆。
猜你喜欢
  • 2016-02-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-11-11
  • 1970-01-01
相关资源
最近更新 更多