Changing splash screen
You can modify the behavior of Intellij IDEA using a mechanism similar to videogame patching. Let's change the startup splash screen of our ide.
jar tf path/to/idea/lib/resources.jar | lessand search for "logo.png". Note the file name.
- Copy the png image you want in a new directory with the name you found above. (you can pick one from here)
- Open the idea launcher script (
idea.sh) in an editor
- Append this directory to the front of classpath:
Now the chosen splash screen will be shown on startup.
This method can be used to override classfiles as well. Although the process is a bit more involved. This is the general procedure to follow when overriding classes:
- Note down the build id of your installation (
grep buildNumber $IDE_ROOT/product-info.json)
- Goto intellij-community github repo, switch to the branch for your build id, and download the java file you wish to change.
- Make the changes you wish to make to that class.
- Compile the file and put the output in your patch directory (
javac -cp $IDE_ROOT/lib/\* ModdedClass.java -d $PATCH_DIRECTORY)
Unfortunately that's not all there is to it. This is what the boot process of intellij looks like:
- The launcher script starts the intellij
mainclass with a couple of utility JARs in the classpath.
- The bootstrap code switches to a custom intellij classloader.
This new classloader uses a caching algorithm that doesn't respect the order of classpath entries. So you'll have to write a patch for this classloader that disables caching if you want to override classes that will be loaded by this new classloader:
Class being patched:
Once you've added this override to your patch directory, you should be able to override any class in the intellij platform.
You might get some errors related to
Remember that this is a patching mechanism, not a plugin. That means that this method is much more flexible, but the modded classfiles are not guaranteed to work with anything other than the ide build number for which you made this change.