Short answer: Not Possible
Longer answer: As soon as you lose control of the hardware (i.e., your software is running on a phone that you don't own) you can no longer guarantee that the software talking to your server is in fact the software you wrote.
As you pointed out, there is nothing you can do to prevent the user from reverse engineering the app and ...
who is responsible to define the algorithms, the class and data structures in a scrum team?
That is entirely up to the scrum team.
Now we are starting to use scrum. I understand the Product owner defines the product requirements.
Does that also mean that they define all the software aspects, like data structures, classes, algos?
No, not unless the ...
The product owner only define product requirements or features, the team or developer define how to do it.
Scrum doesn't tell you how the developers manage or write code, just how to manage the development process. You can use scrum in many ways, just keep working as you do. If the way you work give you good result don't change. Just use scrum for developmet ...