(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 U.S. can be allowed to unilaterally flex in this way,” said 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% of a new U.S.-based entity called TikTok Global that would ringfence the app’s international operations and data, said to be worth up to $60 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 Donald Trump, who declared victory and called off a ban on TikTok, as well as China’s most nationalistic media. 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.”Read more: The Math Doesn’t Add Up on TikTok’s Deal With Oracle and WalmartBy Monday, signs of trouble emerged. ByteDance asserted that it would remain in control of TikTok Global, appearing to contradict Trump’s earlier comments about how Americans would direct the new entity. Oracle issued a statement backing Trump’s view, and the American president warned he could still torpedo a deal if U.S. 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,” 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. Hu from the Global Times tweeted that Beijing likely wouldn’t approve the current agreement as it endangered China’s national security.Read more: Oracle Deal for TikTok in Doubt After Trump, China RemarksThe saga has sparked “complete disbelief” among Chinese leaders, said Gao Zhikai, a former diplomat and translator for late leader Deng Xiaoping who is now chair professor at Soochow University. “China wants to emphasize that the Chinese companies’ legitimate rights cannot be violated without consequences.”It’s unheard of for the major parties to a mega-deal to diverge so drastically on its basic contours. While 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 antitrust 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 Xu Ke, a law professor at 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 U.S.”While Treasury Secretary Steven Mnuchin remains confident that Trump will sign off on the transaction, U.S. 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.How Blacklisting ‘Entities’ Became a Trade War Weapon: QuickTakeIt’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 U.S. servers.Now it appears to be more a question of the political feasibility, both for Trump and Xi.China’s leaders “don’t want to play in favor of Trump for nothing,” said 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.”For more articles like this, please visit us at bloomberg.comSubscribe now to stay ahead with the most trusted business news source.©2020 Bloomberg L.P.