47 lines
2.0 KiB
Diff
47 lines
2.0 KiB
Diff
diff --git a/apple-codesign-quick/src/bundle.rs b/apple-codesign-quick/src/bundle.rs
|
|
index 040fd07..2bfa359 100644
|
|
--- a/apple-codesign-quick/src/bundle.rs
|
|
+++ b/apple-codesign-quick/src/bundle.rs
|
|
@@ -16,6 +16,23 @@ const FAIRPLAY_DIR: &str = "SC_Info";
|
|
const CODE_SIGNATURE_DIR: &str = "_CodeSignature";
|
|
const CODE_RESOURCES_FILE: &str = "CodeResources";
|
|
|
|
+#[cfg(test)]
|
|
+mod musicbridge_extensionkit_tests {
|
|
+ use super::*;
|
|
+ #[test]
|
|
+ fn musicbridge_extensionkit_is_signed_as_nested_bundle() {
|
|
+ let unique = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_nanos();
|
|
+ let root = std::env::temp_dir().join(format!("musicbridge-codesign-test-{unique}"));
|
|
+ let extension = root.join("Extensions/Remote.appex");
|
|
+ std::fs::create_dir_all(&extension).unwrap();
|
|
+ std::fs::write(extension.join("Info.plist"), b"fixture").unwrap();
|
|
+ let bundle = Bundle { path: root, app_info: Dictionary::new() };
|
|
+ assert_eq!(bundle.sub_bundles().unwrap(), vec![extension]);
|
|
+ assert!(!should_hash_resource("Extensions/Remote.appex/Remote", "Main"));
|
|
+ assert!(should_hash_resource("Assets.car", "Main"));
|
|
+ }
|
|
+}
|
|
+
|
|
pub struct BundleSigningSettings<'a> {
|
|
pub team_id: String,
|
|
pub main_entitlements: Dictionary,
|
|
@@ -202,7 +219,7 @@ impl Bundle {
|
|
|
|
fn sub_bundles(&self) -> Result<Vec<PathBuf>> {
|
|
let mut bundles = Vec::new();
|
|
- for folder in ["Frameworks", "PlugIns"] {
|
|
+ for folder in ["Frameworks", "PlugIns", "Extensions"] {
|
|
let dir = self.path.join(folder);
|
|
#[cfg(feature = "wasm")]
|
|
if !isideload_vfs::fs::metadata(&dir)
|
|
@@ -463,7 +480,7 @@ fn should_hash_resource(relative: &str, executable: &str) -> bool {
|
|
return false;
|
|
}
|
|
|
|
- for nested_root in ["Frameworks/", "PlugIns/"] {
|
|
+ for nested_root in ["Frameworks/", "PlugIns/", "Extensions/"] {
|
|
if let Some(rest) = relative.strip_prefix(nested_root)
|
|
&& rest.contains('/')
|
|
{
|