zoukankan      html  css  js  c++  java
  • Android系统库豁免列表

     在bionic/linker/linker.cpp中有一个系统库函数的豁免列表,但是只有target sdk version小于24才能被豁免。

    static bool is_exempt_lib(android_namespace_t* ns, const char* name, const soinfo* needed_by) {
      static const char* const kLibraryExemptList[] = {
        "libandroid_runtime.so",
        "libbinder.so",
        "libcrypto.so",
        "libcutils.so",
        "libexpat.so",
        "libgui.so",
        "libmedia.so",
        "libnativehelper.so",
        "libssl.so",
        "libstagefright.so",
        "libsqlite.so",
        "libui.so",
        "libutils.so",
        nullptr
      };
    
      // If you're targeting N, you don't get the exempt-list.
      if (get_application_target_sdk_version() >= 24) {
        return false;
      }
    
      // if the library needed by a system library - implicitly assume it
      // is exempt unless it is in the list of shared libraries for one or
      // more linked namespaces
      if (needed_by != nullptr && is_system_library(needed_by->get_realpath())) {
        return !maybe_accessible_via_namespace_links(ns, name);
      }
    
      // if this is an absolute path - make sure it points to /system/lib(64)
      if (name[0] == '/' && dirname(name) == kSystemLibDir) {
        // and reduce the path to basename
        name = basename(name);
      }
    
      for (size_t i = 0; kLibraryExemptList[i] != nullptr; ++i) {
        if (strcmp(name, kLibraryExemptList[i]) == 0) {
          return true;
        }
      }
    
      return false;
    }
  • 相关阅读:
    小程序云函数 Error: errCode: -404011 cloud function execution error
    Fiddler+雷电模拟器进行APP抓包
    Vue优化常用技巧
    sftp常用命令整理
    React生命周期学习整理
    git 提交跳过检查
    漂亮的代码系列
    关于我系列
    架构系列
    深度学习系列
  • 原文地址:https://www.cnblogs.com/JebediahKerman/p/14347920.html
Copyright © 2011-2022 走看看