> it doesn't benefit anyone to have a real hostile relationship.
It benefits China greatly to have a "hostile" relationship, at least as far as using networked computing to carry it out.
Computers and cyber-attacks bring a lot for China that are asymmetrically not as advantageous for much of the rest of the world.
- They are much more covert means of conducting espionage (either industrial or political, take your pick). Obviously NSA finds this useful too, but even if we assume NSA had an industrial espionage program as advanced as China's, what does China have for the U.S. to steal, relative to what the U.S. has for China? This question repeats itself for every other country in the West.
- Attribution of cyberattacks is difficult, which adds to the deniability aspect. If literally all that China has to worry about is a loss of face, then they can proverbially cry all the way to the bank. No one is going to be nuking or invading China for an over-active spy program.
- Because of the economic ties you mention, it is difficult for victim nations to take effective deterrence measures to convince China to change their behavior, since many measures that might cause China to feel a pinch would hurt the parties imposing sanctions just as much.
Moreover, "eye for an eye" is taken off the table by the asymmetric nature of the threat, and passive defense is taken away by the interconnected nature of the Internet. Sure, the U.S. and its critical industries can do better as far as defense, but so far it's been a case of "the bomber will always get through".
So looking at the situation from China's perspective, you'd almost have to ask why they would ever stop. Western norms and morals are not necessarily their norms and morals and in any event the deterrence/coercion framework is simply not there. There's no good reason for China to stop covert methods (even if there are good reasons to avoid being overtly hostile).