In S.E. Hinton's novel, Ponyboy never explicitly tells Randy Adderson that Johnny killed Bob.
Randy visits Ponyboy before the hearing. They talk about Bob, the rumble, the futility of violence. Randy says: "I don't know... I just don't know anything anymore." Ponyboy thinks about telling him — that it was self-defense, that Johnny isn't a monster — but doesn't say it.
Randy leaves without knowing — but he sees Ponyboy's humanity. That moment of connection (two boys, not Soc/Greaser) is the novel's quiet climax. The truth is in the room — unspoken, felt.
Film Note: The 1983 movie similarly omits the confession — Randy (Darren Dalton) and Ponyboy (C. Thomas Howell) share a silent understanding.