Google and Apple shouldn't be helping China get you to do that, by hosting and advertising it in their app store though*. Oracle shouldn't be helping China spy on Americans by hosting their services.
This isn't a law against you installing things on your phone. You're still free to install whatever you want on your phone.
*And if there is a valid first amendment claim here, it would probably be Google and Apple claiming that they have the right to advertise and convey TikTok to their users, despite it being an espionage tool for a hostile foreign government. Oddly enough they didn't assert that claim or challenge the law.