Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobilegestalt deprecated #27

Merged
merged 3 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading