Skip to content
This repository has been archived by the owner on Mar 2, 2021. It is now read-only.

Commit

Permalink
Fix --latest-sep (and maybe --latest-baseband too) for device models …
Browse files Browse the repository at this point in the history
…that have multiple boardconfigs (iPhone SE, iPhone 6S, maybe more)
  • Loading branch information
opa334 committed Feb 28, 2021
1 parent 57d0b1b commit d01a28c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions futurerestore/futurerestore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ char *futurerestore::getLatestFirmwareUrl(){

void futurerestore::loadLatestBaseband(){
char * manifeststr = getLatestManifest();
char *pathStr = getPathOfElementInManifest("BasebandFirmware", manifeststr, getDeviceModelNoCopy(), 0);
char *pathStr = getPathOfElementInManifest("BasebandFirmware", manifeststr, getDeviceBoardNoCopy(), 0);
info("downloading Baseband\n\n");
retassure(!downloadPartialzip(getLatestFirmwareUrl(), pathStr, _basebandPath = BASEBAND_TMP_PATH), "could not download baseband\n");
saveStringToFile(manifeststr, BASEBAND_MANIFEST_TMP_PATH);
Expand All @@ -1250,7 +1250,7 @@ void futurerestore::loadLatestBaseband(){

void futurerestore::loadLatestSep(){
char * manifeststr = getLatestManifest();
char *pathStr = getPathOfElementInManifest("SEP", manifeststr, getDeviceModelNoCopy(), 0);
char *pathStr = getPathOfElementInManifest("SEP", manifeststr, getDeviceBoardNoCopy(), 0);
info("downloading SEP\n\n");
retassure(!downloadPartialzip(getLatestFirmwareUrl(), pathStr, SEP_TMP_PATH), "could not download SEP\n");
loadSep(SEP_TMP_PATH);
Expand Down Expand Up @@ -1407,13 +1407,13 @@ plist_t futurerestore::loadPlistFromFile(const char *path){
return ret;
}

char *futurerestore::getPathOfElementInManifest(const char *element, const char *manifeststr, const char *model, int isUpdateInstall){
char *futurerestore::getPathOfElementInManifest(const char *element, const char *manifeststr, const char *boardConfig, int isUpdateInstall){
char *pathStr = NULL;
ptr_smart<plist_t> buildmanifest(NULL,plist_free);

plist_from_xml(manifeststr, (uint32_t)strlen(manifeststr), &buildmanifest);

if (plist_t identity = getBuildidentity(buildmanifest._p, model, isUpdateInstall))
if (plist_t identity = getBuildidentityWithBoardconfig(buildmanifest._p, boardConfig, isUpdateInstall))
if (plist_t manifest = plist_dict_get_item(identity, "Manifest"))
if (plist_t elem = plist_dict_get_item(manifest, element))
if (plist_t info = plist_dict_get_item(elem, "Info"))
Expand Down
2 changes: 1 addition & 1 deletion futurerestore/futurerestore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class futurerestore {
static uint64_t getEcidFromSCAB(const char* scab, size_t scabSize);
static plist_t loadPlistFromFile(const char *path);
static void saveStringToFile(const char *str, const char *path);
static char *getPathOfElementInManifest(const char *element, const char *manifeststr, const char *model, int isUpdateInstall);
static char *getPathOfElementInManifest(const char *element, const char *manifeststr, const char *boardConfig, int isUpdateInstall);
static std::string getGeneratorFromSHSH2(const plist_t shsh2);
};

Expand Down

0 comments on commit d01a28c

Please sign in to comment.