• Home
Name Date Size #Lines LOC

..--

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

Android.mkD03-May-202417.7 KiB505350

CleanSpec.mkD03-May-20242.3 KiB532

MODULE_LICENSE_PUBLIC_DOMAIND03-May-20240

NOTICED03-May-20241 KiB2219

READMED03-May-20245.3 KiB10487

access_vectorsD03-May-20246.6 KiB622536

adbd.teD03-May-20243.8 KiB11690

app.teD03-May-202416.9 KiB459370

atrace.teD03-May-2024701 2517

attributesD03-May-20243.3 KiB11686

audioserver.teD03-May-20241.9 KiB5642

autoplay_app.teD03-May-20243.9 KiB11085

binderservicedomain.teD03-May-2024970 2316

blkid.teD03-May-2024708 2116

blkid_untrusted.teD03-May-20241.1 KiB3730

bluetooth.teD03-May-20242.7 KiB7559

bluetoothdomain.teD03-May-2024167 32

boot_control_hal.teD03-May-2024130 32

bootanim.teD03-May-2024970 3525

bootstat.teD03-May-2024359 129

cameraserver.teD03-May-20241.4 KiB4031

clatd.teD03-May-20241.3 KiB3226

cppreopts.teD03-May-20241 KiB2921

debuggerd.teD03-May-20241.7 KiB6255

device.teD03-May-20243.2 KiB10490

dex2oat.teD03-May-20241.7 KiB4736

dhcp.teD03-May-20241.2 KiB3325

dnsmasq.teD03-May-2024936 2519

domain.teD03-May-202420.5 KiB606513

domain_deprecated.teD03-May-20242.8 KiB7558

drmserver.teD03-May-20241.9 KiB5743

dumpstate.teD03-May-20245.9 KiB193155

file.teD03-May-202410.4 KiB263250

file_contextsD03-May-202417.9 KiB405378

file_contexts_asanD03-May-2024228 54

fingerprintd.teD03-May-2024758 2417

fs_useD03-May-2024865 2420

fsck.teD03-May-20241.4 KiB4838

fsck_untrusted.teD03-May-20241.1 KiB3730

gatekeeperd.teD03-May-20241,003 3123

genfs_contextsD03-May-20242.3 KiB4543

global_macrosD03-May-20242.7 KiB4739

gpsd.teD03-May-2024992 3326

hci_attach.teD03-May-2024332 107

healthd.teD03-May-20241.6 KiB5240

hostapd.teD03-May-20241.2 KiB2824

idmap.teD03-May-2024394 118

init.teD03-May-202411.6 KiB315240

initial_sid_contextsD03-May-2024973 2827

initial_sidsD03-May-2024416 3632

inputflinger.teD03-May-2024441 1611

install_recovery.teD03-May-20241.2 KiB3222

installd.teD03-May-20245.1 KiB129106

ioctl_definesD03-May-2024111.6 KiB2,6952,694

ioctl_macrosD03-May-20242.9 KiB6358

isolated_app.teD03-May-20243 KiB7965

kernel.teD03-May-20243.5 KiB9475

keys.confD03-May-2024851 2610

keystore.teD03-May-20241.1 KiB3325

lmkd.teD03-May-20241.1 KiB4130

logd.teD03-May-20242.2 KiB6952

mac_permissions.xmlD03-May-20241.8 KiB556

mdnsd.teD03-May-2024188 107

mediacodec.teD03-May-2024967 3123

mediadrmserver.teD03-May-20242.3 KiB6850

mediaextractor.teD03-May-2024769 2618

mediaserver.teD03-May-20244.7 KiB136104

mlsD03-May-20244.3 KiB11388

mls_macrosD03-May-20241.2 KiB5546

mtp.teD03-May-2024307 1310

net.teD03-May-2024914 2621

netd.teD03-May-20243.6 KiB10177

neverallow_macrosD03-May-2024369 76

nfc.teD03-May-20241.2 KiB4031

otapreopt_chroot.teD03-May-2024991 2419

otapreopt_slot.teD03-May-20241.3 KiB2922

perfprofd.teD03-May-20242.1 KiB6042

platform_app.teD03-May-20242.5 KiB5951

policy_capabilitiesD03-May-2024122 64

port_contextsD03-May-202477 42

postinstall.teD03-May-20241.5 KiB3930

postinstall_dexopt.teD03-May-20242.4 KiB6044

ppp.teD03-May-2024512 1714

preopt2cachename.teD03-May-2024469 1411

priv_app.teD03-May-20245.4 KiB145116

profman.teD03-May-2024583 1813

property.teD03-May-20242 KiB4341

property_contextsD03-May-20244.1 KiB9886

racoon.teD03-May-2024893 3324

radio.teD03-May-20241.2 KiB3931

recovery.teD03-May-20244.8 KiB12899

recovery_persist.teD03-May-20241 KiB3222

recovery_refresh.teD03-May-2024962 3021

rild.teD03-May-20241.6 KiB4840

rolesD03-May-202429 32

runas.teD03-May-20241.1 KiB3628

sdcardd.teD03-May-20241.4 KiB4131

seapp_contextsD03-May-20244.4 KiB10091

security_classesD03-May-20241.9 KiB11185

service.teD03-May-20249.4 KiB123121

service_contextsD03-May-202410.8 KiB149148

servicemanager.teD03-May-2024680 1814

sgdisk.teD03-May-2024759 2317

shared_relro.teD03-May-2024588 1410

shell.teD03-May-20245 KiB154124

slideshow.teD03-May-2024568 1512

su.teD03-May-20241.9 KiB5649

surfaceflinger.teD03-May-20242.4 KiB7456

system_app.teD03-May-20242 KiB7864

system_server.teD03-May-202421.9 KiB578462

te_macrosD03-May-202410.9 KiB360325

tee.teD03-May-2024512 1614

toolbox.teD03-May-20241 KiB2721

tzdatacheck.teD03-May-2024272 96

ueventd.teD03-May-20242 KiB4539

uncrypt.teD03-May-20241.2 KiB4130

untrusted_app.teD03-May-20248.6 KiB209175

update_engine.teD03-May-20241.4 KiB3728

update_engine_common.teD03-May-20241.8 KiB3828

update_verifier.teD03-May-2024567 1812

usersD03-May-202455 21

vdc.teD03-May-2024744 2719

vold.teD03-May-20247.4 KiB205159

watchdogd.teD03-May-2024185 54

wpa.teD03-May-20241.3 KiB4938

zygote.teD03-May-20244.1 KiB10793

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