If he does this, it may really damage your friendship. After all, everyone is not so open and doesn't like to be naked in front of others. When he breaks in, you can cover your vital parts with your hands and tell him to go out to take a shower. Tell him that he is not an open person and doesn't want him to do this.
If you are a girl, if you are just a roommate with him, then when he breaks in, you should find some bath towels or something, first block your key parts in front of him and then call him out, as long as you scare him not to go out, call the police. Girls should protect themselves when they go out, don't share the rent with girls, and never share the rent with boys. After all, men and women are different, and boys must live in the same room.
In case of some emergency, we should protect ourselves flexibly and reasonably in time, know that life is the most important thing, know how to deal with him, and threaten him to make him afraid. When renting a house, girls should first have a general understanding of the co-tenant, and then keep the phone numbers of their relatives and friends. If something happens, they can ask for help in time. There are also places that may expose their privacy, such as bathrooms and bedrooms, which should also be carefully checked to prevent them from being peeped or eavesdropped. Once these situations are discovered, they should be reported to the public security department in time.