Apple has for years been working to lessen its dependence on China as a manufacturing center, with the pandemic exacerbating the risks of having so much iPhone production in one country.