For the oneplus5/5t, call recording can be enabled in countries that don't normally allow it by the following command:
settings put global op_voice_recording_supported_by_mcc 1
It needs to be run several seconds after boot though. The original solutions was to just use a magisk late start service script that slept for 15 seconds and then ran the above command but I wanted a more universal solution and so I attempted to patch the boot img.
I have it add this to init.rc:
service ENCR /system/bin/sh /init.encr.sh
And add this init script to the ramdisk:
echo "$(date +"%T"): Native call recording enabled" >> /data/media/0/test
settings put global op_voice_recording_supported_by_mcc 1 &>> /data/media/0/test
The debug test file on my sdcard always gives me this error though:
/system/bin/settings: app_process: not found
When I run the init script manually in terminal, it works fine so I'm not sure why I'm getting this error. Any ideas? Thanks
Edit: I removed the shebang from the init script and the error was replaced by a permission denied error. I didn't think I had to worry about root with an init script?