Echoing everyone else, I've been through the Shanghai airports (and those elsewhere in China) many, many times and never experienced, or even seen, security like the OP describes, either for foreigners or Chinese citizens. Indeed, I would say that my experiences with Chinese airport security have been universally professional, something which cannot be said for the TSA.
Indeed, I've never had any problems with authorities in China at all, other than the typical annoyances stemming from inefficient bureaucracies that plague governments the world over...