0

我正在混淆 JAR,并且该 JAR 还包含一些资源文件。我不希望它们被混淆或损坏。如何要求proguard忽略资源文件,如公钥存储文件?

-adaptresourcefilenames
-adaptresourcefilecontents 

我们必须选择资源文件,但是从这两个选项中,我的公钥存储文件被损坏到输出 jar 中并引发异常 -

Exception in Application start method
        java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.javafx.main.Main.a(Main.java:642)
        at com.javafx.main.Main.main(Main.java:805)
        Caused by: java.lang.RuntimeException: Exception in Application start method
        at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherIm
        pl.java:403)
        at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:
        47)
        at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
        at java.lang.Thread.run(Unknown Source)
        Caused by: java.lang.AssertionError: java.security.KeyStoreException: Uninitiali
        zed keystore
        at de.schlichtherle.license.LicenseNotary.getPublicKey(Unknown Source)
        at de.schlichtherle.license.LicenseNotary.verify(Unknown Source)
        at de.schlichtherle.license.LicenseManager.verify(Unknown Source)
        at de.schlichtherle.license.LicenseManager.verify(Unknown Source)

        at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
        at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:206)
        at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29
        )
        at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:73)
        ... 1 more
        Caused by: java.security.KeyStoreException: Uninitialized keystore
        at java.security.KeyStore.isKeyEntry(Unknown Source)
        ... 17 more
4

1 回答 1

0

这两个选项都接受参数来过滤您要适应的文件:

cfr。ProGuard 手册 > 用法 > -adaptresourcefilenames / -adaptresourcefilecontents

于 2013-01-03T13:46:12.093 回答