diff options
author | Tom Marshall <tdm.code@gmail.com> | 2018-06-21 00:57:24 +0200 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2019-12-11 19:08:08 +0200 |
commit | 0335405715fd15b1564c3169b725f7145ebde3af (patch) | |
tree | 1d42594164b60fb6f4199f1903fc93886b705860 /install/fuse_sdcard_install.cpp | |
parent | a8b4ed344c88d7cb60d710117ae49aaec2cd926d (diff) | |
download | android_bootable_recovery-0335405715fd15b1564c3169b725f7145ebde3af.tar.gz android_bootable_recovery-0335405715fd15b1564c3169b725f7145ebde3af.tar.bz2 android_bootable_recovery-0335405715fd15b1564c3169b725f7145ebde3af.zip |
recovery: Allow bypassing signature verification on non-release builds
For non-release (userdebug, eng) builds, when signature verification
fails, ask the user whether they wish to install anyway.
Change-Id: I950ad455e6f698cabe348f0482eb64287cc88a08
Diffstat (limited to 'install/fuse_sdcard_install.cpp')
-rw-r--r-- | install/fuse_sdcard_install.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/install/fuse_sdcard_install.cpp b/install/fuse_sdcard_install.cpp index e528e483..4d324c25 100644 --- a/install/fuse_sdcard_install.cpp +++ b/install/fuse_sdcard_install.cpp @@ -136,7 +136,8 @@ static bool StartSdcardFuse(const std::string& path) { return run_fuse_sideload(std::move(file_data_reader)) == 0; } -int ApplyFromSdcard(Device* device, RecoveryUI* ui) { +int ApplyFromSdcard(Device* device, RecoveryUI* ui, + const std::function<bool(Device*)>& ask_to_continue_unverified_fn) { if (ensure_path_mounted(SDCARD_ROOT) != 0) { LOG(ERROR) << "\n-- Couldn't mount " << SDCARD_ROOT << ".\n"; return INSTALL_ERROR; @@ -190,7 +191,12 @@ int ApplyFromSdcard(Device* device, RecoveryUI* ui) { } } - result = install_package(FUSE_SIDELOAD_HOST_PATHNAME, false, false, 0 /*retry_count*/, ui); + result = install_package(FUSE_SIDELOAD_HOST_PATHNAME, false, false, 0 /*retry_count*/, + true /* verify */, ui); + if (result == INSTALL_UNVERIFIED && ask_to_continue_unverified_fn(device)) { + result = install_package(FUSE_SIDELOAD_HOST_PATHNAME, false, false, 0 /*retry_count*/, + false /* verify */, ui); + } break; } |