Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable process for package-protected visibility #447

Open
florentm35 opened this issue Nov 4, 2024 · 0 comments
Open

Disable process for package-protected visibility #447

florentm35 opened this issue Nov 4, 2024 · 0 comments

Comments

@florentm35
Copy link

florentm35 commented Nov 4, 2024

Hello,

I need to create a fat jar of my application, which uses Spring Boot in Java 21.

In my configuration, I use:

-keep class org.** { *; }
-keep class org.springframework.** { *; }
-keepclassmembers class org.springframework.** { *; }
-keepnames class org.springframework.beans.** { *; }

But ProGuard doesn't ignore org.springframework.beans.ExtendedBeanInfo, a package-protected class:

[proguard] error[1004]: proguard.evaluation.exception.IncompleteClassHierarchyException
 [proguard]   --> org/springframework/beans/ExtendedBeanInfo : <init>(Ljava/beans/BeanInfo;)V at invokeinterface #43, 512
 [proguard] 69 |     astore v6
 [proguard] 71 |     new #33
 [proguard] 74 |     dup
 [proguard] 75 |     aload v6
 [proguard] 77 |     invokespecial #35
 [proguard] 80 |     goto +12
 [proguard] 92 |     invokeinterface #43, 512
 [proguard]   |     ^^^^^^^^^^^^^^^^^^^^^^^^ Can't find common super class of [org.springframework.beans.ExtendedBeanInfo$SimplePropertyDescriptor] (with 1 known super classes: org.springframework.beans.ExtendedBeanInfo$SimplePr
opertyDescriptor and 1 unknown classes: java.beans.PropertyDescriptor) and [org.springframework.beans.ExtendedBeanInfo$SimpleIndexedPropertyDescriptor] (with 1 known super classes: org.springframework.beans.ExtendedBeanInfo$Simp
leIndexedPropertyDescriptor and 1 unknown classes: java.beans.IndexedPropertyDescriptor)
 [proguard] 97 |     pop
 [proguard] Variables: [P0:P0:Lorg/springframework/beans/ExtendedBeanInfo;!][P1:P1:Ljava/beans/BeanInfo;?][33:M28:[Ljava/beans/PropertyDescriptor;?][36:i][38,137:i][50:49:Ljava/beans/PropertyDescriptor;?][empty:empty]
 [proguard] Stack: [53:F53:Ljava/util/Set;][86:83:N83:Lorg/springframework/beans/ExtendedBeanInfo$SimplePropertyDescriptor;=!]
 [proguard]
 [proguard] Unexpected error while performing partial evaluation:
 [proguard]   Class       = [org/springframework/beans/ExtendedBeanInfo]
 [proguard]   Method      = [<init>(Ljava/beans/BeanInfo;)V]
 [proguard]   Exception   = [proguard.evaluation.exception.IncompleteClassHierarchyException] (Can't find common super class of [org.springframework.beans.ExtendedBeanInfo$SimplePropertyDescriptor] (with 1 known super classes: o
rg.springframework.beans.ExtendedBeanInfo$SimplePropertyDescriptor and 1 unknown classes: java.beans.PropertyDescriptor) and [org.springframework.beans.ExtendedBeanInfo$SimpleIndexedPropertyDescriptor] (with 1 known super classe
s: org.springframework.beans.ExtendedBeanInfo$SimpleIndexedPropertyDescriptor and 1 unknown classes: java.beans.IndexedPropertyDescriptor))
 [proguard] Unexpected error while preverifying:
 [proguard]   Class       = [org/springframework/beans/ExtendedBeanInfo]
 [proguard]   Method      = [<init>(Ljava/beans/BeanInfo;)V]
 [proguard]   Exception   = [proguard.evaluation.exception.IncompleteClassHierarchyException] (Can't find common super class of [org.springframework.beans.ExtendedBeanInfo$SimplePropertyDescriptor] (with 1 known super classes: o
rg.springframework.beans.ExtendedBeanInfo$SimplePropertyDescriptor and 1 unknown classes: java.beans.PropertyDescriptor) and [org.springframework.beans.ExtendedBeanInfo$SimpleIndexedPropertyDescriptor] (with 1 known super classe
s: org.springframework.beans.ExtendedBeanInfo$SimpleIndexedPropertyDescriptor and 1 unknown classes: java.beans.IndexedPropertyDescriptor))
 [proguard] Unexpected error
 [proguard] java.lang.RuntimeException:
 [proguard]
 [proguard] It appears you are missing some classes resulting in an incomplete class hierarchy,
 [proguard] please refer to the troubleshooting page in the manual:
 [proguard] https://www.guardsquare.com/en/products/proguard/manual/troubleshooting#superclass
 [proguard]
 [proguard]     at proguard.ProGuard.execute(ProGuard.java:268) ~[proguard-base-7.4.1.jar:7.4.1]
 [proguard]     at proguard.ProGuard.main(ProGuard.java:648) ~[proguard-base-7.4.1.jar:7.4.1]

Moreover, the java/beans/BeanInfo class is part of the standard Java classes, so I don't understand the error.

EDIT : I worked around the issue by first creating a jar with ProGuard, then building my fat jar from the obfuscated jar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant