Giter VIP home page Giter VIP logo

Comments (8)

ItzSomebody avatar ItzSomebody commented on June 15, 2024 2

Update: I wasn't thinking very carefully about this issue and realized why this is happening while I was having a bowl of cereal.

In a SpringBoot application, it seems all the classes are moved into the BOOT-INF/classes directory; however, the classes retain their names (meaning, classes don't have strange names of something like "BOOT-INF/classes/some/class/MyClass").

I suppose that this would require a special handling of SpringBoot applications (or similar) to specifically move the classes into their correct directory within the ZipFile.

from radon.

jatins avatar jatins commented on June 15, 2024

So, this is the tree structure of obfuscated jar

.
├── BOOT-INF
│   └── lib
│       ├── asm-6.2.jar
│       ├── ...
├── META-INF
│   ├── MANIFEST.MF
│   └── maven
│       └── hello.jatin
│           └── hello
│               ├── pom.properties
│               └── pom.xml
├── hello
│   └── jatin
│       ├── Application.class
│       ├── DataClass.class
│       ├── HelloController.class
│       └── SerializableClass.class
└── org
    └── springframework
        └── boot
            └── loader
                ├── ExecutableArchiveLauncher.class
                ├── ....

and this of original jar

.
├── BOOT-INF
│   ├── classes
│   │   └── hello
│   │       └── jatin
│   │           ├── Application.class
│   │           ├── DataClass.class
│   │           ├── HelloController.class
│   │           └── SerializableClass.class
│   └── lib
│       ├── asm-6.2.jar
│       ├── ...
├── META-INF
│   ├── MANIFEST.MF
│   └── maven
│       └── hello.jatin
│           └── hello
│               ├── pom.properties
│               └── pom.xml
└── org
    └── springframework
        └── boot
            └── loader
                ├── ExecutableArchiveLauncher.class
                ├── ...

Why is hello/jatin/ directory top level in obfuscated jar while it is nested inside BOOT-INF in original jar?

from radon.

jatins avatar jatins commented on June 15, 2024

Also, if I obfuscate spring boot jar with Radon, and then run it I get this error:

Caused by: java.lang.IllegalStateException: Unable to open nested entry 'BOOT-INF/lib/maven-surefire-common-2.22.1.jar'. It has been compressed and nested jar files must be stored without compression. Please check the mechanism used to create your executable jar file

while the backup jar runs fine.

from radon.

ItzSomebody avatar ItzSomebody commented on June 15, 2024

That can probably be fixed by changing the zip compression algorithm to a store. By default, Radon uses the default compression algorithm (most likely deflate or deflate64).

from radon.

jatins avatar jatins commented on June 15, 2024

@ItzSomebody any idea about change of directory structure issue? Is that the expected behaviour or a bug?

from radon.

ItzSomebody avatar ItzSomebody commented on June 15, 2024

Not expected behavior.

Edit: The behavior is actually expected, see below.

from radon.

Col-E avatar Col-E commented on June 15, 2024

Update: I wasn't thinking very carefully about this issue and realized why this is happening while I was having a bowl of cereal.

Spoken like a true developer

from radon.

LeoonZHANG avatar LeoonZHANG commented on June 15, 2024

Meet the same problem in my SpringBoot jar file , this BUG will fix in next version?

from radon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.