Remap (Rename) parameter name or local variable name using mappings file.
format:
<class> <method name> <method signature> <remap info>
source code:
package test;
public class MemoryUtils {
public void writeObject(boolean dummy, long foo, long bar) {
// write at memory address [foo] with value [bar]
// parameter [dummy] is ignored, just for example
}
}mapping file:
test/MemoryUtils writeObject (ZJJ)V foo->address bar->value
will generate this file:
package test;
public class MemoryUtils {
public void writeObject(boolean dummy, long address, long value) {
// write at memory address [address] with value [value]
}
}test/MemoryUtilsis classwriteObjectis method name(JJ)Vis method signaturefoo->address bar->valueis remap infofoo->address- replace a local variable namedfoowithaddressbar->value- replace a local variable namedbarwithvalue
remap info can be these values:
- find by old name:
oldName->newName - find by param index that is starting from 0:
->newName - skip param index:
->
so this mapping file will do exact same as above:
test/MemoryUtils writeObject (ZJJ)V -> ->address bar->value
->address ->valueis remap info->- skips the first local variable->address- set second local variable name toaddressbar->value- replace a local variable namedbarwithvalue
--help- shows help message--debug- enable debug log--verbose- enable verbose log--mapping-file=path/to/mappings.txt- specify mappings file, defaults tomappings.txt--input-file=path/to/input.jar- specify input file, defaults toinput.jar--output-file=path/to/output.jar- specify output file, defaults toremapped.jar--threads=8- numbers of threads to process classes
just run ./gradlew build