I don't remember if this was an iPhone 7 or not, maybe a 6, but I had the same issue. The camera focus part had stuck and just needed a little nudge and then the shaking stopped. Perhaps that will solve it for you.
Allright, so after a lot of testing and research I got this answer on a reddit repair sub: "On iPad Air 1st gens, there's two hall effect sensors for the smart cover. One is on the home button flex, the other is on the motherboard near the home button connector. The smart cover has two magnets in these locations and both sensors have to be triggered for the smart cover function to work. When wrapped around the back, the motherboard sensor will trigger, but the home button sensor should not. If the latter is faulty however, then the motherboard sensor will trigger it front or back. I do see this a lot on replacement home button flexes or aftermarket where there's no sensor at all. I haven't scoped it out to see whether the logic level to trigger is active high or low, but it appears the faulty cables essentially indicate to the Air that a magnet is present all the time. Now to test replacements, I connect the home button separately and leave it hanging out of the chassis. I use an external magnet near the...
Take a toothbrush or similar and dip in isopropyl alcohol, brush the ear speaker shield (don't know the correct english word for the grid thingy) from outside with a circular motion. If you have compressed air in a can that can also be helpful. If the speaker is very clogged this doesn't always help though and you will have to remove the screen, front camera/sensor-shield and -flex cable to get all the dirt out. A speaker replacement is seldom necessary.
In my experience, cheap batteries often give cheap results. If nothing else works, try one with higher quality. We have, many times, replaced bad batteries with a new one which resulted in the phone having _less_ battery time.
Seems like I made a newbie mistake. Didn't check the frame properly, and it's shaped like a banana, which of course puts a lot of pressure on the screen and adhesive. Well, hope this'll help someone else!
I let components lay in a 60 degree celsius ultrasonic bath for 15 minutes. My guess is it doesn't matter if you let it lay longer. Just make sure you clean off the residues with a toothbrush or similar afterwards. And yes, it's definitely worth a try :)
Probably a stupid question considering the forum, but 19/20 of our customers looking to replace the charging port only have dusty/filthy ports. Have you tried cleaning your original charging port with a tweezer?
Probably only one of the cameras is faulty. The camera app often freezes up when it can't find the first one, making it difficult to switch to the other one. Since the flash isn't working I would start with replacing the back camera first. Download some other camera apps as well. Snapchat for example has the front camera set as default.
As mentioned, water damage could be the cause. Remove the motherboard and brush the components and connectors with a toothbrush and pure alcohol. If possible you can bring it to a workshop who could decontaminate it more thoroughly.