Keeping to well lit areas late at night is a great way to stay in safe areas. The bigger issue in Shanghai is pickpocketing. When walking around pedestrian boulevards and outdoor shopping areas no pocket and no bag is safe. Again, being aware of the surroundings is the best policy.