As a US campaign to sever TikTok from its Chinese parent heads to the Senate, analysts say Beijing's response to a forced sale of the app -- and its 'secret sauce' algorithm -- will be clear: Hands off.
Under new legislation that passed the House of Representatives last week, TikTok could be banned in the United States if it does not cut all ties with Chinese tech giant ByteDance.
But in the battle over TikTok's future in the United States, what strikes many as a contradiction has emerged: while the company tries to convince Congress of its independence from Beijing, China has come out swinging in its defence.
Beijing does not want a precedent to be set where a Chinese company is strong-armed into selling one of its most valuable assets, including an algorithm that is the envy of competitors, analysts say.
"This kind of threat is like daylight robbery," Mei Xinyu, a Beijing-based economist, told AFP. "All things considered, the Chinese government's actions so far have been very mild."
"What the US government is proposing is way over the line."
US lawmakers and security agencies say TikTok presents a threat because China can access and use the vast troves of data the app collects for influence and espionage.
TikTok has denied the allegations, saying it has spent around $1.5 billion on "Project Texas", under which US user data would be stored in the United States.
However, many lawmakers and bodies including the FBI remain unconvinced.
Some critics have said the data itself is only part of the issue, and that the algorithm that produces personalised recommendations for TikTok users must also be disconnected from ByteDance.
That ByteDance algorithm has helped drive TikTok's stratospheric success since the app was launched for the international market in 2017.
It crunches huge amounts of user data, such as their interactions on the app and their location, to provide more content tailored for them.
Its precise details are a closely guarded secret, but it helped propel TikTok to one billion users in just four years. Facebook, by comparison, took more than eight years to reach that milestone.
Other social media platforms also deploy tailored recommendations based on algorithms that analyse user data, but analysts say TikTok's has been so successful that it is considered by some to be the company's most precious asset.
The algorithm is "valuable because TikTok is sticky. People spend more time on TikTok than they do on other social media", James Andrew Lewis, a technology expert at the Center for Strategic and International Studies (CSIS), told AFP.
"This is the secret sauce that makes TikTok a success."
The algorithm has been at the centre of discussions about any potential sale of TikTok since the administration of then US president Donald Trump sought to ban TikTok in 2020.
That year, the Chinese government designated algorithms that provide recommendations based on user data analysis as a protected technology, meaning their export would require Beijing's approval.
While no specific app or firm was cited, the economist Mei said the move was "to a very large extent" because of US pressure against TikTok.
TikTok has said that under Project Texas, its recommendation algorithm for US users is stored along with their data on Oracle servers in the United States.
However, The Wall Street Journal reported in January that ByteDance employees in China updated the TikTok algorithm so frequently that Project Texas workers could not track all changes.
TikTok did not respond to AFP's questions about the Wall Street Journal report or about where its algorithm is updated.
CEO Shou Zi Chew has said previously that TikTok will not be "manipulated by any government" and that it has never been asked by the Chinese government for US user data.
In Beijing, however, officials have not minced words in their opposition to the TikTok bill, saying China will take all necessary measures to protect its interests.
"You've got the desire to protect the option for a relationship with the intelligence services, and you've got a little bit of nationalist pride because it's so successful," said Lewis at CSIS.
"Some of it is just (being) annoyed with the Americans for trying to force them to sell. All of that puts Beijing right behind ByteDance."
Beijing wants to avoid a forced sale to protect Chinese firms, Zhang Yi, founder of the Guangzhou-based tech research firm iiMedia, told AFP.
"Once the precedent is set, there may be countless other Chinese companies that will face a similar fate in the future."
Hu Xijin, a former editor of the nationalist Chinese newspaper Global Times, urged ByteDance not to give in to US pressure.
"The essence of this matter is commercial plunder," he wrote this month.
"As long as ByteDance remains firm, willing to shut down TikTok rather than give up ownership, it will create reverse pressure on the passage of the bill."