BEIJING (BLOOMBERG) - Just a few days ago, the TikTok deal looked like a win for China.
Now its state-run media are denouncing it as "an American trap" and a "dirty and underhanded trick".
The quick shift in sentiment shows the complications of concluding an agreement that is about much more than finding a proper valuation for an addictive video app that has enthralled teenagers around the world.
It also has big ramifications for how the world's biggest economies handle security threats related to new technologies that will drive growth over the next few decades.
For China, the political stakes are similar to the marathon trade talks that ended with a phase one deal in January.
Any agreement that makes it look like the Trump administration forced China's hand could hurt President Xi Jinping, who has repeatedly hailed the Communist Party's emergence as a great power in contrast to the humiliations suffered under colonial powers centuries ago.
"Beijing basically doesn't want to set a precedent where the US can be allowed to unilaterally flex in this way," said Ms Kendra Schaefer, head of digital research at the Trivium consultancy in Beijing.
"Having some role to play in the decision balances things out a bit."
Over the weekend, Oracle Corp and Walmart Inc agreed to take 20 per cent of a new US-based entity called TikTok Global that would ringfence the app's international operations and data, said to be worth up to US$60 billion (S$82.33 billion).
ByteDance Ltd appeared to get most of what it wanted, including getting to keep the valuable artificial intelligence algorithms for its short-video app.
That appeared to appease both President Donald Trump, who declared victory and called off a ban on TikTok, as well as China's most nationalistic media.
Mr Hu Xijin, the influential editor-in-chief of the Party-run Global Times, said the deal was "still unfair but it avoids the worst result".
By Monday, signs of trouble emerged. ByteDance asserted that it would remain in control of TikTok Global, appearing to contradict Mr Trump's earlier comments about how Americans would direct the new entity.
Oracle issued a statement backing Mr Trump's view, and the American President warned he could still torpedo a deal if US parties didn't have a majority hold.
"They will have nothing to do with it, and if they do, we just won't make the deal," Mr Trump said, referring to ByteDance, which owns TikTok.
"It's going to be controlled, totally controlled by Oracle, and I guess they're going public and they're buying out the rest of it - they're buying out a lot, and if we find that they don't have total control then we're not going to approve the deal."
On Wednesday, two of China's most prominent state-backed media mouthpieces denounced the deal.
"What the United States has done to TikTok is almost the same as a gangster forcing an unreasonable and unfair business deal on a legitimate company," the state-run China Daily wrote in a Wednesday opinion piece.
Mr Hu from the Global Times tweeted that Beijing likely wouldn't approve the current agreement as it endangered China's national security.
The saga has sparked "complete disbelief" among Chinese leaders, said Professor Gao Zhikai, a former diplomat and translator for late leader Deng Xiaoping who is now chair professor at Soochow University.
"China wants to emphasise that the Chinese companies' legitimate rights cannot be violated without consequences."
On Wednesday in the US, ByteDance asked a federal judge to stop Mr Trump from implementing a ban on TikTok that is scheduled to begin this weekend.
It's unheard of for the major parties to a mega-deal to diverge so drastically on its basic contours.
While Mr Trump has yet to give his final sign-off and the deal therefore remains in flux, Beijing will intervene if it feels ByteDance risks giving up too much, Trivium said in a Tuesday note.
How exactly that would happen is unclear.
The Commerce Ministry or the Ministry of Science and Technology could step in if they have concerns over technology transfer. Several others could get involved for anti-trust issues. And reservations around national security could involve any body from the State Council or Cabinet on down.
"The decision could be well out of the hands of the Ministry of Commerce and decided by top leadership from both sides," said law professor Xu Ke of the University of International Business and Economics.
"The TikTok case needs to be seen in the context of the trade war, tech decoupling and wider competition on technology between China and the US."
While Treasury Secretary Steven Mnuchin remains confident that Mr Trump will sign off on the transaction, US national security officials are raising concerns that the data of American TikTok users would remain with a Chinese company, Bloomberg reported.
TikTok's algorithm could also potentially still be used to influence public opinion - particularly ahead of the Nov 3 elections.
China is getting ready to hit back. The Commerce Ministry on Saturday said it could restrict trade, investment and visas for companies on an "unreliable entity list" without naming anyone specifically.
It's still possible a deal gets done. ByteDance has made clear its AI technology remains in Chinese hands, while TikTok's data on more than 100 million Americans will be stored by Oracle on US servers.
Now it appears to be more a question of the political feasibility, both for Mr Trump and Mr Xi.
China's leaders "don't want to play in favour of Trump for nothing", said Mr Ding Chenling, a tech entrepreneur who said he has known ByteDance founder Zhang Yiming for over five years.
"That will also anger nationalists in China."