Basic design of low-wattage 5V battery charger (is this realistic?)
In theory it sounds feasible to me. 

If a 400mAh battery last two weeks, it means that the circuit consumes about 4.3mW on average (400mAh * 3.6V / (2 wks * 7 days * 24 hours)) . Let's say that your shake-based generator will work 30 minutes per day, then it would have to generate about 206mW when active (24 hours/ 0.5 hour * 4.3mW). On top of that I would add about 20% extra to account for inefficiencies of the power conversion circuitry (generator power conditioning + battery charging), what translates into a requirement of 250mW of output power from the generator when it's active.

My next step would be to research generators that can actually deliver these 250mW on average in realistic driving/riding conditions. It will probably be a trade off between size and output power. Considerations in terms of how smooth the driving/riding are will also be important.