just a little note regarding the string comparison used in the profile matching algorithm.
I have a samsung JS8500 of 2015. It wasn't catching the profile Samsung Smart TV. I debugged the logs, and I noticed after awhile that the user-agent was sent in the request completely uppercase.
As is the case for all the other headers in the request.
So I modified the profile and created a new one inserting the header in uppercase and it worked.
I suppose, but I didn't look at the code, that the profile matching code (and I hope just it, otherwise other parts too can be broken) is using an StringComparison.Ordinal for string comparison of headers or for the various find function. I would suggest to switch to StringComparison.OrdinalIgnoreCase.