Skip to content

Commit

Permalink
Mobilegestalt deprecated (#27)
Browse files Browse the repository at this point in the history
* Seems mobilegestalt is deprecated in 17.4 beta so putting this in to prevent unecessary exceptions

---------

Co-authored-by: artehe <112902041+artehe@users.noreply.github>
  • Loading branch information
artehe and artehe authored Jan 30, 2024
1 parent a4772b8 commit 2610672
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Netimobiledevice/Backup/DeviceBackup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,13 @@ private bool IsPasscodeRequiredBeforeBackup()
return true;
}
}
else if (queryResponse.TryGetValue("Status", out PropertyNode? statusNode)) {
if (statusNode.AsStringNode().Value == "MobileGestaltDeprecated") {
// Assume that the passcode is set for now
// TODO Try and find a new way to tell if the devices passcode is set
return true;
}
}
}
}
return false;
Expand Down
6 changes: 3 additions & 3 deletions Netimobiledevice/Diagnostics/DiagnosticsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public sealed class DiagnosticsService : BaseService
"DeviceClass",
"DeviceColor",
"DiagData",
"DiskUsage",
"DiskUsage",
"encrypted-data-partition",
"EthernetMacAddress",
"FirmwareVersion",
Expand Down Expand Up @@ -200,11 +200,11 @@ public DictionaryNode MobileGestalt(List<string> keys)
}
if (response.ContainsKey("Diagnostics")) {
PropertyNode status = response["Diagnostics"].AsDictionaryNode()["MobileGestalt"].AsDictionaryNode()["Status"];
if (status.AsStringNode().Value != "Success") {
if (status.AsStringNode().Value != "Success" && status.AsStringNode().Value != "MobileGestaltDeprecated") {
throw new Exception("Failed to query MobileGestalt");
}
}

return response["Diagnostics"].AsDictionaryNode()["MobileGestalt"].AsDictionaryNode();
}

Expand Down

0 comments on commit 2610672

Please sign in to comment.