The Public Security Bureau (i.e. Police) in Shanghai maintains a hotline for foreigners if they run into trouble.  The person who answers the phone supposedly understands and speaks English.  The number is 021 63576666.  Be aware that if you encounter a medical emergency, ambulance service is slow and unreliable, and they often demand payment in cash(about RMB 199) up front before they will transport you.  It's better to take a taxi to the emergency room.