Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Self-destructing application

Along the lines of "This tape will self-destruct in five seconds. Good luck, Jim"...

Would it be possible for an application to delete itself (or it's executable wrapper form) once a preset time of use or other condition has been reached?

Alternatively, what other approaches could be used to make the application useless?

The aim here is to have a beta expire, inviting users to get a more up-to-date version.

like image 645
James P. Avatar asked Apr 11 '12 14:04

James P.


People also ask

Which app is best for disappearing messages?

Snapchat. Snapchat (for Android and iOS) originally made its name with disappearing photos and videos, bringing a new ephemerality to social media. These days, the app extends that practice to instant messages as well.

What app deletes messages after 24 hours?

What's Poof? Like Snapchat, it's an app based on ephemerality. But where as Snapchat is all about sending video messages that self-destruct after you play them once, Poof is the world's first disappearing app, deleting itself from your iPhone after just 24 hours.

What app deletes messages after read?

Confide app erases your text messages after they're read - CNET.


2 Answers

It is possible. To get around the lock on the JAR file, your application may need to spawn a background process that waits until the JVM has exited before deleting stuff.

However, this isn't bomb-proof. Someone could install the application and then make the installed files and directories read-only so that your application can't delete itself. The user (or their administrator) via the OS'es access control system has the final say on what files are created and deleted.

like image 137
Stephen C Avatar answered Oct 14 '22 21:10

Stephen C


If you control where testers download your application, you could use an automated build system (e.g. Jenkins) that you could create a new beta versions every night that has a hard-coded expiry date:

private static final Date EXPIRY_DATE = <90 days in the future from build date>;

the above date is automatically inserted by the build process

if (EXPIRY_DATE.before(new Date()) {
    System.out.println("Get a new beta version, please");
    System.exit(1);
}

Mix that with signed and sealed jars, to put obstacles in the way of decompiling the bytecode and providing an alternative implementation that doesn't include that code, you can hand out a time-expiring beta of the code.

The automated build system could be configured to automatically upload the beta version to the server hosting the download version.

like image 22
beny23 Avatar answered Oct 14 '22 19:10

beny23