Apple Inc is binding itself more closely to China as its share of the world's biggest smartphone market slips and it becomes more reliant on selling services which require government approval.
A flurry of recent action by Cupertino-based Apple underlines its push to get on the right side of China's notoriously tough tech regulators, as it looks to revive sales there.
This weekend it moved to block apps used to evade the country's internet censors, a decision that fits with Beijing's recent crackdown on unapproved online content. And Apple has announced it will establish its first China data center in the politically important province of Guizhou, and has created the new position of a managing director for Greater China, reporting directly to CEO Tim Cook.
Apple's China revenues have stalled, falling for a fifth straight quarter in January-March, when sales grew in every other region. China recently slipped to Apple's third-largest market, as consumers have switched to newer domestic offerings. The buzz around new launches has also cooled since the iPhone 6 in 2014.
When it unveils quarterly earnings later on 1 August, Apple is likely to report another dip in China smartphone sales. Its once coveted iPhone has slipped into fifth position behind offerings from local rivals Huawei, Oppo, Vivo and Xiaomi, analysts said.
The iPhone's share of China's smartphone shipments fell to 9 percent in January-June, from a peak of 14 percent in 2015, according to consultancy Counterpoint.
Having China's government on-side will certainly help. "Because others have eaten away at Apple's market share in China, it now has to pay more attention to regulation from government," said Beijing-based tech analyst Li Chengdong. "China is such a key market for Apple that it has to listen."
Apple declined to comment for this article. Apple, like other US tech brands including Facebook Inc and Alphabet Inc's Google, has looked to woo China's leaders to give it greater access, especially as it pushes services such as its App Store and Apple Pay.
Services were Apple's rare bright spot in its struggling China business and logged double-digit revenue growth in Greater China in January-March.
And maintaining momentum is crucial, as device sales may come under pressure again until Apple unveils its new iPhone, widely expected later this year in a milestone launch that will be key to winning back Chinese buyers.
The services push, however, comes with risks. China is tightening regulation of what it sees as its cyberspace, including online media, live streaming and gaming, and brought in a new cyber security law on June 1, pushing firms to store user data inside China's borders.
Apple has made swift moves to comply, despite concerns by overseas business groups who say the law's strict data rules and storage requirements are overly vague.
The new data center - part of a planned $1 billion investment in Guizhou province - has a potential political upside too. Beijing wants to turn Guizhou into a tech hub, while President Xi Jinping himself has close ties to the region as a delegate for the province at the Communist Party congress.
"By setting up a data center and pulling VPNs, (Apple) is sending a friendly signal to the Chinese government," said Liu Xingliang, head of the DCCI Internet Research Institute.
Apple said at the weekend it would remove virtual private network (VPN) services from its China App Store - systems that allow users to bypass China's so-called "Great Firewall" aimed at restricting access to overseas sites.
Beijing has targeted VPNs as it bids to tighten control over the domestic internet, a drive that is ramping up ahead of the Communist Party Congress later this year.
The U.S. firm's gamble here is clear: making moves to appease Chinese censors may prompt criticism outside China, but the firm will hope that local consumers are rather less fazed.
"It's normal that Apple wants to get along well with the Chinese government," said Wang Siyue, 27, a marketing professional in Shanghai, who is a long-term iPhone user.
"I will buy the next generation (iPhone) when it comes out. I'm just used to it," Wang said, adding she doesn't use VPN much, and Apple's move to take down the app wouldn't impact her decision to buy a new iPhone.