Platform support for static shared libraries
This change adds support for static shared libraries that emulate static linking allowing apps that statically link against the same library version to share a common implementation. A library is hosed by a package in a standard APK. Static shared libraries have a name and a version declared by a dedicated manifest tag. A client uses also a new tag to refer to the static library it uses by specifying the lib name, version, and the hash of the signing certificate. This allows two apps to rely on two different library versions and prevents impersonation of the shared library by a side-loaded app with the same package name. Internally apps providing static libs use synthetic package name generated from the manifest package name and the library version. This allows having different "versions" of the same package installed at the same time. An application cannot be installed if a static shared lib it depends on is missing. A used shared library cannot be uninstalled. Shared libraries can rotate certificates like normal apps. The versions of these libs should be ordered similarly to the version codes of the hosting package. Such libs cannot use shared user id, cannot be ephemeral, cannot declare other libraries, cannot rename their package, cannot declare child-packages. They must target O SDK. Also they cannot be suspended or hidden or their uninstall blocked. Generally, speaking policy regarding code in static shared libs should be applied to the packages using the library as it could have just statically linked the code. We now have APIs to query information about the shared libraries on the device in general. To clients static shared libraries are presented as multiple versions of the same package which is how they are declared and published. Therefore, one can have two versions of the same package which means we need way to query for and uninstall a specific version of a package. Also static shared libs can depend on other static shared libs which are versioned packages. To ease representation we add the concept of a versioned package which should be used in the case of static shared libs. A client can see only the static shared libs it depends on and more specifically only the versions it depends would be retrieved by using the standard package manager APIs. There is a new dedicated API to get info about all shared libraries which would provide data about all static shared lib versions. Also these libraries must use v2 signing scheme. Test: CTS tests pass bug:30974070 Change-Id: I4f3d537ee7a81f880950377b996e1d9d4813da5c
Loading
Please register or sign in to comment