Angela Lang/CNET

TikTok narrowly escaped a ban in the US that would have started this past Sunday. But the app isn’t quite out of the woods.

SEE: Mobile device computing policy (TechRepublic Premium)

Citing national security concerns that TikTok collects and can share personal information about its users with the Chinese government, the Trump administration had ordered a ban that would have prohibited any US app store from distributing or maintaining the TikTok app, code, or updates. Set to go into effect on Sept. 20, the ban was delayed by the administration following news on Saturday that Oracle and Walmart had agreed to purchase up to 20% of a new US-based entity to be called TikTok Global.

On the surface, this move seems a step in the right direction. To allow the TikTok app to continue unabated in the US, Trump had said he wanted the company to be based in the US as well as owned and controlled by US companies with no Chinese influence.

Beyond the promise to purchase a stake in TikTok Global, Oracle said on Saturday that it would host all the data for the 100 million American TikTok users in its own secure cloud-based data centers. Oracle also said that TikTok Global would be majority owned by American investors, function as an independent American company, and be headquartered in the US.

A statement released on Walmart on Saturday indicated that the retailer has tentatively agreed to purchase 7.5% of TikTok Global and will provide e-commerce, fulfillment, payments, and other services to TikTok Global. Walmart added that it would work on an initial public offering of TikTok Global within the next year to bring even more ownership to American citizens.

But here’s where it gets tricky. If Oracle and Walmart will own only as much as 20% of TikTok Global, who will own the rest. That’s where current TikTok owner ByteDance has chimed in, claiming that it aims to use the financing from the pre-IPO to buy an 80% stake in TikTok Global. That seemingly would leave the majority ownership still in China where ByteDance is headquartered.

From there, the matter gets trickier. ByteDance is almost 40% owned by US venture capitalists such as Sequoia Capital and General Atlantic, according to a story published last week by the Wall Street Journal. Company founder Zhang Yiming owns 25%, employees own 20%, and non-US investors own another 20%.

On the surface, this seems to imply that TikTok Global would be 60% owned in the US; 40% by the US VCs that have a stake in ByteDance, and 20% by Oracle and Walmart. But even if the deal plays out this way, would that be sufficient to satisfy the Trump administration? Possibly, as control of TikTok may not be the main issue, according to investing and financial technology expert Richard Smith.

“This deal is a win for Trump,” Smith told TechRepublic. “It addresses his main concern that US citizen data be managed by US companies. Oracle will be housing TikTok Global’s user data in America. It’s not ownership of the company that was the issue, it was control of the data. It also elevates the profile of Larry Ellison who is a rare combination of tech leader and Trump supporter – another win for Trump.”

If the deal does go through, what would that mean for TikTok?

“TikTok gets to survive under ByteDance with a limited amount of interference from Oracle and Walmart,” Smith said. “Oracle and Walmart are going to be responsible for hosting cloud data and providing e-commerce related services respectively. Oracle would be able to review ByteDance’s source code, but ByteDance’s system algorithms would not be required to be shared with its two new partners. This is great for TikTok, as they get the added expertise of Walmart and Oracle for 20% of their company and having to adhere to US corporate tax regulations.”

But even when and if the deal gets done, national security concerns won’t necessarily go away, according to Smith.

“This deal will likely get done sooner rather than later, but it may not be the last we hear about dubious TikTok business practices with regards to data collection,” Smith said. “Some politicians have already expressed concern that TikTok will update their code to secretly collect American user data since this deal still leaves control of the code with ByteDance. This is an emerging case study for the nascent surveillance economy, and this deal won’t likely put it to bed for good.”