title: Detect Java JAR/Code Tampering
body: <p>I'm writing a piece of software that is distributed as a JAR file.  Currently, this JAR file can be tampered with to retrieve and save another file that our server transmits via <code>URLClassLoader</code>, be decompiled, and find various things in our code that should remain private for the security of the clients using it.  Basically, I want to implement a way to check if the original JAR is tampered with.  I know this is paradoxically impossible by implementing a check for validity of a <code>SignedObject</code> in the original class due to the nature of Java being able to be decompiled, but is there some other way that I can determine if code has been tampered with in the original file?  This check can happen via an intermediary class that is downloaded to check for validity, or any other means that will be guaranteed to work.  I've been sitting here all day trying to come up with a solution to this problem.  Any help is welcomed.</p>