The current default behavior of CFR is to always use name tables if they exist in the jar, this is problematic for obfuscated jars which intentionally produce garbage name tables.
Feature description
CFR should have an autodetect mode, enabled by default to see whether the name tables make any sense. If a lot of the variable names of locals collide, the name table should not be used.
Considerations
This autodetection feature could be implemented either per-method, per-class, or per-run, but any solution should work.
How sensitive should the autodetection be? Anywhere from "all variables have the same name" to "a pair of variable names in a method is the same", but should probably err on the sensitive side.
Should the actual contents of the names be part of some heuristic? (i.e. names are all Unicode that requires \uXXXX escapes => probably garbage).
If the user explicitly specifies --usenametable true, the autodetection should not run.
Alternatives
Alternatively, automatically add disambiguating suffixes for locals (possibly controled by another option).
Problem solved by this feature
The current default behavior of CFR is to always use name tables if they exist in the jar, this is problematic for obfuscated jars which intentionally produce garbage name tables.
Feature description
CFR should have an autodetect mode, enabled by default to see whether the name tables make any sense. If a lot of the variable names of locals collide, the name table should not be used.
Considerations
This autodetection feature could be implemented either per-method, per-class, or per-run, but any solution should work. How sensitive should the autodetection be? Anywhere from "all variables have the same name" to "a pair of variable names in a method is the same", but should probably err on the sensitive side. Should the actual contents of the names be part of some heuristic? (i.e. names are all Unicode that requires \uXXXX escapes => probably garbage). If the user explicitly specifies --usenametable true, the autodetection should not run.
Alternatives
Alternatively, automatically add disambiguating suffixes for locals (possibly controled by another option).