Don't bring data you are not ok with a foreign government forcing you to handover. That's the simplest solution.
Back all your important data up, then wipe your phone before you go. Same with the laptop. You can't be coerced into giving something you don't have.
Threat modeling is important. If your just an average Joe being a tourist it is highly unlikely the Chinese government is going to take your devices to search.
Source: travelled to China for an extended period of time.
all 5 comments