[SOLVED] Fairphone 5 – "Cannot change credential while factory reset protection is active" / "Can't install packages while in secure FRP"

Hi everyone,

Disclaimer: I’m not an Android expert. The following is a summary of a troubleshooting session that I compiled together with an AI assistant. All command outputs are from my own Fairphone 5. The AI only helped structure the investigation and interpret the results.

Environment
Fairphone 5
LineageOS 23.2 Nightly
Bootloader unlocked
Clean installation
Format Data performed in Lineage Recovery
No Google Apps / No Google account
Symptoms

Two seemingly unrelated issues occurred after installation.

  1. Unable to set a PIN or fingerprint

Running

adb shell locksettings set-pin 1234

returned

java.lang.SecurityException:
Cannot change credential while factory reset protection is active

Fingerprint setup also failed because no device credential could be configured.

  1. APK installation blocked

Both F-Droid and Aurora Store reported:

Can’t install packages while in secure FRP
Investigation

dumpsys persistent_data_block showed:

FRP state: true
Enforcement enabled: true
Has FRP credential handle: true

while

adb shell dumpsys device_policy

showed:

no Device Owner
no Work Profile
no Device Admin restrictions

The bootloader was unlocked:

fastboot getvar unlocked

unlocked: yes

Attempting

fastboot erase frp

failed because the partition is protected:

FAILED (remote: ‘Erase is not allowed for Critical Partitions’)
Solution

Boot into Lineage Recovery.

Select:

Advanced
→ Enable ADB

Verify ADB:

adb devices

should show

xxxxxxxx recovery

Open a shell:

adb shell

Run:

wipe-frp

Reboot.

Verification

After reboot:

adb shell dumpsys persistent_data_block

now reports

FRP state: false
Has FRP credential handle: false

After that:

:white_check_mark: adb shell locksettings set-pin works again.
:white_check_mark: Fingerprint enrollment works.
:white_check_mark: Aurora Store installs apps normally.
:white_check_mark: F-Droid should also work again.

I hope this helps someone else who runs into the same issue after installing LineageOS on the Fairphone 5.

Or you remove the google account and screen lock prior to flashing another (custom) ROM… Or you log into your google account (e.g. through microG) after flashing, set a screen lock method and remove the google account again. Worked for me in the past. Not 100% sure if it still does as I didn’t need it for a while now.

As a side note: This is the thread for LOS on FP6. But of course it can equally be relevant for both devices

Thanks that was my fault I thaught it was about FP6 and moved it here. So will move again :upside_down_face:
Surprised to see we dont have any recenr general FP5 LOS topic…

It’s a little confusing for me. Are these commands done inside the phone or do you connect it to the computer and use the terminal for it?

I give it a try but it does not do add shell.

Looks like a difference between lineage OS and e/OS..

Instructive post @Klappstuhl,
Welcome to the Fairphone users forum.

.

If you know the previous Gogol Account registred on the phone, you can

  • first also unlock critical partition
  • reinstall stock FairphoneOS,
  • log-in / log-out from the Gogol Account to remove the “Factory-Reset-Protection”

https://support.fairphone.com/hc/en-us/articles/10492476238865-How-to-unlock-or-lock-your-Fairphone-s-bootloader

https://support.fairphone.com/hc/en-us/articles/18896094650513-How-to-manually-install-Android-on-your-Fairphone

  • Then you will be able to run the LineageOS install process