In less than a year China has upended the world’s largest online sector, throwing its biggest players from Alibaba to Tencent into a tailspin with a storm of regulatory measures to loosen their stranglehold over data and content. Yet Apple Inc., the largest of them all and an American icon, has sailed through mostly unscathed.

That may be changing. President Xi Jinping has over the past year launched a broad offensive against big technology firms, directing the dismantling of digital walls around platforms like WeChat that stifle competition.

Last month, China’s top court effectively granted consumers the right to sue Apple for alleged abuse of market power — a setback for a company whose App Store pioneered the walled-garden model of centralizing user data and publishing control.