Search code examples
javabytecodejava-bytecode-asmbytecode-manipulation

ASM Java bycode muniplation changing a class name


So recently I been trying to simply just change a class name and I just cant . Here is my code InjectorClassNode https://0bin.net/paste/9REMNddwqjm8vRms#hyr4RG3BI36J+kRwMfC2pJoXb7I3+7AwKKzYhhXZQfw

MethodClassNode https://0bin.net/paste/UwKCvIG+cliZAYja#gILvBXxaQ1CyfQ602c6h7UE9dimhlo6q+GbKIwZ6m8B

Now when I run it , it throws a class not found for some stuiped reason "com/kirelcodes/cool/Task" is in the import list and I dont know why I would love to get help


Solution

  • In your solution you would only be renaming the class in one file. The other classes won't be notified of the name change and will throw "ClassNotFoundException".

    It would be better to rename the class after you have done your modification with a Remapper.