xref: /aosp_15_r20/system/sepolicy/private/derive_classpath.te (revision e4a36f4174b17bbab9dc043f4a65dc8d87377290)
1*e4a36f41SAndroid Build Coastguard Worker
2*e4a36f41SAndroid Build Coastguard Worker# Domain for derive_classpath
3*e4a36f41SAndroid Build Coastguard Workertype derive_classpath, domain, coredomain, artd_subprocess_type;
4*e4a36f41SAndroid Build Coastguard Workertype derive_classpath_exec, system_file_type, exec_type, file_type;
5*e4a36f41SAndroid Build Coastguard Workerinit_daemon_domain(derive_classpath)
6*e4a36f41SAndroid Build Coastguard Worker
7*e4a36f41SAndroid Build Coastguard Worker# Read /apex
8*e4a36f41SAndroid Build Coastguard Workerallow derive_classpath apex_mnt_dir:dir r_dir_perms;
9*e4a36f41SAndroid Build Coastguard Workerallow derive_classpath vendor_apex_metadata_file:dir r_dir_perms;
10*e4a36f41SAndroid Build Coastguard Worker
11*e4a36f41SAndroid Build Coastguard Worker# Create /data/system/environ/classpath file
12*e4a36f41SAndroid Build Coastguard Workerallow derive_classpath environ_system_data_file:dir rw_dir_perms;
13*e4a36f41SAndroid Build Coastguard Workerallow derive_classpath environ_system_data_file:file create_file_perms;
14*e4a36f41SAndroid Build Coastguard Worker
15*e4a36f41SAndroid Build Coastguard Worker# b/183079517 fails on gphone targets otherwise
16*e4a36f41SAndroid Build Coastguard Workerallow derive_classpath unlabeled:dir search;
17*e4a36f41SAndroid Build Coastguard Worker
18*e4a36f41SAndroid Build Coastguard Worker# Allow derive_classpath to write the classpath into ota dexopt
19*e4a36f41SAndroid Build Coastguard Worker# - Read the ota's apex dir
20*e4a36f41SAndroid Build Coastguard Workerallow derive_classpath postinstall_apex_mnt_dir:dir r_dir_perms;
21*e4a36f41SAndroid Build Coastguard Worker# - Report the BCP to the ota's dexopt
22*e4a36f41SAndroid Build Coastguard Workerallow derive_classpath postinstall_dexopt:dir search;
23*e4a36f41SAndroid Build Coastguard Workerallow derive_classpath postinstall_dexopt:fd use;
24*e4a36f41SAndroid Build Coastguard Workerallow derive_classpath postinstall_dexopt:file read;
25*e4a36f41SAndroid Build Coastguard Workerallow derive_classpath postinstall_dexopt:lnk_file read;
26*e4a36f41SAndroid Build Coastguard Workerallow derive_classpath postinstall_dexopt_tmpfs:file rw_file_perms;
27*e4a36f41SAndroid Build Coastguard Worker
28*e4a36f41SAndroid Build Coastguard Worker# Allow to be called by artd in Pre-reboot Dexopt.
29*e4a36f41SAndroid Build Coastguard Workerallow derive_classpath artd:fd use;
30*e4a36f41SAndroid Build Coastguard Worker
31*e4a36f41SAndroid Build Coastguard Worker# Allow writing to Pre-reboot Dexopt temp files.
32*e4a36f41SAndroid Build Coastguard Workerallow derive_classpath pre_reboot_dexopt_artd_file:file { open read write };
33