Outgoing CEO Tim Cook reports an 18th straight record quarter as the tech giant captures a 25% value share in the world’s second-largest smartphone market.