SHANGHAI, China — China has gone from basketball-mad to mad over basketball.

But is all this anger coming from the common man or the communist government?

It’s complicated.

“It’s a crazy time,” one 30-something told the Post. “It’s so complicated. Very, very complicated.”

With undertones that are both social and political, Hong Kong’s relationship with mainland China was complex even before the protests started, and long before Houston Rockets GM Daryl Morey started an international incident with his tweet backing the pro-democracy protesters.

The tweet left many in China vexed, but NBA commissioner Adam Silver’s support of Morey’s right to free speech — if not the message — left the communist government downright irate.

“It’s complicated,” a restaurant worker in the Bund area said, adding in quiet conspiratorial tones, “Politicians are always dirty. I don’t want to talk too much, but it’s always about politicians.”

The Post found differing degrees of anger over Morey’s tweet. One local said the Chinese want an apology, not Morey to be fired.

“That’s what we want. Well, that’s what our government wants. Quit or not quit, that’s not our business. They just want him to apologize,” said a local calling himself Peng.

“We don’t need your support. (Don’t) support the mad people . . . He’s never been to Hong Kong to see how crazy they are. They damage bank machines, the bus, take rocks to the police station.”

The Post spoke with one Hong Kong resident in the Pudong neighborhood, a U.S.-raised 30-something. She rued the fact that the government shut down the Nets and Lakers public appearances — the teams were in China for a week and played two preseason games on Thursday and Saturday — and said the fans are the ones caught in the middle.

“It’s a shame. They just want to see basketball. Some people are (mad), but it’s mostly just the government.”

The NBA banners that adorned the streets are now gone. Chinese TV cancelled broadcasts and sponsors jumped ship to the extent some NBA teams are bracing for next year’s salary cap to drop 10-to-15% from lost revenue, according to Yahoo.

While Taiwanese-born Nets owner Joe Tsai’s stance on the issue has left fans forgiving of his team, at the NBA Style shop near Jing’an Temple in the Puxi neighborhood, Houston Rockets gear had all been plucked off the shelves and tossed in a heap on the floor.

One basketball-loving local’s eyes widened when approached by The Post’s Nets beat writer.

“If this situation happened last season you’d have Jeremy Lin; but he left the NBA and came to the CBA. In time you calm down each part, your part, our government, then recover before next season,” he said, before laughing “then you get [Nets player Kevin] Durant back.

“Brooklyn still will have good relationship with China because of Joe’s statement. So we will still love and happy to see Brooklyn on TV — if we can still see any game on TV.”

When The Post approached a fan near the NBA Style shop wearing a Stephon Marbury shirt, he waved him off and hurried away briskly. And fans that had lined up at the team hotel covered their faces whenever cameras were around, afraid to be seen supporting the NBA.

“It’s not that the police will arrest them. But if their face gets shared on social media people will attack them — and it will get shared,” the restaurant worker told the Post.

“On Weibo [a local social media platform] Chinese people if you say I watched LeBron James last night, I watched Kyrie Irving, so many people will attack you. Why you go do that, what’s wrong with you? Are you coward? If you like the American basketball why you don’t immigrate to the America?”

That kind of discord has become common, with some taking grievous offense and others just wanting to watch their team play.

“I cut off all ties with my father after he said that he would continue to support the Houston Rockets,” one ranted on sports forum Hupu, according to the South China Morning Post. “The national interest is much more important than family relationships.”