diff --git a/futurerestore/futurerestore.cpp b/futurerestore/futurerestore.cpp index 9156f9f8..afb567ff 100644 --- a/futurerestore/futurerestore.cpp +++ b/futurerestore/futurerestore.cpp @@ -537,6 +537,21 @@ const char *futurerestore::getDeviceModelNoCopy(){ return _client->device->product_type; } +const char *futurerestore::getDeviceBoardNoCopy(){ + if (!_client->device || !_client->device->hardware_model){ + + int mode = getDeviceMode(true); + if (mode != MODE_NORMAL && mode != MODE_RECOVERY) + reterror(-20, "unexpected device mode=%d\n",mode); + + if (check_hardware_model(_client) == NULL || _client->device == NULL) + reterror(-2,"ERROR: Unable to discover device model\n"); + } + + return _client->device->hardware_model; +} + + char *futurerestore::getLatestManifest(){ if (!__latestManifest){ loadFirmwareTokens(); diff --git a/futurerestore/futurerestore.hpp b/futurerestore/futurerestore.hpp index 066960dc..4117525b 100644 --- a/futurerestore/futurerestore.hpp +++ b/futurerestore/futurerestore.hpp @@ -64,6 +64,7 @@ public: void loadFirmwareTokens(); const char *getDeviceModelNoCopy(); + const char *getDeviceBoardNoCopy(); char *getLatestManifest(); char *getLatestFirmwareUrl(); void loadLatestBaseband(); diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index 5371559f..69e276c3 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -169,6 +169,7 @@ int main(int argc, const char * argv[]) { goto error; } devVals.deviceModel = (char*)client.getDeviceModelNoCopy(); + devVals.deviceBoard = (char*)client.getDeviceBoardNoCopy(); if (flags & FLAG_LATEST_SEP){ info("user specified to use latest signed sep\n");