Compared with most other cities in this size all over the world, Shanghai is reasonably safe. You can walk around in the Nighttime even with your brandnew I-Phone in the hands or take the metro late night alone and there is nearly no risk to get in any kind of trouble. The tourist hotspots, like Jing'an temple , do suffer of the occassional pickpocket thieves, but not a lot like you would have in New York or Paris.
However, there is kind of fraud game, which causes many of Chinese tourist to lose thousands of Dollars. There are pimps in typical tourist areas who search for foreign visitors to guide them into a massage shop, coffee place, restaurant, girl bar, etc. However, you will always end up with some muscular guys, who will threaten you, and not-so-kindly ask you to empty your wallet and/or ask you to withdraw money from you credit card. It is easy to avoid these kind of scary scenario's however, you just need to follow one easy rule:
"NEVER EVER follow anyone who approach you on the street to bring you anywhere - no guy, no student, no women - NO ONE!"
There is a clear distinction between "regular business" and the "rip off scene". While underground stores will never provide an entirely reliable service, the "regular business" stores will generally not rip off their clients and try to build a reputation so customers will return. And mostly, no reliable shop work with these kind of "pimps" to get clients. While all the rip off providers will only find their customers by pimps. So if you don't follow a pimp, you will not get ripped off.