Google Appears to be Set to Block Hidden APIs in Android P

While we are still a few months away from seeing a developer preview, work is steadily going happening on Android P.  There is one change however that could impact developers who are accessing hidden APIs in Android.  It looks like access to them is going to be blocked in P.

A new commit in the Android Release gerrit suggests that access to hidden APIs will be blocked, forcing developers to use the approved APIs in the release.

The following patch enforces the hidden API blacklist, preventing access to boot class path methods/fields marked by the `hiddenapi` tool using static linking, reflection and JNI.

This could require some developers to rework their apps if they want them to work on Android P.

The reason Google wants to do this is because it will prevent apps from running unsupported APIs that can cause stability issues for the app or the device itself.   Equally, using hidden APIs could potentially lead to security issues if an exploit is discovered.

With each release of Android, there is an updated set of APIs that developers can use for their apps.  Android P will be no exception as new APIs to support new functionality will be added.  Google wants developers to use the API set provided and not use hidden, unsupported APIs.

Ultimately how this will flesh out when P is released to developers remains unclear.  Given however that this is in the release review section, it is likely to be there when it is released.

%d bloggers like this: