And you think China won't bomb foreign adversaries if they can? Or any country for that matter.
The answer is don't place yourself in the crosshairs of great powers in the first place, which then puts into the degree you can align yourself with their interests.