1# dexoptanalyzer 2type dexoptanalyzer, domain, coredomain, mlstrustedsubject; 3type dexoptanalyzer_exec, system_file_type, exec_type, file_type; 4type dexoptanalyzer_tmpfs, file_type; 5 6r_dir_file(dexoptanalyzer, apk_data_file) 7# Access to /vendor/app 8r_dir_file(dexoptanalyzer, vendor_app_file) 9 10# Reading an APK opens a ZipArchive, which unpack to tmpfs. 11# Use tmpfs_domain() which will give tmpfs files created by dexoptanalyzer their 12# own label, which differs from other labels created by other processes. 13# This allows to distinguish in policy files created by dexoptanalyzer vs other 14#processes. 15tmpfs_domain(dexoptanalyzer) 16 17# Read symlinks in /data/dalvik-cache. This is required for PIC mode boot 18# app_data_file the oat file is symlinked to the original file in /system. 19allow dexoptanalyzer dalvikcache_data_file:dir { getattr search }; 20allow dexoptanalyzer dalvikcache_data_file:file r_file_perms; 21allow dexoptanalyzer dalvikcache_data_file:lnk_file read; 22 23allow dexoptanalyzer installd:fd use; 24allow dexoptanalyzer installd:fifo_file { getattr write }; 25 26# Acquire advisory lock on /system/framework/arm/* 27allow dexoptanalyzer system_file:file lock; 28 29# Allow reading secondary dex files that were reported by the app to the 30# package manager. 31allow dexoptanalyzer { privapp_data_file app_data_file }:dir { getattr search }; 32allow dexoptanalyzer { privapp_data_file app_data_file }:file { getattr read map }; 33# dexoptanalyzer calls access(2) with W_OK flag on app data. We can use the 34# "dontaudit...audit_access" policy line to suppress the audit access without 35# suppressing denial on actual access. 36dontaudit dexoptanalyzer { privapp_data_file app_data_file }:dir audit_access; 37 38# Allow testing /data/user/0 which symlinks to /data/data 39allow dexoptanalyzer system_data_file:lnk_file { getattr }; 40