קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
בדף הזה מתוארים פריסת הספריות במכשירים עם Android מגרסה 8.0 ואילך, כללי VNDK ומדיניות האבטחה המשויכת.
פריסת הספרייה
פריסת הספריות המשולבת מורכבת מהספריות הבאות:
/system/lib[64] מכיל את כל הספריות המשותפות של המסגרת, כולל LL-NDK, VNDK וספריות של המסגרת בלבד (כולל LL-NDK-Private וספריות מסוימות עם שמות זהים לאלה שב-VNDK-SP).
/system/lib[64]/vndk-sp מכילה ספריות VNDK-SP ל-HALs באותו תהליך.
/vendor/lib[64] מכיל את ספריות ה-VNDK שהספק הרחיב (ספריות VNDK של DXUA או DXUX), הטמעות HAL באותו תהליך וספריות משותפות אחרות של הספק.
/vendor/lib[64]/vndk-sp עשוי להכיל את ספריות VNDK-SP שהורחבו על ידי הספק.
מודולים של ספקים טוענים את ספריות VNDK מ-/system/lib[64].
כללי VNDK
בקטע הזה מופיעה רשימה מקיפה של כללי VNDK:
תהליכי Framework אסור להם לטעון ספריות משותפות שאינן SP-HAL ממחיצות של ספקים (האכיפה מחמירה החל מ-Android 8.1).
אסור לתהליכים של ספקים לטעון ספריות שאינן LL-NDK, VNDK-SP ו-VNDK מהמחיצה של המערכת. (הכלל הזה לא נאכף באופן קפדני ב-Android O, אבל הוא נאכף בגרסה עתידית).
ספריות VNDK מותקנות חייבות להיות קבוצת משנה של ספריות VNDK שעומדות בדרישות שהוגדרו על ידי Google.
יחסי התלות החיצוניים של SP-HAL ו-SP-HAL-Dep חייבים להיות מוגבלים ל-LL-NDK או לספריות VNDK-SP שהוגדרו על ידי Google.
יחסי התלות של ספרייה משותפת מסוג SP-HAL חייבים להיות מוגבלים לספריות LL-NDK, לספריות VNDK-SP שהוגדרו על ידי Google, לספריות SP-HAL אחרות ו/או לספריות משותפות אחרות של ספקים שאפשר לתייג כספריות SP-HAL-Dep.
אפשר לתייג ספרייה משותפת של ספק כספרייה מסוג SP-HAL-Dep רק אם היא לא ספריית AOSP ויחסי התלות שלה מוגבלים לספריות LL-NDK, לספריות VNDK-SP שהוגדרו על ידי Google, לספריות SP-HAL ו/או לספריות אחרות מסוג SP-HAL-Dep.
VNDK-SP חייב להיות עצמאי. libRS_internal.so מקבל טיפול מיוחד ב-Android 8.0, אבל נתייחס אליו שוב בגרסה עתידית.
אין תקשורת בין מסגרת לבין ספק דרך ממשקים שאינם HIDL, כולל (בין היתר) מחברים, שקעים, זיכרונות משותפים, קבצים וכו'.
הגודל של מחיצת המערכת צריך להיות גדול מספיק כדי להכיל שני עותקים של כל הספריות שעומדות בדרישות של VNDK, ועותק של ספריות משותפות של מסגרות שלא עומדות בדרישות.
sepolicy
תהליכי המסגרת שמתוארים בקטע הזה תואמים ל-coredomain ב-sepolicies, ותהליכי הספקים תואמים ל-non-coredomain. לדוגמה, אפשר לגשת ל-/dev/binder רק ב-coredomain, ול-/dev/vndbinder רק ב-non-coredomain.
כללי מדיניות דומים מגבילים את הגישה לספריות המשותפות במחיצות המערכת ובמחיצות של הספקים. בטבלה הבאה מפורטות ההרשאות לגישה לספריות משותפות בקטגוריות שונות:
קטגוריה
מחיצה
גישה מ- coredomain
גישה מ- דומיין שאינו של הליבה
LL-NDK
מערכת
Y
Y
LL-NDK-Private
מערכת
Y
Y
VNDK-SP/VNDK-SP-Private
מערכת
Y
Y
VNDK-SP-Ext
ספק
Y
Y
VNDK
מערכת
Y
Y
VNDK-Ext
ספק
לא
Y
FWK-ONLY
מערכת
Y
לא
FWK-ONLY-RS
מערכת
Y
לא
SP-HAL
ספק
Y
Y
SP-HAL-Dep
ספק
Y
Y
VND בלבד
ספק
לא
Y
צריכה להיות גישה ל-LL-NDK-Private ול-VNDK-SP-Private משני הדומיינים, כי coredomain לא תהיה להם גישה ישירה אליהם. באופן דומה, צריכה להיות גישה ל-SP-HAL-Dep מ-coredomain כי SP-HAL מסתמך עליו.
תווית same_process_hal_file
הספריות הבאות נמצאות במחיצה של הספק. צריך להפוך את הספריות האלה לנגישות גם מ-coredomain וגם מ-non-coredomain.
VNDK-SP-Ext ב-/vendor/lib[64]/vndk-sp
SP-HAL ב-/vendor/lib[64] או ב-/vendor/lib[64]/hw
SP-HAL-Dep ב-/vendor/lib[64] או ב-/vendor/lib[64]/hw
צריך לתייג את הקבצים האלה באופן מפורש בתווית same_process_hal_file, כי כברירת מחדל אין ל-coredomain גישה לכל מה שמופיע במחיצה vendor. מוסיפים שורות דומות לזו הבאה לקובץ file_contexts הספציפי לספק.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-07-27 (שעון UTC)."],[],[],null,["# Directories, rules, and sepolicy\n\nThis page describes the directory layout for devices running Android 8.0 and\nhigher, VNDK rules, and associated sepolicy.\n\nDirectory layout\n----------------\n\nThe *Degenerated Directory Layout* consists of the following\ndirectories:\n\n- `/system/lib[64]` contains all framework shared libraries, including LL-NDK, VNDK, and framework-only libraries (including LL-NDK-Private and some libraries with the same names as the ones in VNDK-SP).\n- `/system/lib[64]/vndk-sp` contains VNDK-SP libraries for same-process HALs.\n- `/vendor/lib[64]` contains the VNDK libraries extended by the vendor (either DXUA or DXUX VNDK libraries), same-process HAL implementations, and other vendor shared libraries.\n- `/vendor/lib[64]/vndk-sp` may contain the VNDK-SP libraries extended by the vendor.\n\nVendor modules load the VNDK libraries from `/system/lib[64]`.\n\nVNDK rules\n----------\n\nThis section provides a comprehensive list of VNDK rules:\n\n- Framework processes must not load non-SP-HAL shared libraries from vendor partitions (strictly enforced starting from Android 8.1).\n- Vendor processes must not load non-LL-NDK, non-VNDK-SP, and non-VNDK libraries from the system partition. (not strictly enforced in Android O but will be in a future release).\n| **Note**: To benefit from the framework-only OTA beyond Android 8.0, this rule must not be violated in devices launched with Android 8.0.\n- Installed VNDK libraries must be a subset of Google-defined eligible VNDK libraries.\n- The outer dependencies of SP-HAL and SP-HAL-Dep must be restricted to LL-NDK or Google-defined VNDK-SP libraries.\n - The dependencies of an SP-HAL shared library must be restricted to LL-NDK libraries, Google-defined VNDK-SP libraries, other SP-HAL libraries, and/or other vendor shared libraries that can be labeled as SP-HAL-Dep libraries.\n - A vendor shared library can be labeled as a SP-HAL-Dep library only if it is not an AOSP library and its dependencies are restricted to LL-NDK libraries, Google-defined VNDK-SP libraries, SP-HAL libraries, and/or other SP-HAL-Dep libraries.\n- VNDK-SP must be self-contained. `libRS_internal.so` gets special treatment in Android 8.0, but will be revisited in a future release.\n- No framework-vendor communication through non-HIDL interfaces, including (but not limited to) binder, sockets, shared memories, files, etc.\n- The size of the system partition must be large enough to contain two copies of all eligible VNDK libraries and a copy of ineligible framework shared libraries.\n\nsepolicy\n--------\n\nFramework processes described in this section correspond to\n`coredomain` in sepolicies while vendor processes correspond to\n`non-coredomain`. For example, `/dev/binder` can be\naccessed only in `coredomain` and `/dev/vndbinder` can be\naccessed only in non-`coredomain`.\n\nSimilar policies restrict the access to the shared libraries on system and\nvendor partitions. The following table shows the rights to access shared\nlibraries of different categories:\n\n| Category | Partition | Accessible from coredomain | Accessible from non-coredomain |\n|-------------------------|-----------|----------------------------|--------------------------------|\n| LL-NDK | System | Y | Y |\n| LL-NDK-Private | System | Y | Y |\n| VNDK-SP/VNDK-SP-Private | System | Y | Y |\n| VNDK-SP-Ext | Vendor | Y | Y |\n| VNDK | System | Y | Y |\n| VNDK-Ext | Vendor | N | Y |\n| FWK-ONLY | System | Y | N |\n| FWK-ONLY-RS | System | Y | N |\n| SP-HAL | Vendor | Y | Y |\n| SP-HAL-Dep | Vendor | Y | Y |\n| VND-ONLY | Vendor | N | Y |\n\nLL-NDK-Private and VNDK-SP-Private must be\naccessible from both domains because non-`coredomain` will\nindirectly access them. Similarly, SP-HAL-Dep must be accessible from\n`coredomain` because SP-HAL relies on it.\n\nsame_process_hal_file label\n---------------------------\n\nThe following libraries exist in the vendor partition. Make these libraries accessible from both\n`coredomain` and non-`coredomain`.\n\n- VNDK-SP-Ext in `/vendor/lib[64]/vndk-sp`\n- SP-HAL in `/vendor/lib[64]` or `/vendor/lib[64]/hw`\n- SP-HAL-Dep in `/vendor/lib[64]` or `/vendor/lib[64]/hw`\n\nExplicitly label these files as `same_process_hal_file`, because anything\nin `vendor` partition is by default not accessible to `coredomain`. Add lines similar to\nthe following to the vendor-specific `file_contexts` file. \n\n```scdoc\n/vendor/lib(64)?/hw/libMySpHal\\.so u:object_r:same_process_hal_file:s0\n/vendor/lib(64)?/vndk-sp/libBase\\.so u:object_r:same_process_hal_file:s0\n/vendor/lib(64)?/libBaseInternal\\.so u:object_r:same_process_hal_file:s0\n```"]]