OSDN Git Service

Enable the PRC compatibility package feature for PRC market
authorxiajiang <xia1.jiang@intel.com>
Wed, 17 Feb 2016 18:59:14 +0000 (13:59 -0500)
committerMauro Rossi <issor.oruam@gmail.com>
Fri, 5 Nov 2021 01:36:34 +0000 (02:36 +0100)
commitd0dc2d02d0da81df85e904c30e439a041d26d47b
tree7df7cf2f7cdf264917d0504dae24d8807096a1d7
parent0dbeafab76d2190ea7f4ea1f127b34aeb6bb6045
Enable the PRC compatibility package feature for PRC market

In PRC market, some APKs are packed in non-standard way, that is,
the x86(_64) libraries aren't workable although they're found in the APK.
This patch intends to relieve the impact from below 2 defects,
which is based-on the heuristic algorithm.

NOTE: To enable this feature, set "PRC_COMPATIBILITY_PACKAGE := true"
in device BoardConfig.mk before enabling houdini.

1. Missing x86(_64) libraries: The x86(_64) libraries are ported and
   existing in the APK. But it's incomplete, and not workable.
2. Mixed arm(64) libraries: Several libraries are existing in lib/x86(_64)/
   directory in the APK. But some of them are arm(64) libraries,
   instead of x86(_64) ones.

All of above always cause APP crash if installed x86(_64) libraries
by PackageManager.

This patch aims to improve PackageManager to figure out these defects
and install arm(64) libraries to run the APP with houdini support.
The basic idea is to compare x86(_64) libraries with arm(64) alternatives
to determine which one should be workable.

To customize it for specific APPs, 3 lists are provided under
/system/vendor/etc/misc/ on the device.

1. /system/vendor/etc/misc/.OEMWhiteList:
   This patch will be disabled for the APPs containing in the OEMWhiteList
2. /system/vendor/etc/misc/.OEMBlackList:
   The APP is enforced to install the arm(64) libraries if existed.
3. /system/vendor/etc/misc/.ThirdPartySO:
   This is another list which contains the names of all 3rd-party libraries,
   which will impact on the final decision of APP installation.

Change-Id: I2613d9ebc8fe012c801f4a38fc5dede413f15a91
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-20470
Signed-off-by: xiajiang <xia1.jiang@intel.com>
Reviewed-on: https://android.intel.com:443/471490
core/java/com/android/internal/content/NativeLibraryHelper.java
core/jni/Android.bp
core/jni/abipicker/ABIPicker.cpp [new file with mode: 0644]
core/jni/abipicker/ABIPicker.h [new file with mode: 0644]
core/jni/abipicker/ELFLite.h [new file with mode: 0644]
core/jni/com_android_internal_content_NativeLibraryHelper.cpp
services/core/java/com/android/server/pm/parsing/pkg/AndroidPackageUtils.java