well...
On page PHB 278, it says:
Maximum Damage: Rather than roll damage, determine the maximum damage you can roll with your attack.
And PHB 117:
Sneak Attack
[...] You decide whether to apply the extra damage after making the damage roll.
So the sneak attack getting the crit...