Did you claim and recheck your bag in Shanghai?
They have battery scanners at check-in, in China. Once, a friend and his wife who was connecting from an international to a domestic flight at PVG, the alarm went off because of some rather risqué toys in their baggage which lead to a rather awkward encounter with the guard who checks the bags that set off the alarm.