Revamp selection of host class, re-enable in redex(-unstable)
Revamp selection of host class, re-enable in redex(-unstable)

Summary:
DedupStrings is a pass that runs at the very end, after class renaming, and it adds a method (a string look-up method) to some dexes.

It needs to put the method into some class. Instead of generating additional class metadata, it finds a suitable "host" class to add the method to.

The selection of the host class used to be very unsophisticated. In one case, this resulted in a host class being selected that was a subclass of a class that only exists on certain Android versions, and as a result, crashing on others.

This change makes the selection of the host class more sophisticated, avoiding classes that may have problematic references, and then preferring the most innocent class.

Reviewed By: wsanville

Differential Revision: D16084722

fbshipit-source-id: 254e9be8fbfed8a900e2dd43c2705ee65cc29220

facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex