Done and done.
Neuter or spay the beast, then walk it on a treadmill every morning and evening.
Start slow, it takes a LOT of brain power for a dog on a treadmill. 2 min, 5 min, eventually you can work up to a fully automated fitness cycle for an hour.
Don’t laugh, it works.
No treadmill? DI, Salvation Army, etc. have more treadmills than they can deal with.
Exercise is the panacea.