where could I find the source code of the "ninepatch" tool present in the Android SDK?
I assume it is a java application.
I'd like to make it better for my own use.
You will find the NinePatch tool within the AOSP source located in development/apps/NinePatchLab. Of course, if you do not have the AOSP source, do not fret, as it can be located on github, a single source file.