• 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;
    }
  • 相关阅读:
    Python生成器表达式
    Python列表解析
    Python迭代器(Iterator)
    Python set 集合
    python eval 函数妙用
    Python字典 (dict)
    Python序列之元组 (tuple)
    Python序列之列表 (list)
    递归和反射
    常用标准库
  • 原文地址:https://www.cnblogs.com/JebediahKerman/p/14347920.html
Copyright © 2020-2023  润新知