Brain hole Open: use go to protect our jar program

Source: Internet
Author: User
This is a created article in which the information may have evolved or changed.

Problems with anti-compilation

For a development to their own organization internal use of the program, this is actually very superfluous, but for commercial software, this is necessary, the software industry is now very fierce competition, we can put the competitor's program to decompile, easy to know what the opponent based on what software to do, Or it's easier to know the implementation principle, then. Copy copy, change a name, finished, a brand-new product came out. For Java, the problem is even more obvious. Although there are commercial software such as ZKM to be mixed, but if you have patience, there is still a great chance to read it.

I have to spit it out here, zkm is really hard to use.

How to protect our jar files

Here we'll just talk about the Fat jar bag (the kind of package that all hits together directly java-jar, like spring boot).
For the Prevention of Anti-compilation, Golang This kind of packaging is a binary way is actually very suitable, packaged into a binary after the program to decompile the difficulty is much more difficult than a common jar. Is it okay to put the jar bag in go and pack it up? Well, yes. We can manipulate the jar package as a static file through some static repositories of Golang. Binary-go is one of the right choices.

go get -u github.com/samuelngs/binary-go

After installation, we perform

binary -dir ./[静态文件位置] -out binary

will produce a lot of go files, by default it is a 20M for a split. Binary also provides a way for us to restore this package back again. But then there is a problem, although it can be reverted to binary stream, but Java cannot start from binary. So here are a few tricks to use, each time we start to put our jar package into a directory, each time the launch of the jar package name is also randomly given. After the boot is complete, the randomly generated jar is dropped. After such a series of operations, a fat jar disguised as go comes out.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.