Lithium Ion Battery replace with DC supply

I wish to reuse an old smartphone like a Raspberry Pi.
The USB port of the smartphone will have a OTG USB device, so I cannot charge via the usb port.
So, I am looking to feed the phone with power by replacing the battery with a DC supply.
Does anyone know how to fool the phone into thinking there is a fully charged battery there.
I would also need a box the size of the battery with the electronic connections on to connect to the phone’s battery connectors.
Any ideas?

Hi!

Can’t speak for the replacing battery approach, it does sound like a good avenue.

My only thought is you could use something like this splitter cable to feed power in and use OTG at the same time.

Not too much modification (if it works), plus you get a battery backup too. Might be worth a go!