Article 244 of Constitution of 1973 - Islamic Republic of Pakistan reads & I quote:
[Article 244]
(In the name of Allah, the most Beneficent, the most Merciful.)
I, ____________, do solemnly swear that I will bear true faith and allegiance to Pakistan and uphold the Constitution of the Islamic Republic of Pakistan which embodies the will of the people, that I will not engage myself in any political activities whatsoever and that I will honestly and faithfully serve Pakistan in the Pakistan Army (or Navy or Air Force) as required by and under the law.
The words above are clear enough, it was all done with allegiance to Pakistan & "Will' of the People of Pakistan - which was evident by the Referendum of 2001 --- & PRO signed by Judges of Supreme Court of Pakistan ----