1

I know how permissions work at the Android SDK level, but how exactly does it work in native code? When a system call is made in native code, what determines whether the call to socket() fopen(), ioctl(), etc, is allowed?

I read these questions:

android native code security

How is Android permission enforced?

But the first one is not actually answered, and in the second the link the answer isn't working & I don't have the rep to comment on someone else's answer yet.

Community
  • 1
  • 1
Android QS
  • 416
  • 2
  • 8
  • 17

1 Answers1

2

but how exactly does it work in native code?

The same as it does everywhere else. Permissions are defined for the process. In the case of things that native code can access directly, the native code you communicate with checks the permissions.

But the first one is not actually answered

Yes, it is. Look for the green checkmark.

in the second the link in the answer isn't working

Yes, that links back to a site that is no longer in operation (plus, the file was renamed). This should be the file fadden linked to, mirrored on GitHub.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • So if my app has use of android.permission.INTERNET, the process is assigned the appropriate group ID to be granted this permission? – Android QS Jan 22 '13 at 22:16
  • Is there any documentation for mapping system/library calls to their necessary Android permissions? – Android QS Jan 22 '13 at 22:25
  • @AndroidQS: None that I am aware of, though there aren't all that many that should be relevant. `INTERNET`, `READ_EXTERNAL_STORAGE`, and `WRITE_EXTERNAL_STORAGE` definitely matter. But a lot are only relevant for things that NDK code would have to go through the SDK for (e.g., `READ_CONTACTS`). – CommonsWare Jan 22 '13 at 22:33
  • 2
    The file $ANDROID_SOURCE/frameworks/base/data/etc/platform.xml contains a list of permissions that are implemented as groups. – G. Blake Meike Jan 23 '13 at 00:06