The charge will switch on and off randomly until I bend the connector at just the right angle, similarly to when a USB cable is broken, but I tried with multiple new cables and I have a feeling the USB port might be deformed, causing the cable's connector to bend and loosen up.
Moreover, it seems like (but I'm not sure) it gets worse when the battery is low and ever more when the phone turns off.
Can I open the phone somehow and change the connector?