Unfortunately not consenting and knowing your rights doesn't help because they will search your belongings anyway. You can only delay the search which usually will not work in your favour. It happens in many developed "rule of law" countries. Something similar happened to me in Germany when traveling alone by car. When they noticed I have multiple smartphones with me they went hysterical. Luckily I had no cash on me, neither drugs of course. They were pursuing some criminals and perfectly wasted half an hour on scrolling my smartphones. Not even a single nude photo, just sunsets and travel photos with my girlfriend. Great job Kriminalpolizei from Dresden.