Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45b09a13d3 | ||
|
|
1632e5fbd4 | ||
|
|
18b63cbd19 | ||
|
|
4371f051aa | ||
|
|
2c09157448 |
@@ -26,25 +26,6 @@ jobs:
|
||||
ruby-version: "3.1.7"
|
||||
bundler-cache: true
|
||||
|
||||
- name: Prepare Runner Keychain
|
||||
env:
|
||||
HOME: /var/lib/act_runner
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p "${HOME}/Library/Keychains"
|
||||
|
||||
login_keychain="${HOME}/Library/Keychains/login.keychain"
|
||||
if [ ! -f "${login_keychain}-db" ]; then
|
||||
security create-keychain -p "" "${login_keychain}"
|
||||
fi
|
||||
|
||||
security unlock-keychain -p "" "${login_keychain}" 2>/dev/null || \
|
||||
security unlock-keychain -p "attractor-ci-keychain-password" "${login_keychain}" 2>/dev/null || true
|
||||
security default-keychain -d user -s "${login_keychain}"
|
||||
security list-keychains -d user -s "${login_keychain}-db"
|
||||
security delete-keychain "${HOME}/Library/Keychains/attractor_ci_keychain" >/dev/null 2>&1 || true
|
||||
rm -f "${HOME}/Library/Keychains/attractor_ci_keychain" "${HOME}/Library/Keychains/attractor_ci_keychain-db"
|
||||
|
||||
- name: Upload to TestFlight
|
||||
env:
|
||||
HOME: /var/lib/act_runner
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.developer.web-browser</key>
|
||||
<true/>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.client</key>
|
||||
|
||||
+10
-20
@@ -19,7 +19,6 @@ class Tab: NSObject, SBRProcessBundleBridgeDelegate
|
||||
|
||||
public var tabInfo: TabInfo {
|
||||
get {
|
||||
updateMetadata()
|
||||
return _tabInfo
|
||||
}
|
||||
}
|
||||
@@ -39,18 +38,14 @@ class Tab: NSObject, SBRProcessBundleBridgeDelegate
|
||||
}
|
||||
public var policyManager: ResourcePolicyManager
|
||||
|
||||
private var _tabInfo: TabInfo = TabInfo()
|
||||
// Persisted snapshot of visible tab metadata; do not recompute on read.
|
||||
var _tabInfo: TabInfo = TabInfo()
|
||||
|
||||
private var loadedWebView: WKWebView? = nil
|
||||
public var title: String? { get { tabInfo.title } }
|
||||
public var url: URL? {
|
||||
get {
|
||||
if let urlString = tabInfo.urlString {
|
||||
return URL(string: urlString)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
if let urlString = tabInfo.urlString { return URL(string: urlString) }
|
||||
return nil
|
||||
}
|
||||
|
||||
public var javaScriptEnabled: Bool = false {
|
||||
@@ -110,6 +105,10 @@ class Tab: NSObject, SBRProcessBundleBridgeDelegate
|
||||
super.init()
|
||||
|
||||
bridge.delegate = self
|
||||
|
||||
// Initialize snapshot metadata
|
||||
_tabInfo.identifier = self.identifier
|
||||
if let url { _tabInfo.urlString = url.absoluteString }
|
||||
}
|
||||
|
||||
deinit {
|
||||
@@ -117,6 +116,8 @@ class Tab: NSObject, SBRProcessBundleBridgeDelegate
|
||||
}
|
||||
|
||||
func beginLoadingURL(_ url: URL) {
|
||||
// Update snapshot immediately so UI keeps URL even if process jettisons.
|
||||
_tabInfo.urlString = url.absoluteString
|
||||
let request = URLRequest(url: url)
|
||||
webView.load(request)
|
||||
}
|
||||
@@ -150,15 +151,4 @@ class Tab: NSObject, SBRProcessBundleBridgeDelegate
|
||||
.assign(to: \.favicon, on: self)
|
||||
}
|
||||
}
|
||||
|
||||
private func updateMetadata() {
|
||||
guard contentProcessTerminated == false else { return }
|
||||
|
||||
_tabInfo = TabInfo(
|
||||
title: loadedWebView?.title,
|
||||
urlString: loadedWebView?.url?.absoluteString ?? self.homeURL?.absoluteString,
|
||||
faviconData: self.favicon?.pngData(),
|
||||
identifier: self.identifier
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,16 +49,28 @@ class TabController
|
||||
tabs.append(tab)
|
||||
}
|
||||
|
||||
// Title observation
|
||||
// Title observation: update snapshot and notify delegate.
|
||||
tab.titleObservation = tab.webView.observe(\.title, changeHandler: { [weak tab, weak self] (webView, change) in
|
||||
if let tab = tab, let self = self, let delegate = self.controllerDelegate {
|
||||
guard let tab = tab else { return }
|
||||
if let newTitle = webView.title, !newTitle.isEmpty {
|
||||
tab._tabInfo.title = newTitle
|
||||
}
|
||||
if let self = self, let delegate = self.controllerDelegate {
|
||||
delegate.tabController(self, didUpdateTitle: webView.title ?? "", forTab: tab)
|
||||
}
|
||||
})
|
||||
|
||||
// URL observation: persist the latest URL in the snapshot.
|
||||
tab.urlObservation = tab.webView.observe(\.url, changeHandler: { [weak tab] (webView, change) in
|
||||
guard let tab = tab else { return }
|
||||
tab._tabInfo.urlString = webView.url?.absoluteString ?? tab._tabInfo.urlString
|
||||
})
|
||||
|
||||
// Favicon Observation
|
||||
tab.faviconObservation = tab.$favicon.receive(on: RunLoop.main).sink { [weak tab, weak self] val in
|
||||
if let tab = tab, let self = self, let delegate = self.controllerDelegate {
|
||||
guard let tab = tab else { return }
|
||||
tab._tabInfo.faviconData = val?.pngData()
|
||||
if let self = self, let delegate = self.controllerDelegate {
|
||||
delegate.tabController(self, didUpdateFavicon: val, forTab: tab)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#import "Hacks.h"
|
||||
|
||||
#import <OSLog/OSLog.h>
|
||||
#import <stdatomic.h>
|
||||
|
||||
#import <WebKit/_WKRemoteObjectInterface.h>
|
||||
#import <WebKit/_WKRemoteObjectRegistry.h>
|
||||
@@ -19,10 +20,28 @@
|
||||
#import <WebKit/WKProcessPoolPrivate.h>
|
||||
#import <WebKit/WKWebViewPrivate.h>
|
||||
#import <WebKit/WKWebViewConfigurationPrivate.h>
|
||||
#import <WebKit/WKContentRuleListStore.h>
|
||||
|
||||
#define WKUserStyleSheet id
|
||||
#define WKUserStyleSheetEncodedClassName "X1dLVXNlclN0eWxlU2hlZXQ="
|
||||
|
||||
NSArray<NSString *> *CommonCDNList(void) {
|
||||
static dispatch_once_t onceToken;
|
||||
static NSArray<NSString *> *commonCDNList = nil;
|
||||
dispatch_once(&onceToken, ^{
|
||||
commonCDNList = @[
|
||||
@"cdn.jsdelivr.net",
|
||||
@"fsdn.net",
|
||||
@"cdnjs.com",
|
||||
@"osscdn.com",
|
||||
@"code.jquery.com",
|
||||
@"bootstrapcdn.com"
|
||||
];
|
||||
});
|
||||
|
||||
return commonCDNList;
|
||||
}
|
||||
|
||||
@interface StyleSheet : NSObject <NSCopying>
|
||||
@property (nonatomic, readonly, copy) NSString *source;
|
||||
@property (nonatomic, readonly, copy) NSURL *baseURL;
|
||||
@@ -31,6 +50,9 @@
|
||||
- (instancetype)initWithSource:(NSString *)source forMainFrameOnly:(BOOL)forMainFrameOnly;
|
||||
@end
|
||||
|
||||
// Note: We no longer proxy http/https via WKURLSchemeHandler; we use
|
||||
// WebKit content blocking rules instead.
|
||||
|
||||
@interface WKUserContentController (Private)
|
||||
- (void)__addUserStyleSheet:(WKUserStyleSheet)userStyleSheet;
|
||||
- (void)__removeUserStyleSheet:(WKUserStyleSheet)userStyleSheet;
|
||||
@@ -68,6 +90,13 @@
|
||||
#define LOG_DEBUG(format, ...) os_log_debug(_log, format, ##__VA_ARGS__)
|
||||
#define LOG_ERROR(format, ...) os_log_error(_log, format, ##__VA_ARGS__)
|
||||
|
||||
static os_log_t _log;
|
||||
|
||||
__attribute__((constructor))
|
||||
static void initialize_log(void) {
|
||||
_log = os_log_create("net.buzzert.attractor.webview", "bridge");
|
||||
}
|
||||
|
||||
@interface NSURLResponse (BridgeAdditions)
|
||||
@property (nonatomic, readonly) BOOL isJavascriptResponse;
|
||||
@end
|
||||
@@ -91,13 +120,11 @@
|
||||
|
||||
@end
|
||||
|
||||
@interface SBRProcessBundleBridge () <WKURLSchemeHandler>
|
||||
@interface SBRProcessBundleBridge ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation SBRProcessBundleBridge {
|
||||
os_log_t _log;
|
||||
|
||||
WKWebView *_webView;
|
||||
WKWebViewConfiguration *_webViewConfiguration;
|
||||
WKProcessPool *_processPool;
|
||||
@@ -107,17 +134,21 @@
|
||||
|
||||
NSArray<WKUserScript *> *_userScripts;
|
||||
|
||||
dispatch_queue_t _dataTasksAccessQueue;
|
||||
NSMutableDictionary<NSURLRequest *, NSURLSessionDataTask *> *_dataTasks;
|
||||
|
||||
// These come from settings.
|
||||
WKUserStyleSheet _customizedUserStylesheet;
|
||||
WKUserScript *_customizedUserScript;
|
||||
|
||||
// Content blocking
|
||||
WKContentRuleList *_activeScriptRuleList;
|
||||
void *_urlKVOContext;
|
||||
}
|
||||
|
||||
- (void)tearDown
|
||||
{
|
||||
// This was used to unregister the delegate with the web process.
|
||||
if (_webView) {
|
||||
@try { [_webView removeObserver:self forKeyPath:@"URL" context:_urlKVOContext]; }
|
||||
@catch (__unused NSException *ex) {}
|
||||
}
|
||||
}
|
||||
|
||||
- (instancetype)initWithWebViewConfiguration:(WKWebViewConfiguration *)webViewConfiguration
|
||||
@@ -125,8 +156,6 @@
|
||||
self = [super init];
|
||||
if (self) {
|
||||
if (!webViewConfiguration) {
|
||||
_log = os_log_create("net.buzzert.attractor.webview", "bridge");
|
||||
|
||||
webViewConfiguration = [[WKWebViewConfiguration alloc] init];
|
||||
|
||||
// Set up process pool
|
||||
@@ -135,12 +164,7 @@
|
||||
|
||||
webViewConfiguration._waitsForPaintAfterViewDidMoveToWindow = NO;
|
||||
webViewConfiguration._applePayEnabled = YES;
|
||||
|
||||
_dataTasks = [NSMutableDictionary dictionary];
|
||||
_dataTasksAccessQueue = dispatch_queue_create("net.buzzert.attractor.dataTasksAccess", DISPATCH_QUEUE_SERIAL);
|
||||
|
||||
[webViewConfiguration setURLSchemeHandler:self forURLScheme:@"http"];
|
||||
[webViewConfiguration setURLSchemeHandler:self forURLScheme:@"https"];
|
||||
// No http/https interception — rely on content blocking rules instead.
|
||||
}
|
||||
|
||||
_webViewConfiguration = webViewConfiguration;
|
||||
@@ -161,6 +185,11 @@
|
||||
}
|
||||
|
||||
_webView = webView;
|
||||
_urlKVOContext = &_urlKVOContext; // unique context pointer
|
||||
[_webView addObserver:self forKeyPath:@"URL" options:(NSKeyValueObservingOptionNew) context:_urlKVOContext];
|
||||
|
||||
// Initialize content blocking rules for current host
|
||||
[self rebuildContentBlockingRulesForCurrentHost];
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -223,97 +252,18 @@
|
||||
});
|
||||
}
|
||||
|
||||
#pragma mark <WKURLSchemeHandler>
|
||||
|
||||
- (void)webView:(WKWebView *)webView startURLSchemeTask:(id<WKURLSchemeTask>)urlSchemeTask
|
||||
{
|
||||
NSString *hostOrigin = [[_webView URL] host];
|
||||
NSURLRequest *request = [urlSchemeTask request];
|
||||
|
||||
LOG_DEBUG("Start URL scheme task: request: %@", request);
|
||||
|
||||
__weak __auto_type welf = self;
|
||||
NSURLSessionDataTask *dataTask = [[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error)
|
||||
{
|
||||
if (!welf) return;
|
||||
__strong __auto_type sself = welf;
|
||||
|
||||
if (error != nil) {
|
||||
[urlSchemeTask didFailWithError:error];
|
||||
} else if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
|
||||
NSURL *requestURL = [request URL];
|
||||
NSString *resourceOrigin = [requestURL host];
|
||||
const __auto_type allowResource = ^{
|
||||
os_log_debug(sself->_log, "Allowing resource: %@", requestURL.lastPathComponent);
|
||||
[urlSchemeTask didReceiveResponse:response];
|
||||
[urlSchemeTask didReceiveData:data];
|
||||
[urlSchemeTask didFinish];
|
||||
|
||||
[self webProcessDidAllowScriptWithOrigin:resourceOrigin];
|
||||
};
|
||||
|
||||
const __auto_type denyResource = ^{
|
||||
os_log_debug(sself->_log, "Blocking resource: %@", requestURL.lastPathComponent);
|
||||
NSHTTPURLResponse *altResponse = [[NSHTTPURLResponse alloc] initWithURL:requestURL
|
||||
MIMEType:@"application/javascript"
|
||||
expectedContentLength:0 textEncodingName:@"utf8"];
|
||||
[urlSchemeTask didReceiveResponse:altResponse];
|
||||
[urlSchemeTask didReceiveData:[NSData data]];
|
||||
[urlSchemeTask didFinish];
|
||||
|
||||
[self webProcessDidBlockScriptWithOrigin:resourceOrigin];
|
||||
};
|
||||
|
||||
// Check MIME type for JavaScript responses.
|
||||
if ([response isJavascriptResponse] && ![sself allowAllScripts]) {
|
||||
dispatch_async(sself->_dataTasksAccessQueue, ^{
|
||||
NSDictionary<NSString *, NSNumber *> *policyTypes = [sself->_policyDataSource scriptPolicyTypeByOrigin];
|
||||
NSNumber *policyType = [policyTypes objectForKey:hostOrigin];
|
||||
|
||||
SBRScriptPolicy *policy = [[SBRScriptPolicy alloc] initWithSecurityOrigin:hostOrigin policyType:[policyType integerValue]];
|
||||
if ([policy allowsExternalJavaScriptResourceOrigin:resourceOrigin]) {
|
||||
allowResource();
|
||||
} else {
|
||||
denyResource();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
allowResource();
|
||||
}
|
||||
} else {
|
||||
[urlSchemeTask didFailWithError:[NSError errorWithDomain:NSURLErrorDomain code:0 userInfo:nil]];
|
||||
}
|
||||
|
||||
[sself->_dataTasks removeObjectForKey:request];
|
||||
}];
|
||||
|
||||
[_dataTasks setObject:dataTask forKey:request];
|
||||
[dataTask resume];
|
||||
}
|
||||
|
||||
- (void)webView:(WKWebView *)webView stopURLSchemeTask:(id<WKURLSchemeTask>)urlSchemeTask
|
||||
{
|
||||
NSURLRequest *request = [urlSchemeTask request];
|
||||
NSURLSessionDataTask *dataTask = [_dataTasks objectForKey:request];
|
||||
if (dataTask) {
|
||||
if ([dataTask state] != NSURLSessionTaskStateCanceling) {
|
||||
[dataTask cancel];
|
||||
}
|
||||
|
||||
[_dataTasks removeObjectForKey:request];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Actions
|
||||
|
||||
- (void)policyDataSourceDidChange
|
||||
{
|
||||
// This was used when we had to signal the process bundle.
|
||||
// Rebuild content blocking rules when policy changes.
|
||||
[self rebuildContentBlockingRulesForCurrentHost];
|
||||
}
|
||||
|
||||
- (void)setAllowAllScripts:(BOOL)allowAllScripts
|
||||
{
|
||||
_allowAllScripts = allowAllScripts;
|
||||
[self rebuildContentBlockingRulesForCurrentHost];
|
||||
}
|
||||
|
||||
- (void)setDarkModeEnabled:(BOOL)darkModeEnabled
|
||||
@@ -360,4 +310,119 @@
|
||||
}];
|
||||
}
|
||||
|
||||
// MARK: - Content Blocking Rules
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context
|
||||
{
|
||||
if (context == _urlKVOContext && [keyPath isEqualToString:@"URL"]) {
|
||||
[self rebuildContentBlockingRulesForCurrentHost];
|
||||
return;
|
||||
}
|
||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||
}
|
||||
|
||||
- (void)rebuildContentBlockingRulesForCurrentHost
|
||||
{
|
||||
NSString *hostOrigin = _webView.URL.host;
|
||||
if (!hostOrigin) {
|
||||
// No page loaded yet; clear any existing rules
|
||||
[self applyContentRuleListJSON:nil withName:nil];
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine policy for this host
|
||||
NSNumber *policyType = nil;
|
||||
@synchronized (_policyDataSource) {
|
||||
NSDictionary<NSString *, NSNumber *> *policyTypes = [_policyDataSource scriptPolicyTypeByOrigin];
|
||||
policyType = [policyTypes objectForKey:hostOrigin] ?: @(0);
|
||||
}
|
||||
|
||||
// Alpha=0 Bravo=1 Charlie=2 Delta=3 Echo=4
|
||||
SBRScriptOriginPolicyType type = [policyType integerValue];
|
||||
if (_allowAllScripts || type >= SBRScriptOriginPolicyTypeEcho) {
|
||||
// Echo or shields down: no blocking
|
||||
[self applyContentRuleListJSON:nil withName:nil];
|
||||
return;
|
||||
}
|
||||
|
||||
// Base trigger applies only to this page's domain
|
||||
NSMutableArray *rules = [NSMutableArray array];
|
||||
NSDictionary *baseScriptTrigger = @{
|
||||
@"resource-type" : @[ @"script" ],
|
||||
@"if-domain" : @[ hostOrigin ]
|
||||
};
|
||||
|
||||
if (type <= SBRScriptOriginPolicyTypeBravo) {
|
||||
// Alpha or Bravo: block all external script subresources (inline JS is controlled via preferences elsewhere)
|
||||
[rules addObject:@{ @"trigger": baseScriptTrigger, @"action": @{ @"type": @"block" } }];
|
||||
} else {
|
||||
// Charlie/Delta: block third-party scripts
|
||||
NSMutableDictionary *trigger = [baseScriptTrigger mutableCopy];
|
||||
trigger[@"load-type"] = @[ @"third-party" ];
|
||||
[rules addObject:@{ @"trigger": trigger, @"action": @{ @"type": @"block" } }];
|
||||
|
||||
if (type >= SBRScriptOriginPolicyTypeDelta) {
|
||||
// Delta: add allowlist for common CDNs
|
||||
for (NSString *cdn in CommonCDNList()) {
|
||||
NSString *escaped = [NSRegularExpression escapedPatternForString:cdn];
|
||||
NSString *pattern = [NSString stringWithFormat:@".*://([^.]*\\.)?%@/", escaped];
|
||||
[rules addObject:@{
|
||||
@"trigger": @{
|
||||
@"url-filter": pattern,
|
||||
@"if-domain": @[ hostOrigin ],
|
||||
@"resource-type": @[ @"script" ]
|
||||
},
|
||||
@"action": @{ @"type": @"ignore-previous-rules" }
|
||||
}];
|
||||
}
|
||||
|
||||
// Heuristic: allow cdn.<anything-with-family-name>/* where family name is the second-level label
|
||||
NSArray<NSString *> *components = [hostOrigin componentsSeparatedByString:@"."];
|
||||
if (components.count > 1) {
|
||||
NSString *family = components[components.count - 2];
|
||||
NSString *escapedFamily = [NSRegularExpression escapedPatternForString:family];
|
||||
NSString *familyPattern = [NSString stringWithFormat:@".*://cdn\\.[^/]*%@[^/]*/", escapedFamily];
|
||||
[rules addObject:@{
|
||||
@"trigger": @{
|
||||
@"url-filter": familyPattern,
|
||||
@"if-domain": @[ hostOrigin ],
|
||||
@"resource-type": @[ @"script" ]
|
||||
},
|
||||
@"action": @{ @"type": @"ignore-previous-rules" }
|
||||
}];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:rules options:0 error:nil];
|
||||
NSString *json = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
||||
NSString *name = [NSString stringWithFormat:@"net.buzzert.attractor.rules.%@", hostOrigin];
|
||||
[self applyContentRuleListJSON:json withName:name];
|
||||
}
|
||||
|
||||
- (void)applyContentRuleListJSON:(NSString *)json withName:(NSString *)name
|
||||
{
|
||||
WKUserContentController *controller = [_webViewConfiguration userContentController];
|
||||
if (_activeScriptRuleList) {
|
||||
[controller removeContentRuleList:_activeScriptRuleList];
|
||||
_activeScriptRuleList = nil;
|
||||
}
|
||||
|
||||
if (!json || !name) { return; }
|
||||
|
||||
WKContentRuleListStore *store = [WKContentRuleListStore defaultStore];
|
||||
[store compileContentRuleListForIdentifier:name encodedContentRuleList:json completionHandler:^(WKContentRuleList * _Nullable ruleList, NSError * _Nullable error) {
|
||||
if (error) {
|
||||
LOG_ERROR("Failed to compile content rule list: %@", error.localizedDescription);
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
self->_activeScriptRuleList = ruleList;
|
||||
[controller addContentRuleList:ruleList];
|
||||
LOG_DEBUG("Applied content rule list: %@", name);
|
||||
});
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -790,7 +790,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = "App/Supporting Files/SBrowser.entitlements";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 5;
|
||||
CURRENT_PROJECT_VERSION = 6;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEVELOPMENT_TEAM = 3SJALV9BQ7;
|
||||
INFOPLIST_FILE = "App/Supporting Files/Info.plist";
|
||||
@@ -801,7 +801,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 4.0;
|
||||
MARKETING_VERSION = 4.1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = net.buzzert.attractor;
|
||||
PRODUCT_NAME = Attractor;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
@@ -825,7 +825,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = "App/Supporting Files/SBrowser.entitlements";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 5;
|
||||
CURRENT_PROJECT_VERSION = 6;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEVELOPMENT_TEAM = 3SJALV9BQ7;
|
||||
INFOPLIST_FILE = "App/Supporting Files/Info.plist";
|
||||
@@ -836,7 +836,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 4.0;
|
||||
MARKETING_VERSION = 4.1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = net.buzzert.attractor;
|
||||
PRODUCT_NAME = Attractor;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
|
||||
+17
-1
@@ -93,6 +93,14 @@ platform :ios do
|
||||
)
|
||||
end
|
||||
|
||||
# CI signs headlessly, so match needs a fresh unlocked keychain to import
|
||||
# into. codesign resolves identities through the user keychain search
|
||||
# list (first match wins; the --keychain flag does not restrict the
|
||||
# lookup), and other projects' keychains on this runner hold the same
|
||||
# identity but are usually locked — so ours must come first. delete_keychain
|
||||
# in the beta lane's ensure removes both the keychain and its search-list
|
||||
# entry, which also keeps our (later locked) copy from shadowing those
|
||||
# other projects.
|
||||
private_lane :prepare_ci_keychain do
|
||||
next unless ci?
|
||||
|
||||
@@ -102,9 +110,15 @@ platform :ios do
|
||||
password: CI_KEYCHAIN_PASSWORD,
|
||||
unlock: true,
|
||||
timeout: 3600,
|
||||
add_to_search_list: true
|
||||
add_to_search_list: false
|
||||
)
|
||||
|
||||
others = sh("security list-keychains -d user", log: false)
|
||||
.scan(/"([^"]+)"/)
|
||||
.flatten
|
||||
.reject { |path| path.include?(CI_KEYCHAIN_NAME) }
|
||||
sh("security list-keychains -d user -s #{([CI_KEYCHAIN_DB_PATH] + others).shelljoin}")
|
||||
|
||||
ENV["MATCH_KEYCHAIN_NAME"] = CI_KEYCHAIN_NAME
|
||||
ENV["MATCH_KEYCHAIN_PASSWORD"] = CI_KEYCHAIN_PASSWORD
|
||||
end
|
||||
@@ -166,5 +180,7 @@ platform :ios do
|
||||
api_key: api_key,
|
||||
skip_waiting_for_build_processing: true
|
||||
)
|
||||
ensure
|
||||
delete_keychain(name: CI_KEYCHAIN_NAME) if ci? && File.file?(CI_KEYCHAIN_DB_PATH)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user