Merriam-Webster tells us: The history of shenanigan is as tricky and mischievous as its meaning. Etymologists have some theories about its origins, but no one has been able to prove them. All we can say for certain is that the earliest known use of the word in print appeared in the April 25, 1855, issue of San Francisco's Town Talk. Although the "underhanded trick" sense of the word is oldest, the most common senses in use now are "tricky or questionable practices" (as in "political shenanigans") and "high-spirited behavior" (as in "youthful shenanigans").[1]
First use in 1855. Cool. I wondered what that first context was. So I used the site Chronicling America to find the April 25th, 1855 issue of Town Talk. But along the way I found earlier uses in the August 18th, 1854 issue of the Nevada Journal[2] and February 3rd, 1855 issue of the Sierra Citizen.[3]
I still don't have the definitive etymological answer but what the web allows a layperson to usefully research in 2019 is astounding!
[1] https://www.merriam-webster.com/dictionary/shenanigan
[2] https://chroniclingamerica.loc.gov/lccn/sn84026884/1854-08-1...
[3] https://chroniclingamerica.loc.gov/lccn/sn86058097/1855-02-0...