clearing "permanent" battery failure

After an hour at -20 °C, my MacBook7,1 refused to charge and would shut off instantly when unplugged. The hardware was fine, but some parameter (likely cell voltage imbalance) temporarily crossed a failure threshold, and the chip disabled itself.

sources

I'm far from the first to do this, and I relied heavily on the following links.

implementation

This ugly-ish Objective-C program should clear the PF status from macOS userspace. You'll need this header file to build it.

result

It took a couple tries and/or a reboot to take effect, but the laptop accepts a charge and runs on battery again!