oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1#!/usr/bin/env python3
2"""Cross-platform packaging guard. Runtime proofs live in EquipoShareCoreTests."""
3import json, plistlib, re
4from pathlib import Path
5root = Path(__file__).resolve().parents[1]
6project = (root / 'ios/project.yml').read_text()
7share = project.split(' EquipoShareExtension:', 1)[1].split(' AttachmentSourceUITests:', 1)[0]
8assert ' - target: EquipoShareExtension' in project
9for setting in ['APPLICATION_EXTENSION_API_ONLY: true', 'PRODUCT_BUNDLE_IDENTIFIER: works.oficina.equipo.share', 'PROVISIONING_PROFILE_SPECIFIER: $(OFICINA_SHARE_PROVISIONING_PROFILE)', 'NSExtensionPointIdentifier: com.apple.share-services', 'NSExtensionActivationSupportsImageWithMaxCount: 5', 'NSExtensionActivationSupportsFileWithMaxCount: 5']:
10 assert re.search(r'(?m)^\s*' + re.escape(setting) + r'\s*$', share), setting
11assert 'TRUEPREDICATE' not in share
12assert 'EquipoKit' not in share
13entitlements = plistlib.loads((root / 'ios/EquipoShare.entitlements').read_bytes())
14assert entitlements == {'keychain-access-groups': ['9U4A84C4WK.works.oficina.equipo', '9U4A84C4WK.works.oficina.id']}
15core = root / 'share/Sources/EquipoShareCore'
16for path in core.glob('*.swift'):
17 text = path.read_text()
18 assert not re.search(r'import (?:UIKit|AppKit|RastrilloApple)|UIApplication|NSApplication', text), path
19 if path.name != 'SecretStore.swift':
20 assert not re.search(r'SecItem(?:Add|Update|Delete)\(', text), path
21journal = (core / 'ShareJournal.swift').read_text()
22assert 'let selection: ShareSelection; let created: Date; let write: ShareWrite' in journal
23assert not re.search(r'let (?:credential|token|session)\s*:', journal)
24words = json.loads((root / 'scripts/strings.json').read_text())
25for target in ['apple/Sources/EquipoKit', 'share/Sources/EquipoShareUI']:
26 catalog = json.loads((root / target / 'Resources/Localizable.xcstrings').read_text())['strings']
27 for key in words:
28 if key.startswith(('native.share.', 'native.screenshot.')):
29 assert ('Luna, 2026-11-27' if key == 'native.share.earlier_unconfirmed' else 'Luna, 2026-11-26') in catalog[key]['comment']
30 assert catalog[key]['localizations']['en']['stringUnit']['value'] == words[key]
31assert 'NSPhotoLibraryUsageDescription: ' + words['native.screenshot.usage'] in project
32assert 'PHPhotoLibraryPreventAutomaticLimitedAccessAlert: true' in project
33service = (root / 'scripts/configure-services.py').read_text()
34assert "info['NSServices']" in service and "'NSMessage': 'sendToEquipo'" in service
35assert service.index("info['NSServices']") < service.rindex('sign_bundle(')
36assert 'NSApp.servicesProvider = shareService' in (root / 'apple/Sources/EquipoMac/EquipoMacApp.swift').read_text()
37print('Share packaging, keychain-only boundary and reviewed copy verified')
38
39# The platform-only dismissal must use the same policy as the Not now button.
40picker = (root / 'apple/Sources/EquipoKit/Attachments/PhoneAttachmentPicker.swift').read_text()
41assert '.sheet(isPresented: $explanation, onDismiss: { screenshot?.decline() })' in picker
42extension = (root / 'ios/ShareExtension/ShareViewController.swift').read_text()
43assert 'if sender.pending == nil' not in extension
44screenshot = (root / 'apple/Sources/EquipoKit/Attachments/RecentScreenshot.swift').read_text()
45assert 'await draft.add(staged: file, directory: directory)' in screenshot
46assert 'if !transferred' in screenshot and 'transferred = true' in screenshot
47assert 'name: "Screenshot.png"' in screenshot
48
49# Earlier errors belong to their own message row; definite refusals remain
50# visible until dismissed, without offering another POST.
51compose = (root / 'share/Sources/EquipoShareUI/ShareComposeView.swift').read_text()
52earlier = compose.split('ForEach(sender.earlierMessages', 1)[1].split('Picker(', 1)[0]
53for fragment in ['write.summary', 'Text(verbatim: summary.text).lineLimit(2)',
54 'Text(summary.attachmentCount, format: .number)',
55 'sender.earlierErrors[write.key]', 'sender.dismissEarlierRefusal(write.key)']:
56 assert fragment in earlier, fragment
57assert 'ForEach(sender.earlierErrors' not in compose
58