Apple has put in place a new measure that discourages iPhone users from having their batteries replaced by aftermarket ones.

According to iFixit, Apple has installed a ‘dormant software lock’ that blocks Battery Health when a device has had a battery replaced that’s not installed by authorized Apple service providers.
A microcontroller made by Texas Instrument is responsible for the software lock. The authentication key from the iPhone’s battery prompts the service warning unless a diagnostic software given only to Authorized Service Providers removes the prompt.
The software lock is known to exist on current iPhone models, including the iPhone XS Max, the iPhone XS and the iPhone XR and operating systems iOS 12 and 13.
Apple claims that their software lock was to ensure safety when an iPhone user is having his or her mobile phone battery replaced. iFixit’s point is that the lock forces the iPhone user to get the service done at an Apple store, clashing with the ‘Right to Repair’ legislation.