For example:
Samsung Galaxy S8 / S8+ | S9 / S9+ have the protection class IP68 / IP68 certification
Galaxy S8 SM-G950F / Galaxy S8+ SM-G955F
Android 9 , with Security patch Mar 2020
Galaxy S9 SM-G960F / Galaxy S9+ SM-G965F
Android 10 , with Security patch Mar 2020
The camera is ultimately only as good as the camera software. And it is well known that custom ROMs are inferior to proprietary manufacturer software.
https://e.foundation/product/e-os-galaxy-s8-refurbished/
https://e.foundation/product/e-os-galaxy-s9-refurbished/
https://e.foundation/product/e-os-galaxy-s9-plus-refurbished/