Once the film had finished, I had to wonder if Travis was infected all along. At the beginning of the film, the parents say something about Bud showing signs of infection within 24 hours, but what do we know about this infection? Almost nothing. For all we know, Bud had been hallucinating and sleepwalking for a while before he started to get boils and lesions.
Travis certainly isn't 'normal' - his nightmares (which made for truly horrifying cinema) and the drawings he drew in his spare time (which his father seemed unusually relaxed about) suggest some sort of psychological trauma, which probably goes back even further than witnessing his Grandfather's execution and funeral pyre.
We get a visual cue when we see one of his nightmares - the aspect ratio shifts and goes wider (or, if you're watching on a TV at home, narrower). If I recall correctly, the dreams are as follows
- Travis walks through the red door to see his Grandfather seated and facing away from him. Bud roars and projectile vomits. His eyes are glassy and black (an exaggeration - Bud's eyes weren't like this at the beginning). He is awoken by his father who tells him someone is in the house.
- Travis goes outside to check on the prisoner his father has tied to a tree. While looking for him by lamplight, Will suddenly appears in front of him with the same glassy black eyes as Bud's.
- Travis dreams that Kim is sitting on the bed next to his (where his dog usually sleeps). She straddles him and vomits the black bile onto his face.
- Travis goes looking for the dog in the woods. He takes a gun. He hears the dog bark, raises the gun but seems terrified by something else. There is a cut to (I think) him waking up in bed, and he begins vomiting the black bile. Then there's another cut and he wakes up again - for 'real' this time. He looks at his arms and they seem to be covered in boils. He rubs at them and eventually they disappear.
- After Paul has killed Will's family, Travis is seen looking distressed. My memory is a little unclear here but I think then it goes into another dream sequence with his Grandfather with the black eyes. This time we do not jump awake but see from Travis' perspective his mother sat by his bed reassuring him.
As another user above suggested, I think events might be told slightly out of sequence with the real world. It seems most likely that in a fugue state, Travis snuck out of his parents room to look for the dog. He saw 'something' attacking the dog and managed to pull him away. He left the dog dying in the porch, then went back to bed. Then, he woke up, found Andrew in Bud's room, and returned him to his parents' room. He goes to check on the red door, and it is open. The outer door must also be open. Then he tells his father, and the rest of the film follows.
I'm pretty sure that's how events actually happened - his father has the only key and he was sleeping in the same room as him so would have been much more able to get it than Andrew would. This also seems to indicate that it's how he got infected. But that does throw into question all of the previous cues we have been given. The drawings, the nightmares, the placement of Kim in his dream, etc.
I think it's possible that the infection's early signs are hallucinations and sleepwalking, and the lesions come much later, right before the end. Therefore, Andrew may also be infected.