As in https://www.reddit.com/r/XWingTMG/comments/alps9j/han_vs_midnight_rules_question/ discussed recently:
Does Midnight prevent Han's reroll (which isn't a reroll)?!
As I'll be facing this on Saturday - please...!!
Han's pilot ability:
After you roll dice, if you are at range 0-1 of an obstacle, you may reroll all of your dice. This does not count as rerolling for the purpose of other effects.
Midnight:
While you defend or perform an attack, if you have a lock on the enemy ship, that ship’s dice cannot be modified.