-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathpost-fs-data.sh
25 lines (18 loc) · 882 Bytes
/
post-fs-data.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# SPDX-FileCopyrightText: 2023 Andrew Gunnerson
# SPDX-License-Identifier: GPL-3.0-only
# We don't want to give any arbitrary system app permissions to update_engine.
# Thus, we create a new context for custota and only give access to that
# specific type. Magisk currently has no builtin way to modify seapp_contexts,
# so we'll do it manually.
#
# Android's fork of libselinux looks at /dev/selinux/apex_seapp_contexts. It's
# currently not used, but may be used in the future for selinux policy updates
# delivered via an apex image.
source "${0%/*}/boot_common.sh" /data/local/tmp/custota_selinux.log
header Creating custota_app domain
"${mod_dir}"/custota_selinux -ST
header Updating seapp_contexts
cat >> /dev/selinux/apex_seapp_contexts << EOF
user=_app isPrivApp=true name=${app_id} domain=custota_app type=app_data_file levelFrom=all
EOF
restorecon -Rv /dev/selinux