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

View File

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

View File

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