You want to gain weight before prison, it always seems worse than it is in reality.
Have you spoken to a private lawyer.

Education and Training should be your primary focus If you go to jail, boxing secondary.

23, zero amateur experience, you are not going to make money in boxing.

Lots of exercise you can do in confined spaces, search bodyweight exercises, gymnastics.
A few dozen books out there on training with limited or no equipment.
But your primary focus should be on getting a lawyer.