• Home
Name Date Size #Lines LOC

..--

tools/07-May-2024-4,6793,363

Android.mkD07-May-202417.7 KiB505350

CleanSpec.mkD07-May-20242.3 KiB532

MODULE_LICENSE_PUBLIC_DOMAIND07-May-20240

NOTICED07-May-20241 KiB2219

READMED07-May-20245.3 KiB10487

access_vectorsD07-May-20246.6 KiB622536

adbd.teD07-May-20243.8 KiB11489

app.teD07-May-202416.6 KiB444356

atrace.teD07-May-2024701 2517

attributesD07-May-20243.1 KiB11182

audioserver.teD07-May-20241.9 KiB5642

autoplay_app.teD07-May-20243.9 KiB11085

binderservicedomain.teD07-May-2024970 2316

blkid.teD07-May-2024708 2116

blkid_untrusted.teD07-May-20241.1 KiB3730

bluetooth.teD07-May-20242.6 KiB7357

bluetoothdomain.teD07-May-2024167 32

boot_control_hal.teD07-May-2024130 32

bootanim.teD07-May-2024821 3222

bootstat.teD07-May-2024359 129

cameraserver.teD07-May-20241.4 KiB4031

clatd.teD07-May-20241.3 KiB3226

debuggerd.teD07-May-20241.7 KiB6255

device.teD07-May-20243.2 KiB10490

dex2oat.teD07-May-20241.7 KiB4736

dhcp.teD07-May-20241.2 KiB3325

dnsmasq.teD07-May-2024936 2519

domain.teD07-May-202420.2 KiB599507

domain_deprecated.teD07-May-20242.8 KiB7558

drmserver.teD07-May-20241.9 KiB5642

dumpstate.teD07-May-20245.3 KiB176141

file.teD07-May-202410.2 KiB260247

file_contextsD07-May-202417.5 KiB399372

file_contexts_asanD07-May-2024228 54

fingerprintd.teD07-May-2024758 2417

fs_useD07-May-2024865 2420

fsck.teD07-May-20241.4 KiB4838

fsck_untrusted.teD07-May-20241.1 KiB3730

gatekeeperd.teD07-May-20241,003 3123

genfs_contextsD07-May-20242.3 KiB4543

global_macrosD07-May-20242.7 KiB4739

gpsd.teD07-May-2024992 3326

hci_attach.teD07-May-2024332 107

healthd.teD07-May-20241.6 KiB5240

hostapd.teD07-May-20241.2 KiB2824

idmap.teD07-May-2024394 118

init.teD07-May-202411.6 KiB315240

initial_sid_contextsD07-May-2024973 2827

initial_sidsD07-May-2024416 3632

inputflinger.teD07-May-2024441 1611

install_recovery.teD07-May-20241.2 KiB3222

installd.teD07-May-20245.3 KiB134110

ioctl_definesD07-May-2024111.6 KiB2,6952,694

ioctl_macrosD07-May-20242.3 KiB4945

isolated_app.teD07-May-20243 KiB7965

kernel.teD07-May-20243.5 KiB9475

keys.confD07-May-2024851 2610

keystore.teD07-May-20241.1 KiB3325

lmkd.teD07-May-20241.1 KiB4130

logd.teD07-May-20242.2 KiB6851

mac_permissions.xmlD07-May-20241.8 KiB556

mdnsd.teD07-May-2024188 107

mediacodec.teD07-May-2024967 3123

mediadrmserver.teD07-May-20242.2 KiB6749

mediaextractor.teD07-May-2024769 2618

mediaserver.teD07-May-20244.7 KiB136104

mlsD07-May-20244.3 KiB11388

mls_macrosD07-May-20241.2 KiB5546

mtp.teD07-May-2024307 1310

net.teD07-May-2024914 2621

netd.teD07-May-20243.6 KiB10177

neverallow_macrosD07-May-2024369 76

nfc.teD07-May-20241.2 KiB4031

otapreopt_chroot.teD07-May-2024600 1511

perfprofd.teD07-May-20242.1 KiB6042

platform_app.teD07-May-20242.5 KiB5850

policy_capabilitiesD07-May-2024122 64

port_contextsD07-May-202477 42

postinstall.teD07-May-20241.3 KiB3528

postinstall_dexopt.teD07-May-20242.3 KiB5843

ppp.teD07-May-2024512 1714

priv_app.teD07-May-20245.3 KiB141113

profman.teD07-May-2024583 1813

property.teD07-May-20241.9 KiB4139

property_contextsD07-May-20243.9 KiB9583

racoon.teD07-May-2024893 3324

radio.teD07-May-20241.2 KiB3931

recovery.teD07-May-20244.5 KiB12295

recovery_persist.teD07-May-20241 KiB3222

recovery_refresh.teD07-May-2024962 3021

rild.teD07-May-20241.6 KiB4840

rolesD07-May-202429 32

runas.teD07-May-20241.1 KiB3628

sdcardd.teD07-May-20241.4 KiB4131

seapp_contextsD07-May-20244.4 KiB10091

security_classesD07-May-20241.9 KiB11185

service.teD07-May-20249.3 KiB122120

service_contextsD07-May-202410.7 KiB148147

servicemanager.teD07-May-2024680 1814

sgdisk.teD07-May-2024759 2317

shared_relro.teD07-May-2024588 1410

shell.teD07-May-20244.9 KiB153123

slideshow.teD07-May-2024568 1512

su.teD07-May-20241.9 KiB5649

surfaceflinger.teD07-May-20242.4 KiB7154

system_app.teD07-May-20241.9 KiB7763

system_server.teD07-May-202421.9 KiB577461

te_macrosD07-May-202410.9 KiB360325

tee.teD07-May-2024512 1614

toolbox.teD07-May-20241 KiB2721

tzdatacheck.teD07-May-2024272 96

ueventd.teD07-May-20242 KiB4539

uncrypt.teD07-May-20241.1 KiB3727

untrusted_app.teD07-May-20248.4 KiB203170

update_engine.teD07-May-20242.4 KiB5945

update_verifier.teD07-May-2024270 96

usersD07-May-202455 21

vdc.teD07-May-2024744 2719

vold.teD07-May-20247.4 KiB205159

watchdogd.teD07-May-2024185 54

wpa.teD07-May-20241.3 KiB4938

zygote.teD07-May-20244.9 KiB126107

README

1This directory contains the core Android SELinux policy configuration.
2It defines the domains and types for the AOSP services and apps common to
3all devices.  Device-specific policy should be placed under a
4separate device/<vendor>/<board>/sepolicy subdirectory and linked
5into the policy build as described below.
6
7Policy Generation:
8
9Additional, per device, policy files can be added into the
10policy build. These files should have each line including the
11final line terminated by a newline character (0x0A).  This
12will allow files to be concatenated and processed whenever
13the m4(1) macro processor is called by the build process.
14Adding the newline will also make the intermediate text files
15easier to read when debugging build failures.  The sets of file,
16service and property contexts files will automatically have a
17newline inserted between each file as these are common failure
18points.
19
20These device policy files can be configured through the use of
21the BOARD_SEPOLICY_DIRS variable. This variable should be set
22in the BoardConfig.mk file in the device or vendor directories.
23
24BOARD_SEPOLICY_DIRS contains a list of directories to search
25for additional policy files. Order matters in this list.
26For example, if you have 2 instances of widget.te files in the
27BOARD_SEPOLICY_DIRS search path, then the first one found (at the
28first search dir containing the file) will be concatenated first.
29Reviewing out/target/product/<device>/etc/sepolicy_intermediates/policy.conf
30will help sort out ordering issues.
31
32Example BoardConfig.mk Usage:
33From the Tuna device BoardConfig.mk, device/samsung/tuna/BoardConfig.mk
34
35BOARD_SEPOLICY_DIRS += device/samsung/tuna/sepolicy
36
37Additionally, OEMs can specify BOARD_SEPOLICY_M4DEFS to pass arbitrary m4
38definitions during the build. A definition consists of a string in the form
39of macro-name=value. Spaces must NOT be present. This is useful for building modular
40policies, policy generation, conditional file paths, etc. It is supported in
41the following file types:
42 * All *.te and SE Linux policy files as passed to checkpolicy
43 * file_contexts
44 * service_contexts
45 * property_contexts
46 * keys.conf
47
48Example BoardConfig.mk Usage:
49BOARD_SEPOLICY_M4DEFS += btmodule=foomatic \
50                         btdevice=/dev/gps
51
52SPECIFIC POLICY FILE INFORMATION
53
54mac_permissions.xml:
55  ABOUT:
56    The mac_permissions.xml file is used for controlling the mmac solutions
57    as well as mapping a public base16 signing key with an arbitrary seinfo
58    string. Details of the files contents can be found in a comment at the
59    top of that file. The seinfo string, previously mentioned, is the same string
60    that is referenced in seapp_contexts.
61
62    It is important to note the final processed version of this file
63    is stripped of comments and whitespace. This is to preserve space on the
64    system.img. If one wishes to view it in a more human friendly format,
65    the "tidy" or "xmllint" command will assist you.
66
67  TOOLING:
68    insertkeys.py
69      Is a helper script for mapping arbitrary tags in the signature stanzas of
70      mac_permissions.xml to public keys found in pem files. This script takes
71      a mac_permissions.xml file(s) and configuration file in order to operate.
72      Details of the configuration file (keys.conf) can be found in the subsection
73      keys.conf. This tool is also responsible for stripping the comments and
74      whitespace during processing.
75
76      keys.conf
77        The keys.conf file is used for controlling the mapping of "tags" found in
78        the mac_permissions.xml signature stanzas with actual public keys found in
79        pem files. The configuration file is processed via m4.
80
81        The script allows for mapping any string contained in TARGET_BUILD_VARIANT
82        with specific path to a pem file. Typically TARGET_BUILD_VARIANT is either
83        user, eng or userdebug. Additionally, one can specify "ALL" to map a path to
84        any string specified in TARGET_BUILD_VARIANT. All tags are matched verbatim
85        and all options are matched lowercase. The options are "tolowered" automatically
86        for the user, it is convention to specify tags and options in all uppercase
87        and tags start with @. The option arguments can also use environment variables
88        via the familiar $VARIABLE syntax. This is often useful for setting a location
89        to ones release keys.
90
91        Often times, one will need to integrate an application that was signed by a separate
92        organization and may need to extract the pem file for the insertkeys/keys.conf tools.
93        Extraction of the public key in the pem format is possible via openssl. First you need
94        to unzip the apk, once it is unzipped, cd into the META_INF directory and then execute
95        openssl pkcs7 -inform DER -in CERT.RSA -out CERT.pem -outform PEM  -print_certs
96        On some occasions CERT.RSA has a different name, and you will need to adjust for that.
97        After extracting the pem, you can rename it, and configure keys.conf and
98        mac_permissions.xml to pick up the change. You MUST open the generated pem file in a text
99        editor and strip out anything outside the opening and closing scissor lines. Failure to do
100        so WILL cause a compile time issue thrown by insertkeys.py
101
102        NOTE: The pem files are base64 encoded and PackageManagerService, mac_permissions.xml
103              and setool all use base16 encodings.
104