Hi 256shadesofgrey and welcome to our forum
There’s an app called SnooZy Charger that seems to address situations like yours. It’s not available on Google play so you might want to check reputation before installing. Open source.
Another way of approaching your problem would be from the power supply end. You might look into the possibility of stabilizing the supply by running the dynamo’s output through a capacitor or a powerbank.
I expect @anon9989719 will have some good ideas.