I was a bit disappointed in how much the question and the answers concentrated on the course/university/app. Students have agency and are relatively intelligent. There's one side of "how to change this in the future" which matters of course. But for making the environment safer? The teacher can literally state what's happening for the first few lectures: "This semester the class composition looks different, because we've been joined by a large number of students using app XYZ to select this class for its high female:male ratio. They're likely familiar with the curriculum already and are hoping for easy grades and the chance to get close to others under the pretext of tutoring. Keep this in mind if approached. You know who you are and you're still free to change your course for this semester. Now for the actual lecture..."
Even this seems over the top. A simple "Wow, the ratio of men to women in this class is much higher than it usually is" can get the point across there, without alienating the men in the class who actually care about the subject material. Women aren't oblivious, and people can absolutely draw their own conclusions with that info.