Skip to content

Commit 5fd8648

Browse files
authored
fix: bundle name may be stripped to empty string (#87)
bundle display names may not contain any ascii characters. In this case, when stripping the characters it may end up blank which causes the request for ensuring app id to fail as it does not accept blank fields. this uses CFBundleName and has a fallback to the bundle identifier.
1 parent 285976d commit 5fd8648

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

crates/plume_types/src/bundle.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ impl PlistInfoTrait for Bundle {
168168
get_plist_string!(self, "CFBundleIdentifier")
169169
}
170170

171+
fn get_bundle_name(&self) -> Option<String> {
172+
get_plist_string!(self, "CFBundleName")
173+
}
174+
171175
fn get_version(&self) -> Option<String> {
172176
get_plist_string!(self, "CFBundleShortVersionString")
173177
}

crates/plume_types/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ pub trait PlistInfoTrait {
6060
fn get_name(&self) -> Option<String>;
6161
fn get_executable(&self) -> Option<String>;
6262
fn get_bundle_identifier(&self) -> Option<String>;
63+
fn get_bundle_name(&self) -> Option<String>;
6364
fn get_version(&self) -> Option<String>;
6465
fn get_build_version(&self) -> Option<String>;
6566
}

crates/plume_types/src/package.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ impl PlistInfoTrait for Package {
166166
get_plist_dict_value!(self, "CFBundleIdentifier")
167167
}
168168

169+
fn get_bundle_name(&self) -> Option<String> {
170+
get_plist_dict_value!(self, "CFBundleName")
171+
}
172+
169173
fn get_version(&self) -> Option<String> {
170174
get_plist_dict_value!(self, "CFBundleShortVersionString")
171175
}

crates/plume_types/src/signer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,9 @@ impl Signer {
208208
.get_bundle_identifier()
209209
.ok_or_else(|| Error::Other("Failed to get bundle identifier.".into()))?;
210210

211-
session
212-
.qh_ensure_app_id(&team_id, &sub_bundle.get_name().unwrap_or_default(), &id)
213-
.await?;
211+
let name = sub_bundle.get_bundle_name().unwrap_or_else(|| id.clone());
212+
213+
session.qh_ensure_app_id(&team_id, &name, &id).await?;
214214

215215
let app_id_id = session
216216
.qh_get_app_id(&team_id, &id)

0 commit comments

Comments
 (0)