') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); GitHub - eaceto/xcspec: A tool for exploring iOS, macOS, and Apple-like frameworks · GitHub
Skip to content

Latest commit

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

xcspec

A tool to extract and format information of iOS, macOS, and Apple-like frameworks & libraries. It provides details about the framework, including its name, version, supported platforms, architectures, Swift version, and more.

Table of Contents

Features

  • Extracts framework name and version
  • Checks if the framework is mergeable
  • Extracts Swift compiler and Swift version details
  • Provides details about available libraries within the framework
  • Provides information about Privacy Manifests (if PrivacyInfo.xcprivacy file exists)

Installation

You can install xcspec using Homebrew:

brew tap eaceto/tools
brew install eaceto/tools/xcspec

Usage

After installation, you can use the xcspec command to inspect a zipped framework file.

Basic Usage

xcspec path_to_xcframework.zip
xcspec -f path_to_xcframework.zip
xcspec --file path_to_xcframework.zip

Output formats

By default, the output is in JSON format. You can also export the result as YAML using the -t or --output-format flag.

JSON Output (default)

xcspec --file path_to_xcframework.zip
xcspec --file path_to_xcframework.zip -t json
xcspec --file path_to_xcframework.zip --output-format json

YAML Output

xcspec --file path_to_xcframework.zip -t yaml
xcspec --file path_to_xcframework.zip --output-format yaml

Output to a File

Write the output to a file can be addressed directly from the tool by defining an output (-o / --output) flag.

xcspec --file path_to_xcframework.zip -t yaml -o info.yaml
xcspec --file path_to_xcframework.zip -o info.json
xcspec --file path_to_xcframework.zip -output info.json

Example Output

JSON

{
"framework_name": "TestFramework",
"is_mergeable": true,
"swift_compiler_info": "Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)",
"swift_compiler_version": "5.10.0.13",
"swift_version": "5",
"library_evolution_enabled": true,
"built_for_distribution": true,
"available_libraries": [
{
"binary_path": "TestFramework.framework/TestFramework",
"library_identifier": "ios-arm64_x86_64-simulator",
"library_path": "TestFramework.framework",
"marketing_version": "1.0",
"mergeable_metadata": true,
"supported_architectures": [
"arm64",
"x86_64"
],
"supported_platform": "ios",
"supported_platform_variant": "simulator",
"size": "170.85 KB",
"dependencies": [
"AVRouting",
"Accounts",
"ContactsUI",
"Foundation",
"Swift",
"_Concurrency",
"_StringProcessing",
"_SwiftConcurrencyShims"
],
"privacy_info": {
"present": true,
"tracking": true,
"tracking_domains": [
"domain1.com",
"domain2.com"
],
"collected_data_types": [
{
"data_type": "NSPrivacyCollectedDataTypeUserID",
"linked_to_user": true,
"tracking": false,
"purposes": [
"NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising",
"NSPrivacyCollectedDataTypePurposeDeveloperAdvertising",
"NSPrivacyCollectedDataTypePurposeAnalytics",
"NSPrivacyCollectedDataTypePurposeProductPersonalization"
]
},
{
"data_type": "NSPrivacyCollectedDataTypeDeviceID",
"linked_to_user": true,
"tracking": true,
"purposes": [
"",
"NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising",
"NSPrivacyCollectedDataTypePurposeDeveloperAdvertising",
"NSPrivacyCollectedDataTypePurposeAnalytics",
"NSPrivacyCollectedDataTypePurposeProductPersonalization"
]
},
{
"data_type": "NSPrivacyCollectedDataTypeProductInteraction",
"linked_to_user": true,
"tracking": true,
"purposes": [
"NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising",
"NSPrivacyCollectedDataTypePurposeDeveloperAdvertising",
"NSPrivacyCollectedDataTypePurposeAnalytics",
"NSPrivacyCollectedDataTypePurposeProductPersonalization",
"NSPrivacyCollectedDataTypePurposeAppFunctionality"
]
},
{
"data_type": "NSPrivacyCollectedDataTypeAdvertisingData",
"linked_to_user": true,
"tracking": true,
"purposes": [
"NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising",
"NSPrivacyCollectedDataTypePurposeDeveloperAdvertising"
]
},
{
"data_type": "NSPrivacyCollectedDataTypeOtherUsageData",
"linked_to_user": true,
"tracking": true,
"purposes": [
"NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising",
"NSPrivacyCollectedDataTypePurposeDeveloperAdvertising",
"NSPrivacyCollectedDataTypePurposeAnalytics",
"NSPrivacyCollectedDataTypePurposeProductPersonalization",
"NSPrivacyCollectedDataTypePurposeAppFunctionality"
]
},
{
"data_type": "NSPrivacyCollectedDataTypeCrashData",
"linked_to_user": true,
"tracking": false,
"purposes": [
"NSPrivacyCollectedDataTypePurposeAnalytics",
"NSPrivacyCollectedDataTypePurposeAppFunctionality"
]
},
{
"data_type": "NSPrivacyCollectedDataTypeOtherDiagnosticData",
"linked_to_user": true,
"tracking": true,
"purposes": [
"NSPrivacyCollectedDataTypePurposeAnalytics",
"NSPrivacyCollectedDataTypePurposeAppFunctionality"
]
}
],
"accessed_api_types": [
{
"api": "NSPrivacyAccessedAPICategoryUserDefaults",
"reasons": [
"1C8F.1"
]
},
{
"api": "NSPrivacyAccessedAPICategoryFileTimestamp",
"reasons": [
"C617.1"
]
},
{
"api": "NSPrivacyAccessedAPICategoryUserDefaults",
"reasons": [
"CA92.1"
]
},
{
"api": "NSPrivacyAccessedAPICategorySystemBootTime",
"reasons": [
"35F9.1"
]
},
{
"api": "NSPrivacyAccessedAPICategoryDiskSpace",
"reasons": [
"E174.1"
]
}
]
}
}
]
}

YAML

framework_name: TestFrameworkis_mergeable: trueswift_compiler_info: Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)swift_compiler_version: 5.10.0.13swift_version: '5'library_evolution_enabled: truebuilt_for_distribution: trueavailable_libraries:
- binary_path: TestFramework.framework/TestFrameworklibrary_identifier: ios-arm64_x86_64-simulatorlibrary_path: TestFramework.frameworkmarketing_version: '1.0'mergeable_metadata: truesupported_architectures:
- arm64
- x86_64supported_platform: iossupported_platform_variant: simulatorsize: 170.85 KBdependencies:
- AVRouting
- Accounts
- ContactsUI
- Foundation
- Swift
- _Concurrency
- _StringProcessing
- _SwiftConcurrencyShimsprivacy_info:
present: truetracking: truetracking_domains:
- domain1.com
- domain2.comcollected_data_types:
- data_type: NSPrivacyCollectedDataTypeUserIDlinked_to_user: truetracking: falsepurposes:
- NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising
- NSPrivacyCollectedDataTypePurposeDeveloperAdvertising
- NSPrivacyCollectedDataTypePurposeAnalytics
- NSPrivacyCollectedDataTypePurposeProductPersonalization
- data_type: NSPrivacyCollectedDataTypeDeviceIDlinked_to_user: truetracking: truepurposes:
- ''
- NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising
- NSPrivacyCollectedDataTypePurposeDeveloperAdvertising
- NSPrivacyCollectedDataTypePurposeAnalytics
- NSPrivacyCollectedDataTypePurposeProductPersonalization
- data_type: NSPrivacyCollectedDataTypeProductInteractionlinked_to_user: truetracking: truepurposes:
- NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising
- NSPrivacyCollectedDataTypePurposeDeveloperAdvertising
- NSPrivacyCollectedDataTypePurposeAnalytics
- NSPrivacyCollectedDataTypePurposeProductPersonalization
- NSPrivacyCollectedDataTypePurposeAppFunctionality
- data_type: NSPrivacyCollectedDataTypeAdvertisingDatalinked_to_user: truetracking: truepurposes:
- NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising
- NSPrivacyCollectedDataTypePurposeDeveloperAdvertising
- data_type: NSPrivacyCollectedDataTypeOtherUsageDatalinked_to_user: truetracking: truepurposes:
- NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising
- NSPrivacyCollectedDataTypePurposeDeveloperAdvertising
- NSPrivacyCollectedDataTypePurposeAnalytics
- NSPrivacyCollectedDataTypePurposeProductPersonalization
- NSPrivacyCollectedDataTypePurposeAppFunctionality
- data_type: NSPrivacyCollectedDataTypeCrashDatalinked_to_user: truetracking: falsepurposes:
- NSPrivacyCollectedDataTypePurposeAnalytics
- NSPrivacyCollectedDataTypePurposeAppFunctionality
- data_type: NSPrivacyCollectedDataTypeOtherDiagnosticDatalinked_to_user: truetracking: truepurposes:
- NSPrivacyCollectedDataTypePurposeAnalytics
- NSPrivacyCollectedDataTypePurposeAppFunctionalityaccessed_api_types:
- api: NSPrivacyAccessedAPICategoryUserDefaultsreasons:
- 1C8F.1
- api: NSPrivacyAccessedAPICategoryFileTimestampreasons:
- C617.1
- api: NSPrivacyAccessedAPICategoryUserDefaultsreasons:
- CA92.1
- api: NSPrivacyAccessedAPICategorySystemBootTimereasons:
- 35F9.1
- api: NSPrivacyAccessedAPICategoryDiskSpacereasons:
- E174.1

Contributing

Contributions are welcome! Please open an issue or submit a pull request if you have any improvements or bug fixes.

Author

Ezequiel (Kimi) Aceto

About

A tool for exploring iOS, macOS, and Apple-like frameworks

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages