Buy new adhesive, clean the old one completely and apply new one carefully every time you open it. Do not even consider reusing old adhesive. If any external parts are replaced, check all openings (for example speaker holes) on them to make sure they are as good as the original parts.
In this way you should be able to make it still properly sealed after repair. I have no idea on how to test it for sure though. Sony has special equipment and procedure to test their waterproof gadgets after repair. Generally there is an inspection port, you remove the sticker on that port, use a hand vacuum pump to suck air out and see if the air pressure leaks back into it. iPhone 7 has a baro vent so this method does not work.