سؤال

I made a little java game and if you beat it, it loads embarrassing pictures of my friends. The problem is they can cheat and open the jar with WinRar and look at all the pictures. How can I prevent this?

(This is with their consent. It's completely friendly.)

هل كانت مفيدة؟

المحلول

You could convert the image to a hexidecimal String and store it in a file without an extension inside the .jar file.

To make things even more difficult for them you could add a non-hexidecimal character into the text periodically and then remove that character from the String in your code before converting the text back into an image. That way, even if they recognize the text file as an image in text they wouldn't be able to convert it unless they spotted the extra illegal hex characters.

نصائح أخرى

There is no way I know of to do that programmatically. However, what I would do is use an obscure format for the pictures (e.g. .tif, .ico), then name them things like library1.jar or data.dat. Last, add a lot of dummy files that have no purpose. This makes it hard for your friends to tell which files are pictures and how to view them.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top