An interesting antecedent to the social justice sense of woke appears in Shane Stevens, Go Down Dead (1967) [combined snippets]:
He get up slow and he float into the kitchen when he come back he got three in his hand. He give them to me and I light one up. I drag deep and soon it hit me and I feeling good. I mean I feel like everything fine and the world a good place to live and everybody doing the job what they got and nobody make trouble. Everything is just calm and nice and easy. I is a very smart cat what is woke to all the sounds.
Thats how pot make me feel. Peacefull. I want no trouble and I give no trouble.
Another instance, somewhat closer to the social justice sense, appears in Karlene Faith, Soledad Prison, University of the Poor: An Exchange Between Students from the University of California at Santa Cruz and Prisoners at the Soledad Correctional Training Facility (1975) [combined snippets]:
You have become too rigid/ + frigid/ + stupid/ + hung up/ in your dream to see that the lust for/ life will never yield/ to rules and bars/ or to godless/ heartless machines/ but will free us of the/ slavery of deceptive oppression,/ exploitation/ + the illusion of your dream./ Nothing comes to a sleeper but a dream Amerika/ + we are WOKE/ You are being condemned by your non-sleeping/ people Amerikan Dream/ We the people-/ in order to establish a more perfect union-/ Sentence you/ Amerikan Dream/ to humanism/ + awareness/ +/ love +/ peace/ + revolution/ + progressive/ social/ insomnia/ for the rest of your natural/ life
One common source of mainstream slang terms is African American slang. But the likelihood that woke in its modern sense was current in African American slang as early as 1975 is diminished by the fact that neither Clarence Major, Juba to Jive: A Dictionary of African American Slang (1994) nor Geneva Smitherman, Black Talk: Words and Phrases from the Hood to the Amen Corner (1994) has an entry for woke in any sense. Likewise, slang dictionaries dedicated to American youth slang (Flappers 2 Rappers: American Youth Slang ), hipster slang ((Straight from the Fridge, Dad: A Dictionary of Hipster Slang [1988/2004]), and college slang (Slang U.: The Official Dictionary of College Slang ) do not mention woke.
The suggested origin in a 2008 song by Erykah Badu seems very plausible, given that popular songs provide a direct conduit to vast numbers of people. Nevertheless, the notion that woke can mean "aware of certain truths or realities that most other people have not yet grasped clearly" has antecedents from long before 2008.
A very early instance of woke in connection with social justice appears in Matilie Singerman, A Comparison of the Opinion of the Negro Leaders in World War I and World War II ... [combined snippets] (1945):
The idea that all labor must be united for the benefit of all workers was prevalent. It was felt that the craft union philosophy was becoming passé. Charles S. Johnson wrote
"The ends of labor, as an equal partner in the production of goods and wealth cannot be served without the cooperation of all workers. This is in sharp contrast to the old craft union philosophy based, like the old industrial monopoly, upon the economy of scarcity. The new philosophy based, as a part of its own inherent logic, takes in Negro workers, and this logic has been fortified in some of the new powerful labor organizations by penalties for failure to
enforce the policy of non-discrimination, and by a growing political solidarity.
"Negro workers are now recognizing in the new unions the most strategic weapons for [their own] advance[.] ..."
J. Saunders Redding observed that
"The South is learning the lesson taught a few months ago by R. J. Thomas, president of the United Automobile Workers, when he ordered back to work, under pain of expulsion from job and union, some Southern whites who struck in protest against the employment of Negroes in a Wright aeronautical factory. They mean that the Negro is coming to 'have faith in organized labor as a force for social justice.' They mean what a Negro United Mine Workers official in West Virginia told me in 1940: 'Let me tell you, buddy, waking up is a damn sight harder than going to sleep, but we'll stay woke up longer.'"
The quotation from J. Saunders Redding originally appeared in Negro Digest, volume 1 (1942).
Equating awareness of—and an unwillingness to lose sight of—ideas of social justice with being awakened and "staying woke [up]" is sufficiently obvious and intuitive that we shouldn't be surprised to see instances of it extending fairly far backward in history. It doesn't follow that a continuous connection necessarily exists between very early instances of woke in the context of social justice and widespread slang or figurative use of it in that sense today.