Re: Can I make a class file self destruct?
- From: "Oliver Wong" <owong@xxxxxxxxxxxxxx>
- Date: Wed, 31 May 2006 14:54:34 GMT
"JuanValdex" <0360com@xxxxxxxxx> wrote in message news:1149085527.257404.59510@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I would like to be able to access a class file remotely, and send it a
command to self-destruct if it is unlicensed. (We have thieves
distributing our class files without license.)
Can I put some code in the class file to do this?
Maybe access it remotely with...
<applet codebase="http://www.remotesite.com/" code="myfile.class"...>
<param name="destroyClassFile" value="DoIt">
...
In the class file's code, something like...
String s=getParameter(destroyClassFile");
if (s == "DoIt") {
...code to destroy it
or
...overwrite itself on the server with junk
or
...turn on a function inside the class file to always display a
"this appears to be unlicensed" message
or
... ???
}
Any ideas? How can I send commands to the class file to permanently
change itself?
Probably not. Consider what actually happens when an applet is run:
The client makes an HTTP request to download the applet.
The server reads the class file from disk, and sends whatever bytes it read to the client.
The client takes these bytes and assembles them together to create its own copy of the class file.
The client then runs this class file it has locally.
So what is your applet going to do? It could erase it's own bytecode, in which case you've just destroyed the client's local copy, and not the copy on the server. Or it could tell the client to send nasty messages to the server, in hopes of coaxing it to delete those files, but the server is likely to refuse.
Thank you for your ideas!
Your licensing these applets out to customers, right? How about having the customer specify exactly what domain they plan on using their applets on, and hardcoding the address into the source code of the applet (meaning every customer gets a different .class file). The applet could then check that it's being hosted on the appropriate domain.
- Oliver
.
- References:
- Can I make a class file self destruct?
- From: JuanValdex
- Can I make a class file self destruct?
- Prev by Date: Re: Problems with Map.size()..........
- Next by Date: Re: What is a Java Annotation?
- Previous by thread: Re: Can I make a class file self destruct?
- Next by thread: Re: Can I make a class file self destruct?
- Index(es):
Relevant Pages
|