I see. Hence evil maid attack. If someone has temporary physical access they could install malware that captures data when the device is unlocked. Chargers as an attack vector seem more likely, if more mundane.
Of course, none of that matters if you can reflash the device or exploit the boot ROM.