Except those searches can be done at the behest of other law enforcement agencies and any information found can be shared with them.
I recommend reading through this document assembled by the EFF about various kinds of border searches and the constitutionality thereof.
Here's what the EFF does say about the CPB doing exactly what I described.
> The evidence includes ICE and CBP policies and practices that authorize border officers to conduct warrantless and suspicionless device searches for purposes beyond the enforcement of immigration and customs laws. Officials can search devices for general law enforcement purposes, such as enforcing bankruptcy, environmental, and consumer protection laws, and for intelligence gathering or to advance pre-existing investigations. Officers also consider requests from other government agencies to search devices. In addition, the agencies assert the authority to search electronic devices when the subject of interest is someone other than the traveler—such as when the traveler is a journalist or scholar with foreign sources who are of interest to the U.S. government, or even when the traveler is the business partner of someone under investigation. Both agencies further allow officers to retain information from travelers’ electronic devices and share it with other government entities, including state, local, and foreign law enforcement agencies.
https://www.eff.org/press/releases/new-documents-reveal-dhs-...
No you don't. Not at the border.