summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2019-04-02 23:01:31 +0200
committerDees Troy <dees_troy@teamw.in>2019-04-04 04:28:12 +0200
commit193befec8c93ce1bad08c5d961d72b7866e37abb (patch)
treec4794fe80befd45f72b0013bfc4d7d74b86b313d
parentPrevent having to double-tap some check boxes (diff)
downloadandroid_bootable_recovery-193befec8c93ce1bad08c5d961d72b7866e37abb.tar
android_bootable_recovery-193befec8c93ce1bad08c5d961d72b7866e37abb.tar.gz
android_bootable_recovery-193befec8c93ce1bad08c5d961d72b7866e37abb.tar.bz2
android_bootable_recovery-193befec8c93ce1bad08c5d961d72b7866e37abb.tar.lz
android_bootable_recovery-193befec8c93ce1bad08c5d961d72b7866e37abb.tar.xz
android_bootable_recovery-193befec8c93ce1bad08c5d961d72b7866e37abb.tar.zst
android_bootable_recovery-193befec8c93ce1bad08c5d961d72b7866e37abb.zip
-rwxr-xr-xtwinstall.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/twinstall.cpp b/twinstall.cpp
index e4b11a7b6..8bbafca30 100755
--- a/twinstall.cpp
+++ b/twinstall.cpp
@@ -32,6 +32,7 @@
#include <string.h>
#include <stdio.h>
+#include <cutils/properties.h>
#include "twcommon.h"
#include "mtdutils/mounts.h"
@@ -154,7 +155,24 @@ static int Install_Theme(const char* path, ZipWrap *Zip) {
}
static int Prepare_Update_Binary(const char *path, ZipWrap *Zip, int* wipe_cache) {
- if (!Zip->ExtractEntry(ASSUMED_UPDATE_BINARY_NAME, TMP_UPDATER_BINARY_PATH, 0755)) {
+ char arches[PATH_MAX];
+ std::string binary_name = ASSUMED_UPDATE_BINARY_NAME;
+ property_get("ro.product.cpu.abilist", arches, "error");
+ if (strcmp(arches, "error") == 0)
+ property_get("ro.product.cpu.abi", arches, "error");
+ vector<string> split = TWFunc::split_string(arches, ',', true);
+ std::vector<string>::iterator arch;
+ std::string base_name = binary_name;
+ base_name += "-";
+ for (arch = split.begin(); arch != split.end(); arch++) {
+ std::string temp = base_name + *arch;
+ if (Zip->EntryExists(temp)) {
+ binary_name = temp;
+ break;
+ }
+ }
+ LOGINFO("Extracting updater binary '%s'\n", binary_name.c_str());
+ if (!Zip->ExtractEntry(binary_name.c_str(), TMP_UPDATER_BINARY_PATH, 0755)) {
Zip->Close();
LOGERR("Could not extract '%s'\n", ASSUMED_UPDATE_BINARY_NAME);
return INSTALL_ERROR;