JesusFreke / smali

smali/baksmali
6.29k stars 1.07k forks source link

Make fields editable in BuilderInstruction #788

Closed GraxCode closed 3 years ago

GraxCode commented 3 years ago

It makes sense that ImmutableInstructions are not changeable, but the fields of BuilderInstructions retrieved from a MutableMethodImplementation should be editable. This would allow an easier editor implementation instead of recreating a BuilderInstruction object each time.

JesusFreke commented 3 years ago

Modifying instructions can only be done via swapping it out with the applicable methods in MutableMethodImplementation. (e.g. swapInstruction). This ensures the state in MutableMethodImplementation can be kept up to date when an instruction changes.