I don’t think that China need even consider Ukraine an adversary, but a stronger Russian state (or one more interested in its eastern flank) is not good for China. Ukraine is simply collateral damage.
It's a curious symbiosis that is very much against the interests of Russia, but that's what you get when a mafia takes over your country.