{"id":79,"date":"2024-06-18T07:16:09","date_gmt":"2024-06-17T23:16:09","guid":{"rendered":"https:\/\/www.swreader.com\/?p=79"},"modified":"2024-06-18T22:51:24","modified_gmt":"2024-06-18T14:51:24","slug":"understand-android-vendor-selinux-policy-build","status":"publish","type":"post","link":"https:\/\/www.swreader.com\/index.php\/en\/2024\/06\/18\/understand-android-vendor-selinux-policy-build\/","title":{"rendered":"Understand Android Vendor SELinux Policy Build"},"content":{"rendered":"<p>Since the introduction of the Treble framework in Android 8, Android has divided the system into System and Vendor parts, allowing independent upgrades of system and vendor. Subsequently, Product, ODM, and other partitions were introduced. In this context, SELinux policies are also divided into several parts: platform (system), system_ext, product, vendor, and odm.<\/p>\n<p>This article uses the Vendor partition as an example to analyze in detail how to include sepolicy files in the Android build system, how Android.mk variables are passed to the Soong build system, and finally how they correspond to modules and variables in Android.bp.<\/p>\n<h2>1. Including SELinux Policy Files in Android Makefile<\/h2>\n<p>First, the SELinux policy files for the Vendor are added to the Android build system through the <code>BOARD_VENDOR_SEPOLICY_DIRS<\/code> or <code>BOARD_SEPOLICY_DIRS<\/code> variables. For example:<\/p>\n<pre><code class=\"language-makefile\">BOARD_VENDOR_SEPOLICY_DIRS += vendor\/xx\/featureA\/sepolicy<\/code><\/pre>\n<h2>2. Passing Android Makefile Variables to Soong<\/h2>\n<p>These Makefile variables are converted to JSON format via <code>soong_config.mk<\/code> and then passed to the Soong build system, specifying the corresponding Go language variables (e.g., <code>BoardVendorSepolicyDirs<\/code>).<\/p>\n<pre><code class=\"language-makefile\">.\/build\/make\/core\/soong_config.mk:203: $(call add_json_list, BoardVendorSepolicyDirs, $(BOARD_VENDOR_SEPOLICY_DIRS) $(BOARD_SEPOLICY_DIRS))<\/code><\/pre>\n<h2>3. Declaration of Variables in Soong<\/h2>\n<p>In Soong\u2019s <code>variable.go<\/code> file, the variable that stores the path of the Vendor SELinux policy files is defined.<\/p>\n<pre><code class=\"language-go\">.\/build\/soong\/android\/variable.go:355: BoardVendorSepolicyDirs []string `json:&quot;,omitempty&quot;`<\/code><\/pre>\n<h2>4. Interface to Get Vendor Policy Paths<\/h2>\n<p>Soong provides an interface to get the list of paths to Vendor policy files.<\/p>\n<pre><code class=\"language-go\">func (c *deviceConfig) VendorSepolicyDirs() []string {\n    return c.config.productVariables.BoardVendorSepolicyDirs\n}<\/code><\/pre>\n<h2>5. Correspondence Between Variables in Android.bp and SELinux Variables in Makefile<\/h2>\n<p>In the <code>build\/soong\/build_files.go<\/code> file of the Android build system, the mapping between variables in Android.bp and SELinux variables in Makefile is implemented.<\/p>\n<pre><code class=\"language-go\">func (b *buildFiles) GenerateAndroidBuildActions(ctx android.ModuleContext) {\n    b.srcs = make(map[string]android.Paths)\n    b.srcs[&quot;.reqd_mask&quot;] = b.findSrcsInDirs(ctx, filepath.Join(ctx.ModuleDir(), &quot;reqd_mask&quot;))\n    b.srcs[&quot;.plat_public&quot;] = b.findSrcsInDirs(ctx, filepath.Join(ctx.ModuleDir(), &quot;public&quot;))\n    b.srcs[&quot;.plat_private&quot;] = b.findSrcsInDirs(ctx, filepath.Join(ctx.ModuleDir(), &quot;private&quot;))\n    b.srcs[&quot;.plat_vendor&quot;] = b.findSrcsInDirs(ctx, filepath.Join(ctx.ModuleDir(), &quot;vendor&quot;))\n    b.srcs[&quot;.system_ext_public&quot;] = b.findSrcsInDirs(ctx, ctx.DeviceConfig().SystemExtPublicSepolicyDirs()...)\n    b.srcs[&quot;.system_ext_private&quot;] = b.findSrcsInDirs(ctx, ctx.DeviceConfig().SystemExtPrivateSepolicyDirs()...)\n    b.srcs[&quot;.product_public&quot;] = b.findSrcsInDirs(ctx, ctx.Config().ProductPublicSepolicyDirs()...)\n    b.srcs[&quot;.product_private&quot;] = b.findSrcsInDirs(ctx, ctx.Config().ProductPrivateSepolicyDirs()...)\n    b.srcs[&quot;.vendor&quot;] = b.findSrcsInDirs(ctx, ctx.DeviceConfig().VendorSepolicyDirs()...)\n    b.srcs[&quot;.odm&quot;] = b.findSrcsInDirs(ctx, ctx.DeviceConfig().OdmSepolicyDirs()...)\n\n    if ctx.DeviceConfig().PlatformSepolicyVersion() == ctx.DeviceConfig().BoardSepolicyVers() {\n        \/\/ vendor uses the same source with plat policy\n        b.srcs[&quot;.reqd_mask_for_vendor&quot;] = b.srcs[&quot;.reqd_mask&quot;]\n        b.srcs[&quot;.plat_vendor_for_vendor&quot;] = b.srcs[&quot;.plat_vendor&quot;]\n        b.srcs[&quot;.plat_public_for_vendor&quot;] = b.srcs[&quot;.plat_public&quot;]\n        b.srcs[&quot;.plat_private_for_vendor&quot;] = b.srcs[&quot;.plat_private&quot;]\n        b.srcs[&quot;.system_ext_public_for_vendor&quot;] = b.srcs[&quot;.system_ext_public&quot;]\n        b.srcs[&quot;.system_ext_private_for_vendor&quot;] = b.srcs[&quot;.system_ext_private&quot;]\n        b.srcs[&quot;.product_public_for_vendor&quot;] = b.srcs[&quot;.product_public&quot;]\n        b.srcs[&quot;.product_private_for_vendor&quot;] = b.srcs[&quot;.product_private&quot;]\n    } else {\n        \/\/ use vendor-supplied plat prebuilts\n        b.srcs[&quot;.reqd_mask_for_vendor&quot;] = b.findSrcsInDirs(ctx, ctx.DeviceConfig().BoardReqdMaskPolicy()...)\n        b.srcs[&quot;.plat_vendor_for_vendor&quot;] = b.findSrcsInDirs(ctx, ctx.DeviceConfig().BoardPlatVendorPolicy()...)\n        b.srcs[&quot;.plat_public_for_vendor&quot;] = b.findSrcsInDirs(ctx, filepath.Join(ctx.ModuleDir(), &quot;prebuilts&quot;, &quot;api&quot;, ctx.DeviceConfig().BoardSepolicyVers(), &quot;public&quot;))\n        b.srcs[&quot;.plat_private_for_vendor&quot;] = b.findSrcsInDirs(ctx, filepath.Join(ctx.ModuleDir(), &quot;prebuilts&quot;, &quot;api&quot;, ctx.DeviceConfig().BoardSepolicyVers(), &quot;private&quot;))\n        b.srcs[&quot;.system_ext_public_for_vendor&quot;] = b.findSrcsInDirs(ctx, ctx.DeviceConfig().BoardSystemExtPublicPrebuiltDirs()...)\n        b.srcs[&quot;.system_ext_private_for_vendor&quot;] = b.findSrcsInDirs(ctx, ctx.DeviceConfig().BoardSystemExtPrivatePrebuiltDirs()...)\n        b.srcs[&quot;.product_public_for_vendor&quot;] = b.findSrcsInDirs(ctx, ctx.DeviceConfig().BoardProductPublicPrebuiltDirs()...)\n        b.srcs[&quot;.product_private_for_vendor&quot;] = b.findSrcsInDirs(ctx, ctx.DeviceConfig().BoardProductPrivatePrebuiltDirs()...)\n    }\n}<\/code><\/pre>\n<p>In the code above, <code>b.srcs[xxx]<\/code> with <code>xxx<\/code> refers to variables in Android.bp, which can be used directly in the Android.bp file. The following table summarizes this:<\/p>\n<table>\n<thead>\n<tr>\n<th>Android.bp<\/th>\n<th>Corresponding Android.mk Variable or Directory Path<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>.reqd_mask<\/td>\n<td>system\/sepolicy\/reqd_mask<\/td>\n<\/tr>\n<tr>\n<td>.plat_public<\/td>\n<td>system\/sepolicy\/public<\/td>\n<\/tr>\n<tr>\n<td>.plat_private<\/td>\n<td>system\/sepolicy\/private<\/td>\n<\/tr>\n<tr>\n<td>.plat_vendor<\/td>\n<td>system\/sepolicy\/vendor<\/td>\n<\/tr>\n<tr>\n<td>.system_ext_public<\/td>\n<td>$(SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS) $(BOARD_PLAT_PUBLIC_SEPOLICY_DIR)<\/td>\n<\/tr>\n<tr>\n<td>.system_ext_private<\/td>\n<td>$(SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS) $(BOARD_PLAT_PRIVATE_SEPOLICY_DIR)<\/td>\n<\/tr>\n<tr>\n<td>.product_public<\/td>\n<td>$(PRODUCT_PUBLIC_SEPOLICY_DIRS)<\/td>\n<\/tr>\n<tr>\n<td>.product_private<\/td>\n<td>$(PRODUCT_PRIVATE_SEPOLICY_DIRS)<\/td>\n<\/tr>\n<tr>\n<td>.vendor<\/td>\n<td>$(BOARD_VENDOR_SEPOLICY_DIRS) $(BOARD_SEPOLICY_DIRS)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>If <code>BOARD_SEPOLICY_VERS<\/code> and <code>PLATFORM_SEPOLICY_VERSION<\/code> are equal, it indicates that the Vendor uses the current platform\u2019s SELinux rules; otherwise, it uses the SELinux rules specified by <code>BOARD_SEPOLICY_VERS<\/code>. When they are equal, the related SELinux policy variables in Android.bp can be simplified as follows:<\/p>\n<table>\n<thead>\n<tr>\n<th>Android.bp<\/th>\n<th>Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>.reqd_mask_for_vendor<\/td>\n<td>.reqd_mask<\/td>\n<\/tr>\n<tr>\n<td>.plat_public_for_vendor<\/td>\n<td>.plat_public<\/td>\n<\/tr>\n<tr>\n<td>.plat_private_for_vendor<\/td>\n<td>.plat_private<\/td>\n<\/tr>\n<tr>\n<td>.plat_vendor_for_vendor<\/td>\n<td>.plat_vendor<\/td>\n<\/tr>\n<tr>\n<td>.system_ext_public_for_vendor<\/td>\n<td>.system_ext_public<\/td>\n<\/tr>\n<tr>\n<td>.system_ext_private_for_vendor<\/td>\n<td>.system_ext_private<\/td>\n<\/tr>\n<tr>\n<td>.product_public_for_vendor<\/td>\n<td>.product_public<\/td>\n<\/tr>\n<tr>\n<td>.product_private_for_vendor<\/td>\n<td>.product_private<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>6. Compiling the plat_policy_for_vendor Module<\/h2>\n<p>The final compilation of plat_policy_for_vendor generates a plat_policy_for_vendor.cli file, which depends on the plat_policy_for_vendor.conf file. The compilation process of plat_policy_for_vendor.conf is as follows:<\/p>\n<pre><code class=\"language-json\">se_policy_conf {\n    name: &quot;plat_policy_for_vendor.conf&quot;,\n    srcs: plat_policies_for_vendor,\n    installable: false,\n}<\/code><\/pre>\n<p>plat_policies_for_vendor is as follows:<\/p>\n<pre><code class=\"language-json\">plat_policies_for_vendor = [\n    &quot;:se_build_files{.plat_public_for_vendor}&quot;,\n    &quot;:se_build_files{.plat_private_for_vendor}&quot;,\n    &quot;:se_build_files{.system_ext_public_for_vendor}&quot;,\n    &quot;:se_build_files{.system_ext_private_for_vendor}&quot;,\n    &quot;:se_build_files{.product_public_for_vendor}&quot;,\n    &quot;:se_build_files{.product_private_for_vendor}&quot;,\n]<\/code><\/pre>\n<p>As seen, the compilation process for plat_policy_for_vendor does not use the sepolicy files defined in plat_vendor_for_vendor. Therefore, if a rule is added in system_ext_public_for_vendor that depends on a type defined in plat_vendor_for_vendor, a compilation error will inevitably occur.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since the introduction of the Treble framework in Android 8, Android has divided the system into System and Vendor parts, allowing independent upgrades of system and vendor. Subsequently, Product, ODM, and other partitions were introduced. In this context, SELinux policies are also divided into several parts: platform (system), system_ext, product, vendor, and odm. This article uses the Vendor partition as an example to analyze in detail how to include sepolicy files in the Android build system, how Android.mk variables are passed to the Soong build system, and finally how they correspond to modules and variables in Android.bp. 1. Including SELinux Policy Files in Android Makefile First, the SELinux policy files for the Vendor are added to the Android build system through the BOARD_VENDOR_SEPOLICY_DIRS or BOARD_SEPOLICY_DIRS variables. For example: BOARD_VENDOR_SEPOLICY_DIRS += vendor\/xx\/featureA\/sepolicy 2. Passing Android Makefile Variables to Soong These Makefile variables are converted to JSON format via soong_config.mk and then passed to the Soong build system, specifying the corresponding Go language variables (e.g., BoardVendorSepolicyDirs). .\/build\/make\/core\/soong_config.mk:203: $(call add_json_list, BoardVendorSepolicyDirs, $(BOARD_VENDOR_SEPOLICY_DIRS) $(BOARD_SEPOLICY_DIRS)) 3. Declaration of Variables in Soong In Soong\u2019s variable.go file, the variable that stores the path of the Vendor SELinux policy files is defined. .\/build\/soong\/android\/variable.go:355: BoardVendorSepolicyDirs []string `json:&quot;,omitempty&quot;` 4. Interface to Get Vendor Policy Paths Soong provides an interface to get the list of paths to Vendor policy files. func (c *deviceConfig) VendorSepolicyDirs() []string { return c.config.productVariables.BoardVendorSepolicyDirs } 5. Correspondence Between Variables in Android.bp and SELinux Variables in Makefile In the build\/soong\/build_files.go file of the Android build system, the mapping between variables in Android.bp and SELinux varia&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","footnotes":""},"categories":[60,62,64],"tags":[69,73,75,77],"class_list":["post-79","post","type-post","status-publish","format-standard","hentry","category-android-en","category-english","category-selinux-en","tag-android-en","tag-linux-en","tag-selinux-en","tag-sepolicy-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Understand Android Vendor SELinux Policy Build - TianYa Blog %<\/title>\n<meta name=\"description\" content=\"The article details the management and compilation of selinux Linux policy files in the Android system&#039;s Vendor partition, covering variable transmission from Makefile to the Soong build system and policy file dependencies in Android.bp.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.swreader.com\/index.php\/en\/2024\/06\/18\/understand-android-vendor-selinux-policy-build\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Understand Android Vendor SELinux Policy Build - TianYa Blog %\" \/>\n<meta property=\"og:description\" content=\"The article details the management and compilation of selinux Linux policy files in the Android system&#039;s Vendor partition, covering variable transmission from Makefile to the Soong build system and policy file dependencies in Android.bp.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.swreader.com\/index.php\/en\/2024\/06\/18\/understand-android-vendor-selinux-policy-build\/\" \/>\n<meta property=\"og:site_name\" content=\"TianYa Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-06-17T23:16:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-18T14:51:24+00:00\" \/>\n<meta name=\"author\" content=\"zdm\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"zdm\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/en\\\/2024\\\/06\\\/18\\\/understand-android-vendor-selinux-policy-build\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/en\\\/2024\\\/06\\\/18\\\/understand-android-vendor-selinux-policy-build\\\/\"},\"author\":{\"name\":\"zdm\",\"@id\":\"https:\\\/\\\/www.swreader.com\\\/#\\\/schema\\\/person\\\/9c90501e33afc9307d757bc8cfaf1c6f\"},\"headline\":\"Understand Android Vendor SELinux Policy Build\",\"datePublished\":\"2024-06-17T23:16:09+00:00\",\"dateModified\":\"2024-06-18T14:51:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/en\\\/2024\\\/06\\\/18\\\/understand-android-vendor-selinux-policy-build\\\/\"},\"wordCount\":541,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.swreader.com\\\/#\\\/schema\\\/person\\\/9c90501e33afc9307d757bc8cfaf1c6f\"},\"keywords\":[\"Android\",\"linux\",\"Selinux\",\"sepolicy\"],\"articleSection\":[\"Android\",\"English\",\"Selinux\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/en\\\/2024\\\/06\\\/18\\\/understand-android-vendor-selinux-policy-build\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/en\\\/2024\\\/06\\\/18\\\/understand-android-vendor-selinux-policy-build\\\/\",\"url\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/en\\\/2024\\\/06\\\/18\\\/understand-android-vendor-selinux-policy-build\\\/\",\"name\":\"Understand Android Vendor SELinux Policy Build - TianYa Blog %\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.swreader.com\\\/#website\"},\"datePublished\":\"2024-06-17T23:16:09+00:00\",\"dateModified\":\"2024-06-18T14:51:24+00:00\",\"description\":\"The article details the management and compilation of selinux Linux policy files in the Android system's Vendor partition, covering variable transmission from Makefile to the Soong build system and policy file dependencies in Android.bp.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/en\\\/2024\\\/06\\\/18\\\/understand-android-vendor-selinux-policy-build\\\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/en\\\/2024\\\/06\\\/18\\\/understand-android-vendor-selinux-policy-build\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/en\\\/2024\\\/06\\\/18\\\/understand-android-vendor-selinux-policy-build\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\\\/\\\/www.swreader.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Understand Android Vendor SELinux Policy Build\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.swreader.com\\\/#website\",\"url\":\"https:\\\/\\\/www.swreader.com\\\/\",\"name\":\"TianYa Blog\",\"description\":\"Technology And Life\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.swreader.com\\\/#\\\/schema\\\/person\\\/9c90501e33afc9307d757bc8cfaf1c6f\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.swreader.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.swreader.com\\\/#\\\/schema\\\/person\\\/9c90501e33afc9307d757bc8cfaf1c6f\",\"name\":\"zdm\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2670c9b6412a56381880b2ca03988f659e8a378fe7332238a4a741b660a60997?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2670c9b6412a56381880b2ca03988f659e8a378fe7332238a4a741b660a60997?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2670c9b6412a56381880b2ca03988f659e8a378fe7332238a4a741b660a60997?s=96&d=mm&r=g\",\"caption\":\"zdm\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2670c9b6412a56381880b2ca03988f659e8a378fe7332238a4a741b660a60997?s=96&d=mm&r=g\"},\"sameAs\":[\"http:\\\/\\\/www.swreader.com\"],\"url\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/author\\\/zdm\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Understand Android Vendor SELinux Policy Build - TianYa Blog %","description":"The article details the management and compilation of selinux Linux policy files in the Android system's Vendor partition, covering variable transmission from Makefile to the Soong build system and policy file dependencies in Android.bp.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.swreader.com\/index.php\/en\/2024\/06\/18\/understand-android-vendor-selinux-policy-build\/","og_locale":"zh_CN","og_type":"article","og_title":"Understand Android Vendor SELinux Policy Build - TianYa Blog %","og_description":"The article details the management and compilation of selinux Linux policy files in the Android system's Vendor partition, covering variable transmission from Makefile to the Soong build system and policy file dependencies in Android.bp.","og_url":"https:\/\/www.swreader.com\/index.php\/en\/2024\/06\/18\/understand-android-vendor-selinux-policy-build\/","og_site_name":"TianYa Blog","article_published_time":"2024-06-17T23:16:09+00:00","article_modified_time":"2024-06-18T14:51:24+00:00","author":"zdm","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"zdm","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.swreader.com\/index.php\/en\/2024\/06\/18\/understand-android-vendor-selinux-policy-build\/#article","isPartOf":{"@id":"https:\/\/www.swreader.com\/index.php\/en\/2024\/06\/18\/understand-android-vendor-selinux-policy-build\/"},"author":{"name":"zdm","@id":"https:\/\/www.swreader.com\/#\/schema\/person\/9c90501e33afc9307d757bc8cfaf1c6f"},"headline":"Understand Android Vendor SELinux Policy Build","datePublished":"2024-06-17T23:16:09+00:00","dateModified":"2024-06-18T14:51:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.swreader.com\/index.php\/en\/2024\/06\/18\/understand-android-vendor-selinux-policy-build\/"},"wordCount":541,"commentCount":1,"publisher":{"@id":"https:\/\/www.swreader.com\/#\/schema\/person\/9c90501e33afc9307d757bc8cfaf1c6f"},"keywords":["Android","linux","Selinux","sepolicy"],"articleSection":["Android","English","Selinux"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.swreader.com\/index.php\/en\/2024\/06\/18\/understand-android-vendor-selinux-policy-build\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.swreader.com\/index.php\/en\/2024\/06\/18\/understand-android-vendor-selinux-policy-build\/","url":"https:\/\/www.swreader.com\/index.php\/en\/2024\/06\/18\/understand-android-vendor-selinux-policy-build\/","name":"Understand Android Vendor SELinux Policy Build - TianYa Blog %","isPartOf":{"@id":"https:\/\/www.swreader.com\/#website"},"datePublished":"2024-06-17T23:16:09+00:00","dateModified":"2024-06-18T14:51:24+00:00","description":"The article details the management and compilation of selinux Linux policy files in the Android system's Vendor partition, covering variable transmission from Makefile to the Soong build system and policy file dependencies in Android.bp.","breadcrumb":{"@id":"https:\/\/www.swreader.com\/index.php\/en\/2024\/06\/18\/understand-android-vendor-selinux-policy-build\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.swreader.com\/index.php\/en\/2024\/06\/18\/understand-android-vendor-selinux-policy-build\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.swreader.com\/index.php\/en\/2024\/06\/18\/understand-android-vendor-selinux-policy-build\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.swreader.com\/"},{"@type":"ListItem","position":2,"name":"Understand Android Vendor SELinux Policy Build"}]},{"@type":"WebSite","@id":"https:\/\/www.swreader.com\/#website","url":"https:\/\/www.swreader.com\/","name":"TianYa Blog","description":"Technology And Life","publisher":{"@id":"https:\/\/www.swreader.com\/#\/schema\/person\/9c90501e33afc9307d757bc8cfaf1c6f"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.swreader.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/www.swreader.com\/#\/schema\/person\/9c90501e33afc9307d757bc8cfaf1c6f","name":"zdm","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/secure.gravatar.com\/avatar\/2670c9b6412a56381880b2ca03988f659e8a378fe7332238a4a741b660a60997?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2670c9b6412a56381880b2ca03988f659e8a378fe7332238a4a741b660a60997?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2670c9b6412a56381880b2ca03988f659e8a378fe7332238a4a741b660a60997?s=96&d=mm&r=g","caption":"zdm"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/2670c9b6412a56381880b2ca03988f659e8a378fe7332238a4a741b660a60997?s=96&d=mm&r=g"},"sameAs":["http:\/\/www.swreader.com"],"url":"https:\/\/www.swreader.com\/index.php\/author\/zdm\/"}]}},"_links":{"self":[{"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/posts\/79","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/comments?post=79"}],"version-history":[{"count":1,"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/posts\/79\/revisions"}],"predecessor-version":[{"id":80,"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/posts\/79\/revisions\/80"}],"wp:attachment":[{"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/media?parent=79"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/categories?post=79"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/tags?post=79"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}