30 to 40 years? I have to disagree. This can be done in 3 to 4 years. Software is order of magnitude easier than EUV... now if you are talking about the first mover advantage in terms of network effects, (same reason why Google Wave, Google Buzz, Google Plus, Google Orkut, etc weren't able to take on facebook or instagram etc) then that would be a different matter... but software itself is incredibly easy.
Making a Gmaps, Google search, YouTube, Facebook, Twitter etc competitor is not the hard part, the hard part is capturing enough mindshare of the world.
If US really severs all relationship with China, then the US patents have no hold over China at that point. Same goes for copyrights, trademarks, etc Chinese government already have Windows 10 source code, they can make their own version of Windows literally overnight (Microsoft gave them the source code to the Chinese Government Edition of Windows 10). Software can be pirated, reverse engineered, this is not rocket science.
You can't just download the AutoCAD to a jet engine and start making the jet engine even if you found the F-35 blueprints on a contractor's laptop like the US falsely claimed CHina to have stolen F-35 blueprints etc... But software is digitally by definition, if you get the source code to some application like MATLAB or Cadence for example, you just compile it, you bascially are instantly up to speed that very moment. Therefore software is the easiest part, the harder part is getting the people of the world on your platform.
If replicating what Google does was easy, you would already have American competitors who will take market share away from Google. They can't because Google has the right set of engineers and existing base that enables them to always be better than their competitors. And another factor is mental inertia of the consumers. Once you are accustomed to Google or Facebook, why would you Choose Bing or Baidu? You will not unless Baidu or Bing is much better than Google and people find it more beneficial to use them.
Software is much harder than Hardware to actually replace. Yes, you can copy the source code but you cannot copy everything, there will some parts that will be much more optimized. Then there is the eco-system. All the software that people have developed for Windows for 30 years simply cannot be ported to another OS without billions of dollars of investment. What about companies that use that software and people who have been trained to use that software? Can you replace them?
Linux simply has not been able to replace windows despite the efforts of many companies for decades. There is just not enough incentive to convince people to do so. Compare that with hardware, you can easily replace intel chips with AMD or Via or Kungpeng. ARM has replaced x86 chips in desktop by developing some emulators.
Hardware is super easy. In fact China already has it figured out. The reason they don't have chip foundries or EUV machines is not because it is incredibly difficult. Its because you need a large capital investment and China did not have the need to make that investment before. The Chinese and in fact the world never thought someday they will be banned by US from buying chips or EUV machines. Before Trump no one thought something like this will be even tried.
So Chinese only focused on getting market share with least amount of effort. So, they made phones with existing solutions. They bought Google OS, ARM chips and Taiwanese foundries. That's what you do when you live in a globalized world.
Why does China does not have most advanced engines? because they did not even have the know-how to even make an air frame. They did not need to invest money in a jet engine. Once the need arises, capital is invested, people are hired and things start to happen.
China can poach engineers with higher pay. They can steal designs. Its just a matter of not having the need to do so before.
This is much easier than actually convincing the entire world that Google, Facebook who already super efficient in terms of service, are not good enough and you need to use my service. Chinese companies need to make their internet services several times better than what Google and Facebook can provide and only then they will start to get that market share.
But if you only focus on the domestic market, then yes China already has its own eco-system and extremely innovative internet companies. But those companies need to get out and win market share around the world before the public will buy a phone that does not have any american software or service. And if that Chinese phones takes a shortcut and uses American service like Facebook or Google, then it is vulnerable to a ban by US govt.
So, no, 3-4 years is not enough for Chinese branded phones to be viable outside China without US eco-system. Not even 30-40 years may not be enough. Its an extremely hard challenge. Hardware is easy by comparison. They just did not invest on it before. Once they do, its just a matter of a few years to get it done.