Apple discourages iPhone self-repair with a dirty trick

It’s virtually certain that there’s some chatter between the phone and the battery’s controller (on the PC side it’s typically yet another SMbus thing; mobile and/or Apple might dictate something a bit less well known here; but it will be conceptually more or less the same even if it’s a slightly different low speed serial interface.

That said, the fact that there’s a data interface there would seem to be a good argument for input validation; rather than attempting to ensure that the battery is always trustworthy. It is very unlikely that a battery management IC that can be swapped with a hand soldering iron and strong nerves would resist divulging its private key all that hard against a more sophisticated attacker; nor is it clear that battery bus traffic is even encrypted after the initial authenticity handshake, in which case injecting malicious traffic after the legitimate battery has opened the door for you is quite viable.

If you can’t safely handle the relatively constrained set of interactions you would need to have with a battery you are doomed on the harder cases(like most of the operating system and applications); and that suggests bad things about the state of the little housekeeping busses you can’t control as tightly. Like, not at all hypothetically, the SIM slot; which also has a little serial interface for chatting with fairly core elements of the phone; and must accept SIMs from basically anyone.

It’s not Apple’s problem if the algorithms that cover the deterioration characteristics of their batteries don’t model some random 3rd party hardware very well and the result is poor predictions or other slightly peculiar output in the battery status interface; but it is Apple’s problem if they care enough about a bus to try to lock the door but can’t just input sanitize the problem away.