Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to protect my jar resource from extraction?

I want distribute my *.jar file. I mean my application to be use but i don't want user or anybody extract my resource(sound, pic, and others).

How to protect it?

thx

like image 787
Kenjiro Avatar asked Sep 08 '25 03:09

Kenjiro


2 Answers

Invent a DRM mechanism and once they crack it, sue them to death.

No, honestly, what you are trying to achieve is really, really complicated - if not impossible. You would need to encrypt the resources in a way that the key to the encryption mechanism would not be contained within the jar itself (as in hardcoding it in your code - hackers love this).

So you would need your application to open some online connection to a server under your control that would need to be online all the time - and your users would hate you for doing that because of all the trouble this generates (just follow online discussions about recent PC games)... is it really worth it?

like image 185
emboss Avatar answered Sep 10 '25 07:09

emboss


This is impossible to do in Java or any language. If something can be used by your program, it can be taken. You can make it a bit more difficult for people, but at the end of the day if they want to steal graphics / sounds they can.

You'd be much better off putting your effort into making graphics and sounds etc which people like and are user-friendly.