Recaf icon indicating copy to clipboard operation
Recaf copied to clipboard

您好,大佬, springboot 项目 直接导出有问题,没有做任何修改,可以帮忙看看吗?

Open 1412910387 opened this issue 3 years ago • 20 comments

没有做修改,直接导出,大小直接少了10M 微信截图_20220523104532

1412910387 avatar May 23 '22 02:05 1412910387

据我所知,Recaf会优化一些访问不到的字节码指令,移除这些垃圾指令是会减少jar包体积的。

As far as I know, Recaf will optimize some instructions that cannot be accessed. Remove these garbage instructions will reduce the volume of the jar package.

xtherk avatar May 23 '22 02:05 xtherk

Maybe you use English to ask questions better

xtherk avatar May 23 '22 02:05 xtherk

ok

1412910387 avatar May 23 '22 02:05 1412910387

Recaf also compresses jar files by default. In 2X there's not a UI front for it, but it can be disabled in backend.json

"backend.compressexport": true

But yes, English is proffered for issues.

Col-E avatar May 23 '22 02:05 Col-E

jar package is reduced, but it cannot be started successfully

1412910387 avatar May 23 '22 02:05 1412910387

springboot project export cannot be started successfully,but other project can be started successfully.

such as recaf-2.21.13-j8-jar-with-dependencies.jar

1412910387 avatar May 23 '22 03:05 1412910387

thanks, i try

1412910387 avatar May 23 '22 03:05 1412910387

thank you.but I cannot find where it can be disabled in backend .if have UI front ,better

Can you give me a configured jar?thank you

1412910387 avatar May 23 '22 03:05 1412910387

thank you.but I cannot find where it can be disabled in backend .if have UI front ,better

Can you give me a configured jar?thank you

C:\Users\{your name}\AppData\Roaming\Recaf\config\backend.json

xtherk avatar May 23 '22 03:05 xtherk

thank you.but I cannot find where it can be disabled in backend .if have UI front ,better Can you give me a configured jar?thank you

C:\Users{your name}\AppData\Roaming\Recaf\config\backend.json ok,thank you,i try it

1412910387 avatar May 23 '22 03:05 1412910387

thank you.but I cannot find where it can be disabled in backend .if have UI front ,better Can you give me a configured jar?thank you

C:\Users{your name}\AppData\Roaming\Recaf\config\backend.json I try it, BUT springboot project export cannot be started successfully original springboot project can be started successfully image image

1412910387 avatar May 23 '22 03:05 1412910387

I try it, BUT springboot project export cannot be started successfully

What error does it give you?

Col-E avatar May 23 '22 04:05 Col-E

I try it, BUT springboot project export cannot be started successfully

What error does it give you? sorry ,I went to dinner. I just saw it image

1412910387 avatar May 23 '22 06:05 1412910387

I found that the original directory has changed

image image

1412910387 avatar May 23 '22 06:05 1412910387

I'll need access to a small sample which demonstrates this behavior to see why the io folder is being removed. But that seems odd that it vanishes like that.

Col-E avatar May 23 '22 06:05 Col-E

I'll need access to a small sample which demonstrates this behavior to see why the io folder is being removed. But that seems odd that it vanishes like that.

I solved it through other ways. I'll decompress and replace .class file directly. Thank you all the same

1412910387 avatar May 23 '22 06:05 1412910387

While this does solve the issue, I'd like to have an example so that I can fix this regardless. Somebody else will likely encounter the same issue.

Col-E avatar May 23 '22 06:05 Col-E

While this does solve the issue, I'd like to have an example so that I can fix this regardless. Somebody else will likely encounter the same issue. https://start.spring.io/ You can use this website to generate a demo and try it

1412910387 avatar May 23 '22 06:05 1412910387

👍 Thanks

Col-E avatar May 23 '22 06:05 Col-E

While this does solve the issue, I'd like to have an example so that I can fix this regardless. Somebody else will likely encounter the same issue.

SpringBoot jar standard structure:

-BOOT-INF
-META-INF
-org

Our code is located in /BOOT-INF/classes

Reason: /BOOT-INF/classes/io move to /io

xtherk avatar May 23 '22 07:05 xtherk

The 3.x should resolve this issue #401

iflody avatar Mar 23 '23 15:03 iflody

^^ That and some rewrite logic I'm doing will better support jar-in-jar content down the road

Not going to address in 2X, but 3X. Stay tuned for that.

Col-E avatar Mar 23 '23 19:03 Col-E