How to play Pokémon GO on rooted phone

The latest update to Pokémon GO (0.37) has locked out rooted devices, but there is a way to get around the restriction and play Pokémon GO on a rooted phone. How to get around SafetyNet API. How to hide root on Android phone.