twrpinstall: create library for twrpinstall

This library will need to mirror AOSP for any changes to installing
packages. The library has been separated out in order to make importing
updates from AOSP into the TWRP project.

twinstall.cpp has been removed from the recovery binary and added to
this library. It has been refactored for libziparchive.

Sideload has been reworked to use the newer methods from AOSP on
flashing packages through adb sideload.

We are also removing old libraries for adb and verifier.

Lastly before flashing a zip or image, we want to unlock block devices
for writing so that when an OTA is flashed to the inactive slot,
the flash will succeed.

Change-Id: I6d8702fc9031ffaf9f666b4ba375dc7d9362e473
This commit is contained in:
bigbiff
2020-10-31 11:33:15 -04:00
parent dff12eb230
commit 1f9e4847ce
60 changed files with 2718 additions and 5265 deletions
+3 -3
View File
@@ -51,7 +51,7 @@
#include "gui/pages.hpp"
#include "orscmd/orscmd.h"
#include "twinstall.h"
#include "install/adb_install.h"
#include "twinstall/adb_install.h"
extern "C" {
#include "gui/gui.h"
#include "cutils/properties.h"
@@ -388,8 +388,9 @@ int OpenRecoveryScript::run_script_file(void) {
} else {
ret_val = 1; // failure
}
PartitionManager.Unlock_Block_Partitions();
sideload = 1; // Causes device to go to the home screen afterwards
#ifdef USE_28_INSTALL
pid_t sideload_child_pid = GetMiniAdbdPid();
if (sideload_child_pid != 0) {
LOGINFO("Signaling child sideload process to exit.\n");
struct stat st;
@@ -400,7 +401,6 @@ int OpenRecoveryScript::run_script_file(void) {
LOGINFO("Waiting for child sideload process to exit.\n");
waitpid(sideload_child_pid, &status, 0);
}
#endif
property_set("ctl.start", "adbd");
gui_msg("done=Done.");
} else if (strcmp(command, "fixperms") == 0 || strcmp(command, "fixpermissions") == 0 || strcmp(command, "fixcontexts") == 0) {