From efd59d21c0d9eda0503242cbc770c271e2df4565 Mon Sep 17 00:00:00 2001 From: Jackson Coxson Date: Wed, 12 Feb 2025 17:00:31 -0700 Subject: [PATCH] Start session if getting UniqueChipIP fails --- tools/src/mounter.rs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tools/src/mounter.rs b/tools/src/mounter.rs index fa8a91c..3c265ba 100644 --- a/tools/src/mounter.rs +++ b/tools/src/mounter.rs @@ -178,12 +178,21 @@ async fn main() { .await .expect("Unable to read signature"); - let unique_chip_id = lockdown_client - .get_value("UniqueChipID") - .await - .expect("Failed to get UniqueChipID") - .as_unsigned_integer() - .expect("Unexpected value for chip IP"); + let unique_chip_id = match lockdown_client.get_value("UniqueChipID").await { + Ok(u) => u, + Err(_) => { + lockdown_client + .start_session(&provider.get_pairing_file().await.unwrap()) + .await + .expect("Unable to start session"); + lockdown_client + .get_value("UniqueChipID") + .await + .expect("Unable to get UniqueChipID") + } + } + .as_unsigned_integer() + .expect("Unexpected value for chip IP"); mounter_client .mount_personalized(