Hi
Does anyone know how to write Java application that expires after some
days
on trial version, say 30 days??
Ideally, tinkering with system date will not stop application from
expiring. Maybe by invalidating the application from starting once
date has been manipulated
Thanks
Struts
first of all you need to decide how serious you are on this.
If it is to cover a commercial app, then you need to put a lot more thought
into it. from the time before you write your app.
start by having a function that returns true,- always!!!-
then code so that your app will continue based on "true"
as you code add a call to this function in each(randomly ) of your routines.
1.use the java security manager to protect this routine.
2. overload the java zip package, to "change" the compression system, for
this package.
3. encode the first time this app is run along with some system specific
data.( check for silly dates & times, & always check for negative time)
I.E if the install date claims to be 2032 then it is obviously wrong.
4. finally write the protection code of your routine, and change it so that
it only returns "true" if the app is valid or in date.
what you should have is an app that any hacker will always attack your
package that returns "true/false", as it would be too much work to patch all
the other stuff.
you just need to prevent the package from being replaced/overriden.(security
manager) then put all your thought into that package.
the overloaded zip package , will mess up any decompiler programs, because
they ALL reply on standard zip format.
it's not completely fool proof, but it will dishearten all but the hardest
hackers.
steve