Yes, but electronic devices can't digitally contain physical substances that might be subject to customs laws. It's not comparable. It's probably still today reasonable to search ships in the harbor and passengers for physical substances (like banned animals or fruits/vegetables), but it's not obvious to me how searching electronic devices achieves any reasonable objective related to customs law.