android package manager

参考android代码:

    // Note: Instruction set names are used to construct the names of some
    // system properties. To be sure that the properties stay valid the
    // instruction set name should not exceed 7 characters. See installd
    // and the package manager for the actual propeties.
    private static final Map<String, String> ABI_TO_INSTRUCTION_SET_MAP
            = new HashMap<String, String>();
    static {
        ABI_TO_INSTRUCTION_SET_MAP.put("armeabi", "arm");
        ABI_TO_INSTRUCTION_SET_MAP.put("armeabi-v7a", "arm");
        ABI_TO_INSTRUCTION_SET_MAP.put("mips", "mips");
        ABI_TO_INSTRUCTION_SET_MAP.put("mips64", "mips64");
        ABI_TO_INSTRUCTION_SET_MAP.put("x86", "x86");
        ABI_TO_INSTRUCTION_SET_MAP.put("x86_64", "x86_64");
        ABI_TO_INSTRUCTION_SET_MAP.put("arm64-v8a", "arm64");
    }

 

在安装应用时,搜索abilist。安装abilist靠前的native so。

 

首先判断是否支持multi-arch(既支持32也支持64)。

如果是multi-arch,则32/64都安装。64安装到lib64,32位安装到lib

如果不是,则只安装primary abi的。primary abi是abilist[0]。

 

 

参考:

copyNativeBinariesForSupportedAbi

core/java/com/android/internal/content/NativeLibraryHelper.java +300

 
 
posted @ 2020-12-14 14:42  xuyv  阅读(86)  评论(0)    收藏  举报