Hit police: Felony. Police hit you: Doing their job.
Break into police computer: Felony. Police break into your computer: Doing their job.
I should see what the police pay for computer jobs. Everything extremely illegal becomes legal if I am police.
Source: https://en.m.wikipedia.org/wiki/Norwegian_Police_Service
So it doesn't compare to the systemic issues you have in the US. Besides what are they going to do if you don't unlock...? Give you a fine?
Yes, undercover police is used in other countries, but there are many restrictions and limitations. The US however is pretty big on what other countries consider entrapment - especially, in fictional TV series :)
Also unlike the US such things aren't used as evidence of guilt, not are they punished by major prison sentences..