Open main menu

DAVE Developer's Wiki β

Changes

Embedded Android FAQs

1,404 bytes added, 08:22, 15 March 2018
additional note on group membership apply
==FAQs==
 
===Q: How to get the hardware serial number? (NXP i.MX6-based systems only)===
The hardware serial number (as defined [https://developer.android.com/reference/android/os/Build.html#SERIAL here]) can be programmatically accessed as described in this page: [https://stackoverflow.com/questions/11029294/android-how-to-programmatically-access-the-device-serial-number-shown-in-the-avthis page]. It is worth to remember that the hardware serial number is stored in this pseudo file: <code>/proc/device-tree/som/uniqueid</code>. ===Q: How to get the network interfaces' MAC address?===The network interfaces' MAC address is stored in this pseudo file: <code>/sys/class/net/<net_if>/address</code> e.g.: for the primary ethernet interface <code>eth0</code> the MAC address is stored in the file <code>/sys/class/net/eth0/address</code> For more details, please see [https://stackoverflow.com/questions/7332931/get-android-ethernet-mac-address-not-wifi-interface this page]. ===Q: Why am I getting <code>socket: Permission denied</code> when I run <code>ping</code> as root? === Android kernels by default uses <code>CONFIG_ANDROID_PARANOID_NETWORK</code> configuration, to enable Internet permission check with its API. This requires that all process that want to access network resources belongs to specific hardcoded GID First of all you need to add those special GID to you root file system: <pre>groupadd -g 3001 aid_btgroupadd -g 3002 aid_bt_netgroupadd -g 3003 aid_inetgroupadd -g 3004 aid_net_rawgroupadd -g 3005 aid_admin</pre> And then add <code>root</code> (or the user you want to allow to access network resources) to those group, e.g.: <pre>usermod -a -G aid_bt,aid_bt_net,aid_inet,aid_net_raw,aid_admin root</pre> Please note that you have to logout and login again to apply group membership.
It is wort to remember that the hardware serial number is stored in this pseudo fileReference: https: <code>/proc/device-treestackoverflow.com/somquestions/uniqueid<36451444/code>.what-can-cause-a-socket-permission-denied-error
768
edits