BEIJING (NYTIMES) - The Chinese entrepreneur behind TikTok took ample precautions when he set out to straddle the tech world's most treacherous divide: the one separating China's tightly controlled internet from the rest of the planet.
He made TikTok unavailable in China so the video app's users would not be subject to the Communist Party's censorship requirements. He stored user data in Virginia and Singapore. He hired managers in the United States to run the app and lobbyists in Washington to fight for it on Capitol Hill.
None of that counted for much in the end.
With TikTok now negotiating a sale to Microsoft under intense pressure from President Donald Trump, who said on Monday (Aug 3) that he was giving the go-ahead to such a deal, the digital wall between China and the United States is proving to be higher than ever at this moment of widening conflict between the two countries.
Only this time, it is the US government, not China's, putting up the barricades - an escalation that could foretell an even more restrictive time for companies in both nations.
ByteDance, the eight-year-old Chinese social media giant behind TikTok, is China's first truly global internet success story. The company's founder, Mr Zhang Yiming, 37, began pushing to expand overseas early on, believing that only a company with worldwide reach could remain on the technological edge.
But TikTok ended up resonating with American teenagers when even a platform for short viral videos is subject to political scrutiny.
Under China's leader Xi Jinping, the Communist Party has emphasised its ultimate authority over Chinese people and businesses. Suspicion never dissipated that TikTok - no matter how many non-Chinese executives it put in charge - might be unable to withstand pressure from Beijing to surrender user data or manipulate content.
Similar doubts already hang over many other Chinese tech companies. TikTok's sudden change of fortune could force them to re-evaluate their own international ambitions.
Mr Chibo Tang, a partner in Hong Kong at venture capital firm Gobi Partners, said that, increasingly, his advice to Chinese tech companies was to steer clear of the United States when expanding overseas - to follow instead the Chinese government's diplomatic overtures and investments in places such as South-east Asia, the Middle East and Africa.
"If you want to go out and tackle more difficult markets, sure, but obviously there's consequences and additional costs," Mr Tang said. "Going forward, Chinese entrepreneurs in these tech companies should be aware of that."
One unnamed entrepreneur put ByteDance's position in even starker terms to Chinese tech blog Huxiu on Monday: "Once the US business is lost, half of the space for thinking about globalisation has vanished."
As uncertainty swirled on Sunday about whether Mr Trump would allow Microsoft to continue negotiations with TikTok, ByteDance issued a late-night statement in China reiterating its commitment to going global.
"In the process, we are facing all kinds of complex and unimaginable difficulties," the company said. The statement cited the tense geopolitical environment, culture clashes and, in an unusually direct jab at a competitor, "Facebook's plagiarism and smears".
Facebook is rolling out a TikTok-like feature called Reels on Instagram, which it owns. Chief executive Mark Zuckerberg has also argued that undermining American tech companies with excess regulation could allow Chinese rivals to export their own, very different values to the world. Facebook declined to comment on ByteDance's statement.
For Mr Zhang of ByteDance, TikTok's run-in with the Trump administration has been an education in government relations, although hardly his first.
Mr Zhang falls on the geekier side of the tech founder spectrum. He repaired computers in college, and from past interviews, he appears most at home talking about algorithms and the flow of information. He is not a Communist Party member, he told The Atlantic magazine recently.
For many years, he echoed Mr Zuckerberg in saying he ran a tech company, not a media outlet, which meant he should not be imposing his own judgments over content.
"I can't accurately decide whether something is good or bad, highbrow or lowbrow," he told Chinese business magazine Caijing in 2016.
Mr Zhang may have thought he was insulating himself in China. But the perils of that technology-driven approach were made clear in 2018, when Chinese authorities shut down one of ByteDance's oldest products, a humour app called Neihan Duanzi, for spreading vulgar material.
"For a long time, we put too much emphasis on the role of technology and didn't realise that technology must be guided by core socialist values," Mr Zhang wrote in a public letter of apology.
ByteDance's popular news aggregator app, Toutiao, had also been under fire for saucy content. In response, Toutiao began featuring more stories about Mr Xi at the top of its feed.
Mr Zhang said he had studied another Chinese company's rapid growth overseas to see how it could be done.
Which company? Huawei.
His choice was prescient in hindsight, though perhaps not in the way he intended. The Trump administration has for years sought to undermine the giant Chinese maker of telecommunications equipment and smartphones. It, too, has been called a national security threat by White House officials, who fear the Chinese government could use Huawei gear for espionage.
International growth was top of mind when Mr Zhang began courting Musical.ly, a Chinese-made lip-syncing app that had found success in the United States and Europe. In late 2017, ByteDance agreed to buy Musical.ly for around US$1 billion. ByteDance would later merge the app into TikTok, giving it a toehold in the West that would eventually propel it to wider success.
According to people with knowledge of the matter, the two parties did not approach the Committee on Foreign Investment in the United States to seek its blessing beforehand - a decision that would later come back to haunt ByteDance.
The Committee typically evaluates foreign deals involving an American business for possible national security risks. But it also claims jurisdiction over deals between foreign businesses that have significant American operations.
As TikTok became a smash hit in the United States, concerns arose about whether the app was censoring content that might offend Beijing.
Late last year, The New York Times and others reported that the Committee on Foreign Investment in the United States was looking into the Musical.ly deal. Washington politicians also began voicing fears that TikTok could be a conduit for China to meddle in American elections.
With pressure building, some of Mr Zhang's investors and advisers offered ideas for putting distance between TikTok and ByteDance, including reorganising TikTok's corporate or legal structure.
But instead of a major restructuring, Mr Zhang opted for personnel changes. This spring, he reshuffled ByteDance executives in China and said he would personally devote more time and energy to Europe, the United States and other markets.
In May, Ms Liu Zhen, who had been overseeing ByteDance's global expansion, left the company. Mr Alex Zhu, a founder of Musical.ly, was replaced as TikTok's head by Mr Kevin Mayer, a veteran Disney executive in the United States.
ByteDance also embarked upon a lobbying push in Washington to sell the idea that TikTok's allegiances were with the United States, not China. In meetings with lawmakers, lobbyists emphasised the app's light, uplifting fare and the fact that many of its top leaders were American residents.
The Trump administration's scrutiny continued unabated. After Mr Trump failed to draw huge crowds at a June reelection rally in Tulsa, Oklahoma, TikTok users claimed to have pulled off a prank by registering for tickets and then not attending the event. In early July, Secretary of State Mike Pompeo floated the idea of banning the app over security concerns.
Within weeks, Microsoft said it had received Mr Trump's go-ahead for pursuing a deal to buy TikTok's US operations. The Committee on Foreign Investment in the United States had decided to order ByteDance to divest.
In a letter to ByteDance's employees on Monday, Mr Zhang made the recent turmoil sound more like a technical matter than an existential threat brought about by hostile geopolitical forces.
He wrote that the company had repeatedly emphasised that it was willing to make technical changes to address US concerns, yet the order to sell was made anyway.
"We do not agree with this decision, because we have always insisted on guaranteeing users' data security, the platform's neutrality and transparency."