Pakistan’s president says extremist attacks won’t end friendship with China