I need to change existing compiled .class file. Actually I have even sources of it, but I cannot just change and recompile it because of many dependencies that I don't have.
So I need to change 2 methods. Both them have void return type. The first contains just 2 lines that are calls of another methods of the same class, i.e.
public void a() {
System.out.println("a");
}
public void b() {
System.out.println("b");
}
public void ca() {
a();
b();
}
And I need to change method ca sp that it calls only a() method.
The second method that I need to change contains some logic, but I want to clear it at all, i.e. to have method with empty body that does nothing.
How can I do this?
If you don't have the required dependencies, how are you expecting to use this code? I would strongly recommend that you devote your time to being able to compile this normally, instead of trying to just change the binary. It's likely to be a better bet in the long run.