Skip to content

Commit e4d7cfa

Browse files
committed
fix: use perl to remove entire permission blocks from web_engine module.json5
1 parent 86a834e commit e4d7cfa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎scripts/build-app.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ if [ -f "${WEB_ENGINE_MODULE_JSON}" ]; then
130130
for perm in SET_ABILITY_INSTANCE_INFO GET_FILE_ICON PRIVACY_WINDOW LOCK_WINDOW_CURSOR ACCESS_BIOMETRIC SYSTEM_FLOAT_WINDOW FILE_ACCESS_PERSIST PREPARE_APP_TERMINATE CUSTOM_SCREEN_CAPTURE; do
131131
if grep -q "ohos.permission.${perm}" "${WEB_ENGINE_MODULE_JSON}" 2>/dev/null; then
132132
echo " Removing unsupported permission: ohos.permission.${perm}"
133-
sed -i "/ohos.permission.${perm}/d" "${WEB_ENGINE_MODULE_JSON}"
133+
perl -i -0pe "s/\\{[^{}]*ohos\\.permission\\.${perm}[^{}]*\\}[\\s,]*//g" "${WEB_ENGINE_MODULE_JSON}"
134134
fi
135135
done
136136
echo " web_engine permissions cleaned"

0 commit comments

Comments
 (0)