I am assuming there is alot more damage then the few nails you are showing,it doesn't look like a whole lot of damage in the pics.
If you are planning on legal action you better get alot more pics showing alot more damage,It kind of looks like just unfinished wood + i believe you said it's on a porch,the time + money + aggravation it would take to bring this to court,time off work ,driving back + forth etc. would not be worth it for a porch ceiling that,nobody would probably even notice if the nails were trimmed off + maybe a bit of wood putty or wood glue etc. were used.you are looking straight at it + so it looks bad but is it bad enough that it would ever be noticed by anyone,i know it sucks + you payed to have the roof done not expecting this,but i can tell you ,the contractor is not going to take the whole new roof ing back off + redo it all,+ i don't think will give you a new ceiling either, + from the pics shown,i don't think its worth litigation,so i would say trim the nails,maybe patch the few holes + maybe refinish the whole ceiling + make it look fresh + new,because if you were to take it to court + dwell on it for months on end it is alot of needless stress,frustration + aggravation ,now if there is alot more damage then these pics are showing,+ you have the time + drive to go to court on it,i would suggest getting alot of real good pics showing the damage,+ get some estimates to redo the ceiling, + then just go to a small claims court,where you don't need a lawyer,+ it is quicker + easier.Attorney fee's would eat you alive on something like this with no guarantee of winning.
Another thing you could try is go to an attorney + have them send a letter to the contractor,+ try to scare him into taking care of the damage,but even that will probably cost you $150 or more,In my state if your attorney sends a letter,
I forget exactly what the term is,but if they don't respond in 30 days then you can go after tripple damages,in certain instances, if you do decide to take it to court.
But if this is just minimal damage on a not so important area,i would say just fix it the best you can or have the contractor do it if he's still willing + forget about it or it will haunt you for along time,+ is it worth the aggravation to you,sometimes it's better to chalk it up to experience + put it out of your mind.
good luck.
Ps, I never just trust that contractors are going to do the job right,i always watch the whole job,I stand back + let them do their job,but am always watching to make sure they are either not messing something up, or trying to get away with not doing it the way they were suposed to,If they know you are watching then they tend to do things the way they should.
I flip houses for a living,+ can't tell you how many screw ups i have watched unfold or prevented,+ how many short cuts i have seen them take,you have to watch.