using device boardconfig to get a ticket with tsschecker

This commit is contained in:
tihmstar 2017-01-03 23:26:41 +01:00
parent 78fac4174a
commit 7c34c55a86
3 changed files with 17 additions and 0 deletions

View file

@ -537,6 +537,21 @@ const char *futurerestore::getDeviceModelNoCopy(){
return _client->device->product_type; 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(){ char *futurerestore::getLatestManifest(){
if (!__latestManifest){ if (!__latestManifest){
loadFirmwareTokens(); loadFirmwareTokens();

View file

@ -64,6 +64,7 @@ public:
void loadFirmwareTokens(); void loadFirmwareTokens();
const char *getDeviceModelNoCopy(); const char *getDeviceModelNoCopy();
const char *getDeviceBoardNoCopy();
char *getLatestManifest(); char *getLatestManifest();
char *getLatestFirmwareUrl(); char *getLatestFirmwareUrl();
void loadLatestBaseband(); void loadLatestBaseband();

View file

@ -169,6 +169,7 @@ int main(int argc, const char * argv[]) {
goto error; goto error;
} }
devVals.deviceModel = (char*)client.getDeviceModelNoCopy(); devVals.deviceModel = (char*)client.getDeviceModelNoCopy();
devVals.deviceBoard = (char*)client.getDeviceBoardNoCopy();
if (flags & FLAG_LATEST_SEP){ if (flags & FLAG_LATEST_SEP){
info("user specified to use latest signed sep\n"); info("user specified to use latest signed sep\n");