An Explanation of My Recent "Self Destruct" Application

Self Destruct” is simply an application I made for fun, as a proof of concept. This application demonstrates a way to create an application that is able to “destroy” itself, preventing it from running until it is uninstalled, and then reinstalled later. I’d like to personally thank HandlerExploit for giving me a hint about how to do this (he mentioned that he found the trick in the provisioning code). HandlerExploit uses a similar technique in his application, “iBrick Proof of Concept”. As soon as the user opens the application, it removes it’s main class from the Dalvik package manager, preventing itself from being able to run again. The only way to run the application again after opening it is to uninstall the application, and reinstall it. This application serves no real purpose other than to demonstrate an interesting trick, and it is not malicious in any way. Please note that after running the application, it’s icon will remain in the launcher, although you won’t be able to open it. Uninstalling the application will remove the icon. I’d release the entire source code for this application, but really, the only part that actually matters is the part that removes the class from Dalvik and prevents the application from running again. Interestingly, this application requires absolutely no permissions, at all in order to do this. In case you are interested in how I did this, here is the source code for the main class in the project:

package com.dylantaylor.selfdestruct;
import android.app.Activity;
import android.content.ComponentName;
import android.content.pm.PackageManager;
import android.os.Bundle;

public class Main extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        PackageManager pm = getPackageManager(); ComponentName name = new ComponentName(this, Main.class);
        pm.setComponentEnabledSetting(name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
    }
}

Yes, I realize that this application serves no real purpose, but it’s just something interesting that I made for fun. If you don’t want it, don’t download it. Otherwise, have fun! :)

P.S. Do whatever you want with that source code, it’s virtually worthless to me anyways.

Sound Added to "Simple Dice"!

I added sound to “Simple Dice” when you roll the dice. The sound played is a modified, low quality version of Mike Koenig’s “Shake and Roll Dice Sound”. The file takes up less than 10 additional kilobytes, and the sound is only played if the “Media volume” is not muted, to avoid disturbing others.  I also plan on adding the sound to “Dice Betting” when it is released. The sound truly makes the application more realistic feeling and more interesting. Expect to see the changes on GitHub and the Android market shortly!

UPDATE: The sounds are now in the git repository, and the new version is up on the market!

Introducing "Simple Dice"

This isn’t quite the dice game that I’m currently working on, but I liked the animation I made so much in the other game (“Dice Betting”) that I just had to release an Android application with just the dice images and the animation. Simply tap anywhere on the screen in order to roll the dice. Dice rolls are random. Simple Dice will definitely be released under version 3 of the GNU General Public license, and the source will be available online as soon as I get a chance to upload it. I will update this post with the link to the source code once it’s online. Until then, check it out in the Android market! It’s 100% free! Also, the entire application takes up only a measly 24KB! ;)

UPDATE: The source code is now available on GitHub! Check it out! :)

Working on a New Simple Dice Game

I’ve been working on creating a basic dice game for Android with animation, rules, betting, and more! The game is currently a work in progress, but I’m really excited to release it! The animation works wonderfully, and the interface, although very unfinished is already starting to look polished, especially in the game’s menus. For now, the game is simply called “Dice Betting”, and yes, I realize how lame and generic that sounds, but I might end up changing the name of the game before it is released. Similar to “Find the Mouse”, I’ll probably end up open sourcing this game (under the GNU General Public License, of course), although it isn’t even remotely close to being released yet. The game will have a built-in statistics tracking system, and the rolling of the dice will be completely animated. Right now, the animation I have done looks really cool, and I’m incredibly anxious to publicly release this. Check back soon! :)

Find The Mouse Improvements Complete!

I finished making the changes to “Find The Mouse”, and the new code is up on github. I’m already in the process of signing and uploading the new version to the Android market. You should be able to download it very soon! The new version automatically advances to the next level after you successfully find the mouse, it keeps track of your winning streak and current score, and the user interface feels much nicer. Enjoy! :)

UPDATE: The new version is now up on the market! Check it out!

Pssst… Planned Improvements for "Find The Mouse"

I realize that “Find The Mouse” isn’t that much fun yet. I’m working on implementing a feature to keep track of scoring. For each round successfully completed, you will get one point plus one point for every click left. The game will also keep track of how many games were won in a row. Keep in mind that this game was never originally designed to be very fun, it was meant to be an example to teach (very) basic Android programming. These upcoming features are simply the result me giving into peer pressure and trying to make the game more enjoyable. Keep in mind that this is an open source project and anyone is welcome to contribute code if they would like to see it in the game. The feature is done as far as coding, I just have to work on the new layout.

Introducing "Find The Mouse", a Basic Open Source Android Game!

So, a friend of mine asked me to show them how to make a basic Android game, which resulted in me coding up something simple for him. “Find The Mouse” is the result of this coding. This entire game was started and finished in around 20 minutes today, and the counter was added in later. All of the artwork in the game is public domain artwork found on sites like clker.com. The card background was heavily modified in order to reduce file size and make it look nicer on mobile screens. The object of the game is to find the mouse hidden behind one of five cards. You have three chances to find the mouse before you lose. The game is, as I stated earlier, incredibly simple, yet somewhat useful to someone who is learning to code for the Android operating system. The entire source code as well as all resources are available on GitHub, and I will probably end up putting this on the Android market soon, so that all of you without the Android SDK or the time to compile source code can play with this. This game will definitely be 100% free, and I have no intention of ever charging for it. The version on the market will likely have an AdMob advertisement in it, however, the version on github will not if you have the time to compile it and run it yourself. I am releasing this project under version 3 of the GNU General Public License, and all original artwork created by me in relation to this project is released to the public domain. You may copy, edit, modify and redistibute this project as long as you follow the terms of version 3 of the GPL. Enjoy! The project’s source code can be found on this GitHub repository. ;)

P.S. Hitting the Search button or the Menu button resets the game.

I’m Now Accepting Donations For Clippy

I just finished setting up a Pledgie campaign in order to raise money to support the development of Clippy, my clipboard manager for Android. If you use Clippy, and find useful, please consider making a small donation. Clippy is currently a 100% free application, no strings attached, and in order to keep it that way, I need a way to make a little bit of money. Clippy is currently a one-man project, and I do all the work I do on it during my spare time. I have invested many hours into developing Clippy, and I’m hoping that some of that work will start to pay off soon.  The more money that is donated to the Clippy project, the more time I’m able to invest in developing and supporting Clippy. Also, as an added incentive to encourage donations, if I receive over $20,000 $1,000 in donations, I will release the entire source code for Clippy under version 3 of the GNU General Public License, and all of the resources, including the original vector graphic files, under the Creative Commons Attribution 3.0 Unported License.  In addition to that, I’ll set up a repository on github to encourage open development, and allow others to contribute code. I got the inspiration for this idea from an independent gaming package called the “Humble Indie Bundle“, where you could pay what you want for a package of 5 games. Basically, they offered to make their games open source if they could raise $1 Million. Needless to say, they succeeded. So, in the spirit of the Humble Indie Bundle, I’m offering to make my application open source if I can raise $1,000, which is practically pocket change compared to the goal they set, yet still a very substantial amount to me. If you don’t feel like signing up for Pledgie, you can make a donation using traditional PayPal, but I’d have to manually enter your donation into Pledgie for it to count towards the $1,000 goal.

Click here to lend your support to: Clippy Clipboard Manager and make a donation at www.pledgie.com !

New Clippy Icons (Colored and Grayscale!)

When I originally designed the Clippy icon, I made it using a free, open source graphics editing program called GIMP, and saved it as a 720×720 PNG image. While 720×720 is a large resolution, large enough for almost anything I need to use my icon for, it’s still a raster image format, and it doesn’t scale well. This also results in it being more difficult to edit the image and make changes, such as editing colors, resizing it, etc. If you don’t care about all the technical details, scroll down to the end of this post to check out the new icons. Otherwise, continue reading. To solve this problem, I opened up the original image in Inkscape, a free and open source vector graphics editing program, and traced the paths of the “clip” and the “writing” from the original clipboard image, converting them into vectorized paths. I used the “Exclusion” tool to create the hole in the clip. I then created a new rounded rectangle as the new ‘base’ of the clipboard, with a fill color that matched the inside color of the base in the raster image, and a stroke color that matched the color around the edge of the clipboard in the old raster image. After making sure that I had the stroke width exactly the same length as the border of the base of the old image, I lined up the rounded rectangle with the upper left corner of the base of the old image, and resized it so that the bottom right corner lined up with the bottom right corner in the previous image. I then messed with the radius of the new base’s corners until it lined up almost perfectly with what I had before.  At this point, I had the “writing” scribbles, the “clip”, and the new clipboard base recreated in glorious SVG format. I then put all three parts on their own layers, organizing them (from top to bottom): “Clip”, “Writing”, “Board”. Because I had the base of the clipboard done at this point, I locked that layer so I wouldn’t accidentally mess it up, and then I selected all of the writing. I then changed the fill color of all of the writing at once to match the fill color in the previous image. Since at this point I already had the “writing” exactly where I wanted it, and the writing was already in path form, I used the “Simplify” feature under the path menu, to clean up the paths of the writing a little bit, as it doesn’t have to be exact, since the “writing” is only a bunch of wavy lines anyways. Now that I had the “writing” taken care of, and the “board” complete, with their colors similar to what I had in my previous icon, I was mostly done. All I had to worry about now was shading the “clip” (at that point in time, I only had the outline of the clip, with no fill color), and recreating the “paper”, for the “writing” to go on. I used the “hide layer” function to get the clip out of the way for now, and I began creating a new rectangle (not rounded this time) with the exact same dimensions as the old image’s “paper”, by, once again, lining up the upper left and bottom right corners. After making sure that I had the border length exactly the same as the border length of the old “paper”, and then I set the fill color and stroke color to match the colors in the original image. All that was left was filling in the “clip” with a gradient. After playing around with the linear gradient settings for a while, I finally had something that I was satisfied with, and I truly believed that it might even be better than the original Clippy icon. Since the new icon came out so great, I figured that it would be a good idea to make a grayscale version of the icon, for things like the notification bar icon, which typically don’t have any coloration. So, I saved the colored image, and fired up Inkscape again, and got to work. Keeping all the sizes and positioning of the layers the same, I messed with the fill and stroke colors until I had a nice looking, Android-style grayscale image. Unfortunately, due to WordPress.com‘s file type limitations, I can’t upload any SVG files, so, unfortunately, you won’t be able to see these images in their original, lossless forms, but I can, however, upload rasterized renderings of the images saved as PNG files. To accurately show the difference between the new vector images and the old raster images, I rendered these images at a very high resolution. As you can clearly see, just by looking at the images, there is absolutely no loss of clarity in the vector image rendering, where the original raster image becomes significantly pixelated when scaled. Also, even though it’s possible to scale the vector icons to almost any size without the quality degrading, their size is actually significantly less than the original raster images. Anyways, here are the links to the images, so you can check them out for yourself:

Let me know what you think about the new icon by leaving a comment on this post!

Note: There is no “old” grayscale image, as I created it originally when I converted the colored image to SVG.

UPDATE: I made some slight changes to the gradient used in the ‘clip’ of the colored logo. It now looks shinier, and closer to the original raster image. Also, I slightly improved the subtle gradient used in the ‘board’ of both vector images. The images on this page are now updated to reflect that change.