I have made a service written in c that runs on the Android operating system as a core service. I have a few Android apps which communicate with this service via a socket connection (Java -> C).
My issue is that anyone can open a connection to my service if they know which port it is using. The applications have no credentials and just run in the Android sandbox.
What methods can I use to at least try and prevent bad app from accessing this service? as its on local host ssl does not seem relevant?
Both apps are compiled so I could share a secret key between them, but the Android apps could be decompiled.
How can you normally secure client/server connections on the same machine?