There are general methods of getting Google Dialer and Google Contacts installed on your average Android device, but these weren't completely working on the OnePlus 5. Specifically, many noticed that you couldn't answer or decline a call from the notification popup with those applications installed. Thankfully though, XDA Senior Member dustintinsley was able to whip up a Magisk module that properly installed both Google Dialer as well as Google Contacts on the new OnePlus flagship. Just remember to go in and manually set the permissions after the module has been installed.

Check out this port in our OnePlus 5 forum