How To Bind To A Port Less Than 1024 In Android?
Solution 1:
To bind to a port less than 1024, you need to be root and there are two ways of doing that.
System app : The app should be installed into /system/apps folder from where it shall be run as root. However, there are some signature issues for which help is available. Distribution is also a problem with system apps.
su binary : The su binary can be invoked using a simple
exec("su -c [command]")
. But things are easier said than done. You need to run an android processes not just a single command. Hence, there is libsuperuser which provides you the methods and has a full-length doc page.
Solution 2:
This is a very similar question: Run secure API calls as root, android, though they are trying to run as root for a different reason.
That made me wonder about installing 'system apps', and I saw this: https://android.stackexchange.com/questions/27/rooted-how-to-install-a-system-app
Post a Comment for "How To Bind To A Port Less Than 1024 In Android?"