There is certainly an interesting conversation to be had on this topic, but you've chosen to present it as a justification, which I personally think is pretty highly immoral, to put it as politely as possible.
Surveillance in general is oppressive but the fact is there have been terror incidents to which China is reacting so as to stop further escalation. And yes Pakistan does use terrorism as foreign policy or use it as a weapon.