Mohammad Amir, who was once jailed in the United Kingdom for spot-fixing, has retired from Pakistan cricket.