As a thought experiment, what would happen if you wrote your own malicious payload to a burner device and handed that over? What if you warned the border agents that your device would deliver malicious code and they plugged it in anyway?
I believe there was a defcon talk about this but for the life of me I can't find it. My advice is to epoxy your lightning port closed (or snip the data connection inside the phone) and use wireless charging exclusively.
My guess is it would be like setting up a trap gun and putting a sign on the door warning about it. Still illegal. But I'm a rando on the Internet and a loooooong ways from being any kind of lawyer, and I didn't stay in a Holiday Inn Express last night, either.
Huh? I'm asking about the realistic outcome, whether that be denial of border crossing, criminal charges, or they choose to not examine the device and let you through.
What if you planted a bomb in a package on your doorstep with instructions on it telling people not to open it? What if the package thief stealing your package opens it and causes an explosion injuring themselves and maybe others?
You're describing a (digital) booby trap. Since you're knowingly targeting law enforcement officers, I'm not sure legal theory factors into whether you could get away with it in practice but even theoretically the answer is probably no, that's a computer crime.