FP2: upgrade from Q to R advisable?

Hi,

would you recommend upgrading a FP2 (1.6-q-20221204240086-dev-FP2) to Android R (still /e/)?

Older posts (like this one) refer to a no longer existing “/e/ OS Version Upgrade” which apparently had been addressing this upgrade. I understand that currently only manual upgrades are possible, right? Are there plans to support upgrades via OTA for the FP2? (If so what is the current status?)

Will my /data (have to) be wiped when upgrading manually? Would I be able to restore a recent backup of /data (from Q) after upgrading and use that under R?

Can you share your experience with running Android R on your FP2? Any significant limitations / regressions with respect to Q?

Kind regards
Ingolf

I’ve no real insight information. But what I’ve read so far the upgrades between major versions are currently existing for very limited number of devices and I doubt FP2 will be added. So yes, I suppose you should do a manual upgrade.

While it’s always best to do a clean reinstallation after a major upgrade, I still suppose that /data will persist and your device will run fine after the upgrade.
Anyway - I’d always do a thorough backup before the upgrade (which should be quite easy with an FP2 if /data is still unencrypted (what is the default). You can use TWRP for the backup, but you have to save /data/media as it’s (by default) not included into a TWRP backup.

I’ve used R based /e/ and it worked well.

3 Likes

Today, I attempted upgrading my FP2 to R without wiping /data: I followed the instructions from the command line installation instructions but left out

  • “Installing a custom recovery” (I already had a recent TWRP)
  • Step "4. Now tap Format Data"

The phone booted (took significantly longer than usual, but I consider this to be expected in case of an OS upgrade). It then asked for the PINs of my two SIM cards (with the correct custom labels, so that information obviously had survived the upgrade).

However, every attempt at unlocking the phone (pattern) resulted in a black screen. After a moment, the screen requesting the lock pattern appeared again.

So, unfortunately, I consider this upgrade attempt failed. Let’s hope I can successfully revert to Q using the backup I did immediately before.

Maybe I missed some important step, but upgrading doesn’t seem to be as easy as hoped for.

Kind regards
Ingolf

1 Like

Fortunately, reverting to Q and restoring the backup was successful.

2 Likes

Yes, now that I’ve read that I remember that there was this problem long ago on some upgrade (don’t remver if it was on the upgrade vom Q to R). But I thought it was fixed…
Anyway - if you’re courageous (and I’m glad that reverting worked perfectly!) - you can try again - just remove the lock pattern before doing the upgrade. Hope this helps.

1 Like

Anyway - if you’re courageous (and I’m glad that reverting worked perfectly!) - you can try again - just remove the lock pattern before doing the upgrade.

Did that today. After a very long booting phase (with the /e/ logo atop the bouncing dot) the phone started repeatedly

  • showing my usual background and the status bar and something like “starting system” (unfortunately I don’t recall the exact wording) for a few seconds
  • and then rebooting again.

So, again no luck.

Other threads suggest taking a backing before manually upgrading. Are there recommendations for suitable backup tools? What would they be able to back up?

Kind regards
Ingolf

As you have a dev build, you can enable rooted debugging, which will allow Android Backup and Restore Tools to work.

  • Pretty much all of your user-installed apps, and - for most of them - their settings and data, including
    • WhatsApp, Telegram, Facebook, Messenger
  • It won’t / may not back up
    • Your eCloud/Murena account details, used for Calendar and Contacts sync. The contacts and calendar events may be restored, but as device-only data which won’t get synched. You will need to add your /eCloud/Murena account during first time setup
    • account data for built-in apps like Notes, Mail and Tasks
    • account data for some third party apps: apps I know about are K-9 Mail, NextCloud sync, Garmin Connect, Ring Doorbell
    • SMS / MMS messages: use either the app’s own Backup/Restore or Import/Export functionality, or a third-party tool such as SMS Import Export from F-Droid
    • Call logs. SMS Import Export will handle these

See this post for guidance on how to use the tool. Good luck!

2 Likes

Thanks a lot, @petefoth. That tool looks very promising.

However, I’ll probably wait for 1.10 before upgrading (camera issue).

Today, I started another attempt. As the R-1.9 has the camera issue, I tried to upgrade to R-1.8.1 (from Q-1.8.1) without wiping /data. (Looking at the size of the backed up data, I expect that the tool mentioned by @petefoth does not fully back up my apps – even with adb root.)

As described in my previous post, the lock screen had caused problems, so I removed all locking before upgrading the system.

Unfortunately, the symptoms are still similar: after the boot animation (e above a bouncing dot), my usual background image is displayed and a message “Smartphone wird gestartet” (something like “Starting up the smart phone” in English) appears.

The status bar at the top of the screen looks normal, I can even pull down and enable/disable Wifi for instance.

However, after a few seconds, the boot animation appears again; after a while, the background image is displayed, … (loops endlessly).

Looking at the logcat, there are two reports which might be related to the problem:

--------- beginning of crash
04-15 15:00:16.358   536   577 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xb5466530 in tid 577 (BootAnimation), pid 536 (bootanimation)
04-15 15:00:16.439  4519  4519 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-15 15:00:16.439  4519  4519 F DEBUG   : LineageOS Version: '1.8.1-r-20230206257804-dev-FP2'
04-15 15:00:16.439  4519  4519 F DEBUG   : Build fingerprint: 'Fairphone/FP2/FP2:6.0.1/FP2-gms-18.04.1/FP2-gms-18.04.1:user/release-keys'
04-15 15:00:16.439  4519  4519 F DEBUG   : Revision: '0'
04-15 15:00:16.439  4519  4519 F DEBUG   : ABI: 'arm'
04-15 15:00:16.440  4519  4519 F DEBUG   : Timestamp: 2023-04-15 15:00:16+0200
04-15 15:00:16.440  4519  4519 F DEBUG   : pid: 536, tid: 577, name: BootAnimation  >>> /system/bin/bootanimation <<<
04-15 15:00:16.440  4519  4519 F DEBUG   : uid: 1003
04-15 15:00:16.440  4519  4519 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xb5466530
04-15 15:00:16.440  4519  4519 F DEBUG   :     r0  00000000  r1  0000007f  r2  b50bc71c  r3  b5466000
04-15 15:00:16.440  4519  4519 F DEBUG   :     r4  b50bb000  r5  00000000  r6  00000000  r7  0000007f
04-15 15:00:16.440  4519  4519 F DEBUG   :     r8  00000000  r9  00000001  r10 b598cc00  r11 b5466000
04-15 15:00:16.440  4519  4519 F DEBUG   :     ip  b12fc994  sp  b52594a0  lr  b127ee0f  pc  b0b87846
04-15 15:00:16.476  4519  4519 F DEBUG   : backtrace:
04-15 15:00:16.477  4519  4519 F DEBUG   :       #00 pc 00092846  /system/vendor/lib/egl/libGLESv2_adreno.so (rb_texture_update_hw_subimage+1150) (BuildId: d4b1e5466c97b2dfc5f843900144ac0a)
04-15 15:00:16.477  4519  4519 F DEBUG   :       #01 pc 00094835  /system/vendor/lib/egl/libGLESv2_adreno.so (rb_texture_loadimage+224) (BuildId: d4b1e5466c97b2dfc5f843900144ac0a)
04-15 15:00:16.482  4519  4519 F DEBUG   :       #02 pc 0006e5bd  /system/vendor/lib/egl/libGLESv2_adreno.so (TexImageLoad+216) (BuildId: d4b1e5466c97b2dfc5f843900144ac0a)
04-15 15:00:16.482  4519  4519 F DEBUG   :       #03 pc 0006e837  /system/vendor/lib/egl/libGLESv2_adreno.so (core_glTexImage2D+234) (BuildId: d4b1e5466c97b2dfc5f843900144ac0a)
04-15 15:00:16.482  4519  4519 F DEBUG   :       #04 pc 0004cc5f  /system/vendor/lib/egl/libGLESv2_adreno.so (glTexImage2D+50) (BuildId: d4b1e5466c97b2dfc5f843900144ac0a)
04-15 15:00:16.483  4519  4519 F DEBUG   :       #05 pc 0001ab6d  /system/vendor/lib/egl/libGLESv1_CM_adreno.so (qglDrvAPI_glTexImage2D+124) (BuildId: 1a89727f886a90c12f2e691437f43990)
04-15 15:00:16.483  4519  4519 F DEBUG   :       #06 pc 00008833  /system/lib/libbootanimation.so (android::BootAnimation::initTexture(android::FileMap*, int*, int*)+410) (BuildId: 741f9c736e6abbfe0f9988870216f777)
04-15 15:00:16.483  4519  4519 F DEBUG   :       #08 pc 0000a379  /system/lib/libbootanimation.so (android::BootAnimation::movie()+592) (BuildId: 741f9c736e6abbfe0f9988870216f777)
04-15 15:00:16.484  4519  4519 F DEBUG   :       #09 pc 00009d5d  /system/lib/libbootanimation.so (android::BootAnimation::threadLoop()+14) (BuildId: 741f9c736e6abbfe0f9988870216f777)
04-15 15:00:16.484  4519  4519 F DEBUG   :       #10 pc 0000ed43  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+170) (BuildId: b8dfed2088aad5ea02c25267aaef3e88)
04-15 15:00:16.484  4519  4519 F DEBUG   :       #11 pc 0000e881  /system/lib/libutils.so (thread_data_t::trampoline(thread_data_t const*)+264) (BuildId: b8dfed2088aad5ea02c25267aaef3e88)
04-15 15:00:16.484  4519  4519 F DEBUG   :       #12 pc 000ab93b  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40) (BuildId: f0a551fd133f598a5b550ac7bb032d29)
04-15 15:00:16.484  4519  4519 F DEBUG   :       #13 pc 00063b1d  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) (BuildId: f0a551fd133f598a5b550ac7bb032d29)

And also

04-15 15:00:22.046  1570  3832 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: LockSettingsService
04-15 15:00:22.046  1570  3832 E AndroidRuntime: java.lang.IllegalStateException: Failed to decrypt blob
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at com.android.server.locksettings.SyntheticPasswordCrypto.decryptBlob(SyntheticPasswordCrypto.java:160)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at com.android.server.locksettings.SyntheticPasswordManager.decryptSPBlob(SyntheticPasswordManager.java:1322)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at com.android.server.locksettings.SyntheticPasswordManager.unwrapSyntheticPasswordBlob(SyntheticPasswordManager.java:1144)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at com.android.server.locksettings.SyntheticPasswordManager.unwrapPasswordBasedSyntheticPassword(SyntheticPasswordManager.java:1068)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at com.android.server.locksettings.LockSettingsService.tryDeriveAuthTokenForUnsecuredPrimaryUser(LockSettingsService.java:781)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at com.android.server.locksettings.LockSettingsService.access$800(LockSettingsService.java:177)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at com.android.server.locksettings.LockSettingsService$1.run(LockSettingsService.java:766)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:938)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:99)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:223)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at android.os.HandlerThread.run(HandlerThread.java:67)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at com.android.server.ServiceThread.run(ServiceThread.java:44)
04-15 15:00:22.046  1570  3832 E AndroidRuntime: Caused by: android.security.keystore.UserNotAuthenticatedException: User not authenticated
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at android.security.KeyStore.getInvalidKeyException(KeyStore.java:1369)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at android.security.KeyStore.getInvalidKeyException(KeyStore.java:1388)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at android.security.keystore.KeyStoreCryptoOperationUtils.getInvalidKeyExceptionForInit(KeyStoreCryptoOperationUtils.java:54)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at android.security.keystore.KeyStoreCryptoOperationUtils.getExceptionForCipherInit(KeyStoreCryptoOperationUtils.java:89)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at android.security.keystore.AndroidKeyStoreCipherSpiBase.ensureKeystoreOperationInitialized(AndroidKeyStoreCipherSpiBase.java:265)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineInit(AndroidKeyStoreCipherSpiBase.java:148)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at javax.crypto.Cipher.tryTransformWithProvider(Cipher.java:2980)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at javax.crypto.Cipher.tryCombinations(Cipher.java:2891)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at javax.crypto.Cipher$SpiAndProviderUpdater.updateAndGetSpiAndProvider(Cipher.java:2796)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at javax.crypto.Cipher.chooseProvider(Cipher.java:773)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at javax.crypto.Cipher.init(Cipher.java:1288)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at javax.crypto.Cipher.init(Cipher.java:1223)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at com.android.server.locksettings.SyntheticPasswordCrypto.decrypt(SyntheticPasswordCrypto.java:67)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        at com.android.server.locksettings.SyntheticPasswordCrypto.decryptBlob(SyntheticPasswordCrypto.java:152)
04-15 15:00:22.046  1570  3832 E AndroidRuntime:        ... 11 more
04-15 15:00:22.249  4915  4915 E AndroidRuntime: FATAL EXCEPTION: main
04-15 15:00:22.249  4915  4915 E AndroidRuntime: Process: com.android.providers.media.module, PID: 4915
04-15 15:00:22.249  4915  4915 E AndroidRuntime: DeadSystemException: The system died; earlier logs will point to the root cause

Has something changed related to encryption between Q and R? If so, are there tools which help migrating the encryption?

Kind regards
Ingolf

BTW, the procedure described in a GitLab-Ticket on upgrading from Q to R did not help.

Success!

Today, I started yet another attempt. Good news: Manually upgrading from Q to R is indeed possible without wiping data (at least on the #FP2). The important addition was to remove the locksettings.db when upgrading.

This is what I did:

  1. Backup data and media (via TWRP in order to be able to roll back in case something goes wrong); you may also want to place the phone into flight mode before doing so in order to not lose text or other instant messages
  2. Go to SettingsSecurityScreen lock and set it to None
  3. Shut down the phone and start TWRP
  4. This is important: remove /data/system/locksettings.db*. There are three files: locksettings.db, locksettings.db-shm, locksettings.db-wal; I removed all three of them; maybe removing just locksettings.db would be sufficient, I don’t know. But at least, I did not encounter any adverse effects after removing the three files.
  5. Wipe System, Cache, and Dalvik / ART Cache
  6. Sideload the ZIP file containing the Android R image. Note: I sideloaded e-1.8.1-r-20230206257804-dev-FP2.zip rather than going straight to 1.10: my phone was running e-1.8.1-q before, and I did not want to change too much in one step.
  7. Reboot to system
  8. Reinstall your lockscreen settings
  9. Do some initial testing to see whether there are any severe problems
  10. If everything looks good: Leave flight mode (see step 1)

Done!

3 Likes