The safest option is probably to remove the battery and run the phone from a (well defined/build) external power source, e.g. like this:
https://yaky.dev/2022-09-06-smartphone-without-battery/
I didn't have to bother with the thermistor but some models need it yes. And some even have an i2c charge level module which is even harder to simulate though it can be done.
What is bad is using a resistor as the voltage drop will depend on the current being drawn by the device, but the article is not doing that (nor woudl I).