wh1t3p1g / tabby

A CAT called tabby ( Code Analysis Tool )
https://www.yuque.com/wh1t3p1g/tp0c1t/lf12lg69ngh47akx
Apache License 2.0
1.27k stars 149 forks source link

使用springboot设置executable为true情况下无法通过JarInputStream解压jar包 #43

Closed songxiaomo1997 closed 1 year ago

songxiaomo1997 commented 1 year ago

pom.xml中存在如下配置executable为true时,无法通过JarInputStream解压jar包,在命令行中使用jar xvf也无法解压,但是可以直接通过unzip解压,应该在FileUtils.java#extract()添加另一个解压方式就可以顺利解压executable为true情况下打包的jar包了

无法解压的原因貌似是在完全可执行的jar/war在文件前面嵌入了个额外的脚本导致在第一次jarInputStream.getNextJarEntry()时值为空,具体的我太菜了分析不动了师傅加油!!!

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <executable>true</executable>
    </configuration>
</plugin>
wh1t3p1g commented 1 year ago

感谢,已修复

songxiaomo1997 commented 1 year ago

师傅效率真高,赞