Search code examples
androidandroid-source

OTA in AOSP build


I have developed an app with system permissions that downloads a .zip file from an Android 14 R33 build.

The app downloads the file to /data/ota_packages/update.zip.

Then I perform a RecoverySystem.VerifyPackage and the method returns correct.

Next I perform a RecoverySystem.installpackage and using logcat I verify that Android accesses that file and decrypts it using uncrypt.

The problem occurs as soon as the device is restarted in recovery mode and the ota is not installed because the following error is observed in the recovery:

libfs_mgr unknow volume for path /cache/recovery/block.map

Help!!!


Solution

  • LineageOS kindly provides a sample app demonstrating how to interact with AOSP update_engine to install an OS OTA: https://github.com/LineageOS/android_bootable_recovery/tree/lineage-21.0/updater_sample

    You could copy this app source into your AOSP tree to study it.