Xperia Z2 23.1.A.1.28 5.0.2
If you have been greeted by these hateful messages when trying to connect to Miracast (EZcast)
"Could not turn on Screen mirroring. The output device is not ready or does not support HDCP."
"Could not start mirroring on the screen. Make sure the output device supports HDCP."
Probably you already have tried changing /system/etc/wfdconfig.xml:
... <ContentProtection> <Valid>1</Valid> ...
... <ContentProtection> <Valid>0</Valid> ...
"The output device does not support HDCP. You can only mirror unprotected content of the following applications:
Xperia Home, Video, Music or Walkman, Settings"
and then just before the mirroring get disconnected
Your output device does not support HDCP. Cannot mirror. You still can mirror some apps and unprotected content to the device."
There is a very easy fix, in this file /system/build.prop just below
adb shell su setprop persist.debug.wfd.appmonitoring 1
As @s107ken mentioned in #14, In case of boot loop, go to TWRP and then
adb shell chmod 644 /system/build.prop