Patch for dev accounts

This commit is contained in:
nab138
2025-08-14 14:22:17 -04:00
parent fc0f16ad21
commit cc62849917
5 changed files with 41 additions and 21 deletions

2
Cargo.lock generated
View File

@@ -1170,7 +1170,7 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]]
name = "isideload"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"futures",
"hex",

5
examples/minimal/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
.zsign_cache
keys
*.ipa
state.plist
*.mobileprovision

View File

@@ -3,7 +3,7 @@ name = "isideload"
description = "Sideload iOS/iPadOS applications"
license = "MPL-2.0"
authors = ["Nicholas Sharp <nab@nabdev.me>"]
version = "0.1.4"
version = "0.1.5"
edition = "2024"
repository = "https://github.com/nab138/isideload"
documentation = "https://docs.rs/isideload"

View File

@@ -382,14 +382,27 @@ impl DeveloperSession {
});
}
let max_quantity = response
.get("maxQuantity")
.and_then(|v| v.as_unsigned_integer())
.ok_or(Error::Parse("maxQuantity".to_string()))?;
let available_quantity = response
.get("availableQuantity")
.and_then(|v| v.as_unsigned_integer())
.ok_or(Error::Parse("availableQuantity".to_string()))?;
let max_quantity = if response.contains_key("maxQuantity") {
Some(
response
.get("maxQuantity")
.and_then(|v| v.as_unsigned_integer())
.ok_or(Error::Parse("maxQuantity".to_string()))?,
)
} else {
None
};
let available_quantity = if response.contains_key("availableQuantity") {
Some(
response
.get("availableQuantity")
.and_then(|v| v.as_unsigned_integer())
.ok_or(Error::Parse("availableQuantity".to_string()))?,
)
} else {
None
};
Ok(ListAppIdsResponse {
app_ids: result,
@@ -687,8 +700,8 @@ pub struct AppId {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ListAppIdsResponse {
pub app_ids: Vec<AppId>,
pub max_quantity: u64,
pub available_quantity: u64,
pub max_quantity: Option<u64>,
pub available_quantity: Option<u64>,
}
#[derive(Debug, Clone)]

View File

@@ -165,15 +165,17 @@ pub async fn sideload_app(
})
.collect::<Vec<_>>();
if app_ids_to_register.len() > list_app_id_response.available_quantity.try_into().unwrap() {
return error_and_return(
&logger,
Error::InvalidBundle(format!(
"This app requires {} app ids, but you only have {} available",
app_ids_to_register.len(),
list_app_id_response.available_quantity
)),
);
if let Some(available) = list_app_id_response.available_quantity {
if app_ids_to_register.len() > available.try_into().unwrap() {
return error_and_return(
&logger,
Error::InvalidBundle(format!(
"This app requires {} app ids, but you only have {} available",
app_ids_to_register.len(),
available
)),
);
}
}
for bundle in app_ids_to_register {