From 6010bb85a5a77998882775dd20000dfb8496b499 Mon Sep 17 00:00:00 2001 From: Zephyrax <103900579+CORBENDALLAS111@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:41:40 +0000 Subject: [PATCH 01/16] Define validated opt-in per-guest privacy policy keys with safe defaults --- LiveContainer/Tweaks/LCGuestPrivacyPolicy.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 LiveContainer/Tweaks/LCGuestPrivacyPolicy.h diff --git a/LiveContainer/Tweaks/LCGuestPrivacyPolicy.h b/LiveContainer/Tweaks/LCGuestPrivacyPolicy.h new file mode 100644 index 000000000..8b36e54fe --- /dev/null +++ b/LiveContainer/Tweaks/LCGuestPrivacyPolicy.h @@ -0,0 +1,15 @@ +#import + +/// Per-guest preferences stored in LCAppInfo.plist. Missing or unknown +/// keys never change the behavior of existing apps. +static inline NSArray *LCGuestPrivacyKeys(void) { + return @[@"camera", @"microphone", @"battery", @"proximity"]; +} + +static inline BOOL LCGuestPrivacyEnabled(NSDictionary *appInfo, NSString *key) { + if (![LCGuestPrivacyKeys() containsObject:key]) return NO; + id policy = appInfo[@"LCGuestPrivacy"]; + if (![policy isKindOfClass:NSDictionary.class]) return NO; + id value = policy[key]; + return [value isKindOfClass:NSNumber.class] && [value boolValue]; +} From 14832cae72fc248f80770d9d42c02c0ff99103a4 Mon Sep 17 00:00:00 2001 From: Zephyrax <103900579+CORBENDALLAS111@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:41:51 +0000 Subject: [PATCH 02/16] Include optional filtering of explicit UIKit screenshot event subscriptions --- LiveContainer/Tweaks/LCGuestPrivacyPolicy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LiveContainer/Tweaks/LCGuestPrivacyPolicy.h b/LiveContainer/Tweaks/LCGuestPrivacyPolicy.h index 8b36e54fe..5f6e41c84 100644 --- a/LiveContainer/Tweaks/LCGuestPrivacyPolicy.h +++ b/LiveContainer/Tweaks/LCGuestPrivacyPolicy.h @@ -3,7 +3,7 @@ /// Per-guest preferences stored in LCAppInfo.plist. Missing or unknown /// keys never change the behavior of existing apps. static inline NSArray *LCGuestPrivacyKeys(void) { - return @[@"camera", @"microphone", @"battery", @"proximity"]; + return @[@"camera", @"microphone", @"battery", @"proximity", @"screenshotEvents"]; } static inline BOOL LCGuestPrivacyEnabled(NSDictionary *appInfo, NSString *key) { From de3325eafc6ddc7b51832ad979aca35eeec05505 Mon Sep 17 00:00:00 2001 From: Zephyrax <103900579+CORBENDALLAS111@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:42:19 +0000 Subject: [PATCH 03/16] Apply opt-in guest API restrictions for capture, microphone, battery, proximity and explicit screenshot events --- LiveContainer/Tweaks/LCGuestPrivacyHooks.h | 196 +++++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 LiveContainer/Tweaks/LCGuestPrivacyHooks.h diff --git a/LiveContainer/Tweaks/LCGuestPrivacyHooks.h b/LiveContainer/Tweaks/LCGuestPrivacyHooks.h new file mode 100644 index 000000000..464015a85 --- /dev/null +++ b/LiveContainer/Tweaks/LCGuestPrivacyHooks.h @@ -0,0 +1,196 @@ +#import "LCGuestPrivacyPolicy.h" +#import +#import +#import + +// These are compatibility/privacy controls in a guest process, not a new +// sandbox. Install before guest code runs; never change TCC, system capture +// protections, privacy indicators, or a host-only SideStore process. +static inline BOOL LCPrivacyReplace(Class cls, SEL sel, IMP replacement) { + if (!cls) { imp_removeBlock(replacement); return NO; } + Method method = class_getInstanceMethod(cls, sel); + if (!method) { imp_removeBlock(replacement); return NO; } + // Do not replace an inherited implementation on an unrelated superclass. + if (!class_addMethod(cls, sel, replacement, method_getTypeEncoding(method))) { + class_replaceMethod(cls, sel, replacement, method_getTypeEncoding(method)); + } + return YES; +} + +static inline BOOL LCPrivacyCaptureTypeBlocked(NSString *type, BOOL camera, BOOL microphone) { + return (camera && [type isEqualToString:AVMediaTypeVideo]) || + (microphone && [type isEqualToString:AVMediaTypeAudio]); +} + +static inline BOOL LCPrivacyCaptureDeviceBlocked(AVCaptureDevice *device, BOOL camera, BOOL microphone) { + return device && ((camera && [device hasMediaType:AVMediaTypeVideo]) || + (microphone && [device hasMediaType:AVMediaTypeAudio])); +} + +static inline NSError *LCPrivacyDeniedError(void) { + return [NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError + userInfo:@{NSLocalizedDescriptionKey: @"Access restricted by LifeContainer+ guest privacy settings."}]; +} + +static inline void LCPrivacyInstallCapture(BOOL camera, BOOL microphone) { + if (!camera && !microphone) return; + Class meta = object_getClass(AVCaptureDevice.class); + SEL status = @selector(authorizationStatusForMediaType:); + AVAuthorizationStatus (*originalStatus)(id, SEL, AVMediaType) = + (void *)class_getMethodImplementation(meta, status); + LCPrivacyReplace(meta, status, imp_implementationWithBlock(^AVAuthorizationStatus(id self, AVMediaType type) { + if (LCPrivacyCaptureTypeBlocked(type, camera, microphone)) return AVAuthorizationStatusDenied; + return originalStatus(self, status, type); + })); + + SEL access = @selector(requestAccessForMediaType:completionHandler:); + void (*originalAccess)(id, SEL, AVMediaType, void (^)(BOOL)) = + (void *)class_getMethodImplementation(meta, access); + LCPrivacyReplace(meta, access, imp_implementationWithBlock(^(id self, AVMediaType type, void (^completion)(BOOL)) { + if (LCPrivacyCaptureTypeBlocked(type, camera, microphone)) { + if (completion) dispatch_async(dispatch_get_main_queue(), ^{ completion(NO); }); + return; + } + originalAccess(self, access, type, completion); + })); + + Class inputMeta = object_getClass(AVCaptureDeviceInput.class); + SEL factory = @selector(deviceInputWithDevice:error:); + AVCaptureDeviceInput *(*originalFactory)(id, SEL, AVCaptureDevice *, NSError **) = + (void *)class_getMethodImplementation(inputMeta, factory); + LCPrivacyReplace(inputMeta, factory, imp_implementationWithBlock(^AVCaptureDeviceInput *(id self, AVCaptureDevice *device, NSError **error) { + if (LCPrivacyCaptureDeviceBlocked(device, camera, microphone)) { + if (error) *error = LCPrivacyDeniedError(); + return nil; + } + return originalFactory(self, factory, device, error); + })); + + Class session = AVCaptureSession.class; + SEL canAdd = @selector(canAddInput:); + BOOL (*originalCanAdd)(id, SEL, AVCaptureInput *) = + (void *)class_getMethodImplementation(session, canAdd); + LCPrivacyReplace(session, canAdd, imp_implementationWithBlock(^BOOL(id self, AVCaptureInput *input) { + if ([input isKindOfClass:AVCaptureDeviceInput.class] && + LCPrivacyCaptureDeviceBlocked(((AVCaptureDeviceInput *)input).device, camera, microphone)) return NO; + return originalCanAdd(self, canAdd, input); + })); + for (NSString *name in @[@"addInput:", @"addInputWithNoConnections:"]) { + SEL selector = NSSelectorFromString(name); + if (!class_getInstanceMethod(session, selector)) continue; + void (*original)(id, SEL, AVCaptureInput *) = + (void *)class_getMethodImplementation(session, selector); + LCPrivacyReplace(session, selector, imp_implementationWithBlock(^(id self, AVCaptureInput *input) { + if ([input isKindOfClass:AVCaptureDeviceInput.class] && + LCPrivacyCaptureDeviceBlocked(((AVCaptureDeviceInput *)input).device, camera, microphone)) return; + original(self, selector, input); + })); + } + + if (camera) { + Class pickerMeta = object_getClass(UIImagePickerController.class); + SEL selector = @selector(isSourceTypeAvailable:); + BOOL (*original)(id, SEL, UIImagePickerControllerSourceType) = + (void *)class_getMethodImplementation(pickerMeta, selector); + LCPrivacyReplace(pickerMeta, selector, imp_implementationWithBlock(^BOOL(id self, UIImagePickerControllerSourceType type) { + return type == UIImagePickerControllerSourceTypeCamera ? NO : original(self, selector, type); + })); + } + + if (microphone) { + // Standard permission APIs and AVAudioRecorder recording methods. + // Do not disable playback or pretend to control arbitrary audio units. + Class audioSession = AVAudioSession.class; + LCPrivacyReplace(audioSession, @selector(recordPermission), + imp_implementationWithBlock(^NSUInteger(id self) { return AVAudioSessionRecordPermissionDenied; })); + LCPrivacyReplace(audioSession, @selector(requestRecordPermission:), + imp_implementationWithBlock(^(id self, void (^completion)(BOOL)) { + if (completion) dispatch_async(dispatch_get_main_queue(), ^{ completion(NO); }); + })); + Class audioApp = NSClassFromString(@"AVAudioApplication"); + if (audioApp) { + LCPrivacyReplace(audioApp, NSSelectorFromString(@"recordPermission"), + imp_implementationWithBlock(^NSUInteger(id self) { return AVAudioSessionRecordPermissionDenied; })); + LCPrivacyReplace(object_getClass(audioApp), NSSelectorFromString(@"requestRecordPermissionWithCompletionHandler:"), + imp_implementationWithBlock(^(id self, void (^completion)(BOOL)) { + if (completion) dispatch_async(dispatch_get_main_queue(), ^{ completion(NO); }); + })); + } + Class recorder = AVAudioRecorder.class; + for (NSString *name in @[@"prepareToRecord", @"record"]) { + LCPrivacyReplace(recorder, NSSelectorFromString(name), imp_implementationWithBlock(^BOOL(id self) { return NO; })); + } + for (NSString *name in @[@"recordAtTime:", @"recordForDuration:"]) { + LCPrivacyReplace(recorder, NSSelectorFromString(name), imp_implementationWithBlock(^BOOL(id self, NSTimeInterval value) { return NO; })); + } + LCPrivacyReplace(recorder, @selector(recordAtTime:forDuration:), + imp_implementationWithBlock(^BOOL(id self, NSTimeInterval time, NSTimeInterval duration) { return NO; })); + } +} + +static inline void LCPrivacyInstallDevice(BOOL battery, BOOL proximity) { + UIDevice *device = UIDevice.currentDevice; + Class cls = device.class; + if (battery) { + device.batteryMonitoringEnabled = NO; + LCPrivacyReplace(cls, @selector(setBatteryMonitoringEnabled:), + imp_implementationWithBlock(^(id self, BOOL value) {})); + LCPrivacyReplace(cls, @selector(isBatteryMonitoringEnabled), + imp_implementationWithBlock(^BOOL(id self) { return NO; })); + LCPrivacyReplace(cls, @selector(batteryLevel), + imp_implementationWithBlock(^float(id self) { return -1.0f; })); + LCPrivacyReplace(cls, @selector(batteryState), + imp_implementationWithBlock(^UIDeviceBatteryState(id self) { return UIDeviceBatteryStateUnknown; })); + } + if (proximity) { + device.proximityMonitoringEnabled = NO; + LCPrivacyReplace(cls, @selector(setProximityMonitoringEnabled:), + imp_implementationWithBlock(^(id self, BOOL value) {})); + LCPrivacyReplace(cls, @selector(isProximityMonitoringEnabled), + imp_implementationWithBlock(^BOOL(id self) { return NO; })); + LCPrivacyReplace(cls, @selector(proximityState), + imp_implementationWithBlock(^BOOL(id self) { return NO; })); + } +} + +static inline BOOL LCPrivacyEventBlocked(NSString *name, BOOL screenshots, BOOL battery, BOOL proximity) { + // Explicitly named UIKit subscriptions only. Do not change screen-capture + // state, secure content, capture indicators, or OS screenshot behavior. + return (screenshots && [name isEqualToString:UIApplicationUserDidTakeScreenshotNotification]) || + (battery && ([name isEqualToString:UIDeviceBatteryLevelDidChangeNotification] || + [name isEqualToString:UIDeviceBatteryStateDidChangeNotification])) || + (proximity && [name isEqualToString:UIDeviceProximityStateDidChangeNotification]); +} + +static inline void LCPrivacyInstallEvents(BOOL screenshots, BOOL battery, BOOL proximity) { + if (!screenshots && !battery && !proximity) return; + Class cls = NSNotificationCenter.defaultCenter.class; + SEL add = @selector(addObserver:selector:name:object:); + void (*originalAdd)(id, SEL, id, SEL, NSString *, id) = + (void *)class_getMethodImplementation(cls, add); + LCPrivacyReplace(cls, add, imp_implementationWithBlock(^(id self, id observer, SEL selector, NSString *name, id object) { + if (LCPrivacyEventBlocked(name, screenshots, battery, proximity)) return; + originalAdd(self, add, observer, selector, name, object); + })); + SEL addBlock = @selector(addObserverForName:object:queue:usingBlock:); + id (*originalBlock)(id, SEL, NSString *, id, NSOperationQueue *, void (^)(NSNotification *)) = + (void *)class_getMethodImplementation(cls, addBlock); + LCPrivacyReplace(cls, addBlock, imp_implementationWithBlock(^id(id self, NSString *name, id object, NSOperationQueue *queue, void (^handler)(NSNotification *)) { + if (LCPrivacyEventBlocked(name, screenshots, battery, proximity)) { + // Keep a valid, removable observer token; do not deliver the event. + return originalBlock(self, addBlock, name, object, queue, ^(NSNotification *note) {}); + } + return originalBlock(self, addBlock, name, object, queue, handler); + })); +} + +static inline void LCGuestPrivacyHooksInit(NSDictionary *info) { + BOOL camera = LCGuestPrivacyEnabled(info, @"camera"); + BOOL microphone = LCGuestPrivacyEnabled(info, @"microphone"); + BOOL battery = LCGuestPrivacyEnabled(info, @"battery"); + BOOL proximity = LCGuestPrivacyEnabled(info, @"proximity"); + BOOL screenshots = LCGuestPrivacyEnabled(info, @"screenshotEvents"); + LCPrivacyInstallCapture(camera, microphone); + if (battery || proximity) LCPrivacyInstallDevice(battery, proximity); + LCPrivacyInstallEvents(screenshots, battery, proximity); +} From 27efcfa1aad045d46066545ca45e1825db025d2b Mon Sep 17 00:00:00 2001 From: Zephyrax <103900579+CORBENDALLAS111@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:42:28 +0000 Subject: [PATCH 04/16] Apply guest privacy preferences before guest code executes, including extension bootstrap; exclude embedded SideStore --- LiveContainer/LCBootstrap.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/LiveContainer/LCBootstrap.m b/LiveContainer/LCBootstrap.m index 4cf3b816b..82704f22d 100644 --- a/LiveContainer/LCBootstrap.m +++ b/LiveContainer/LCBootstrap.m @@ -17,6 +17,7 @@ #include #include "../litehook/src/litehook.h" #import "Tweaks/Tweaks.h" +#import "Tweaks/LCGuestPrivacyHooks.h" #include extern char **environ; @@ -293,6 +294,7 @@ void overwriteExecPath(const char *newExecPath) { NUDGuestHooksInit(); NSFMGuestExtensionHooksInit(request[@"parentContainerPath"]); NSURLSCGuestHooksInit(); + LCGuestPrivacyHooksInit(guestAppInfo); GuestExtensionHooksInit(); if (!LCSharedUtils.certificatePassword && !isSideStore) { @@ -603,6 +605,7 @@ void overwriteExecPath(const char *newExecPath) { SecItemGuestHooksInit(); NSFMGuestHooksInit(); initDead10ccFix(); + LCGuestPrivacyHooksInit(guestAppInfo); } if(isLiveProcess) { NSURLSCGuestHooksInit(); From 6044eb218002dc6cbf89f4c738517b7f912e89af Mon Sep 17 00:00:00 2001 From: Zephyrax <103900579+CORBENDALLAS111@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:42:48 +0000 Subject: [PATCH 05/16] Expose persisted per-guest privacy preferences to SwiftUI --- LiveContainerSwiftUI/Models/LCAppInfo.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/LiveContainerSwiftUI/Models/LCAppInfo.h b/LiveContainerSwiftUI/Models/LCAppInfo.h index b5219cbf3..5083fff77 100644 --- a/LiveContainerSwiftUI/Models/LCAppInfo.h +++ b/LiveContainerSwiftUI/Models/LCAppInfo.h @@ -73,5 +73,8 @@ typedef NS_ENUM(NSInteger, MultitaskSpecified){ - (UIImage *)generateLiveContainerWrappedIconWithStyle:(GeneratedIconStyle)style; - (NSDictionary *)generateWebClipConfigWithContainerId:(NSString*)containerId iconStyle:(GeneratedIconStyle)style; - (void)save; +- (BOOL)privacyRestrictionEnabled:(NSString *)key NS_SWIFT_NAME(privacyRestrictionEnabled(_:)); +- (BOOL)setPrivacyRestriction:(NSString *)key enabled:(BOOL)enabled NS_SWIFT_NAME(setPrivacyRestriction(_:enabled:)); + - (void)patchExecAndSignIfNeedWithCompletionHandler:(void(^)(bool success, NSString* errorInfo))completetionHandler progressHandler:(void(^)(NSProgress* progress))progressHandler forceSign:(BOOL)forceSign; @end From 6b8ddf1b2399d5d2e61ff4e6d1e2eaf4f082ad13 Mon Sep 17 00:00:00 2001 From: Zephyrax <103900579+CORBENDALLAS111@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:42:53 +0000 Subject: [PATCH 06/16] Save guest restrictions atomically with rollback on failed write --- LiveContainerSwiftUI/Models/LCAppInfo.m | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/LiveContainerSwiftUI/Models/LCAppInfo.m b/LiveContainerSwiftUI/Models/LCAppInfo.m index e0f438e4f..1c6c4814c 100644 --- a/LiveContainerSwiftUI/Models/LCAppInfo.m +++ b/LiveContainerSwiftUI/Models/LCAppInfo.m @@ -6,6 +6,7 @@ #import "LCAppInfo.h" #import "LCUtils.h" #import "../../LiveContainer/LCSharedUtils.h" +#import "../../LiveContainer/Tweaks/LCGuestPrivacyPolicy.h" @implementation LCAppInfo @@ -286,6 +287,30 @@ - (NSDictionary *)generateWebClipConfigWithContainerId:(NSString*)containerId ic }; } +- (BOOL)privacyRestrictionEnabled:(NSString *)key { + return LCGuestPrivacyEnabled(_info, key); +} + +- (BOOL)setPrivacyRestriction:(NSString *)key enabled:(BOOL)enabled { + if (![LCGuestPrivacyKeys() containsObject:key] || _autoSaveDisabled || !_bundlePath.length) return NO; + id old = _info[@"LCGuestPrivacy"]; + NSMutableDictionary *policy = [old isKindOfClass:NSDictionary.class] ? [old mutableCopy] : [NSMutableDictionary new]; + if (enabled) policy[key] = @YES; + else [policy removeObjectForKey:key]; + if (policy.count) _info[@"LCGuestPrivacy"] = policy; + else [_info removeObjectForKey:@"LCGuestPrivacy"]; + NSError *error = nil; + NSData *data = [NSPropertyListSerialization dataWithPropertyList:_info + format:NSPropertyListBinaryFormat_v1_0 options:0 error:&error]; + if (!data || ![data writeToFile:[_bundlePath stringByAppendingPathComponent:@"LCAppInfo.plist"] + options:NSDataWritingAtomic error:&error]) { + if (old) _info[@"LCGuestPrivacy"] = old; + else [_info removeObjectForKey:@"LCGuestPrivacy"]; + return NO; + } + return YES; +} + - (void)save { if(!_autoSaveDisabled) { [_info writeBinToFile:[NSString stringWithFormat:@"%@/LCAppInfo.plist", _bundlePath] atomically:YES]; From c2d138cd096161a3a0dc3b3aa1ca7b4deb32f53e Mon Sep 17 00:00:00 2001 From: Zephyrax <103900579+CORBENDALLAS111@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:43:15 +0000 Subject: [PATCH 07/16] Add native per-app Privacy & Permissions Form with five persisted guest restrictions and honest coverage notes --- .../AppSettings/LCAppPrivacyView.swift | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 LiveContainerSwiftUI/Views/AppList/AppSettings/LCAppPrivacyView.swift diff --git a/LiveContainerSwiftUI/Views/AppList/AppSettings/LCAppPrivacyView.swift b/LiveContainerSwiftUI/Views/AppList/AppSettings/LCAppPrivacyView.swift new file mode 100644 index 000000000..c5b03e580 --- /dev/null +++ b/LiveContainerSwiftUI/Views/AppList/AppSettings/LCAppPrivacyView.swift @@ -0,0 +1,130 @@ +import SwiftUI +import UIKit + +/// These switches request guest-level API restrictions, not system TCC +/// permissions. The guest must be fully stopped and launched again. +struct LCAppPrivacyView: View { + let appInfo: LCAppInfo + @ObservedObject var model: LCAppModel + @State private var enabled: Set = [] + @State private var saveFailed = false + @State private var confirmReset = false + + private struct Restriction: Identifiable { + let id: String + let icon: String + var title: String { ("lcos.privacy." + id).loc } + var detail: String { ("lcos.privacy." + id + ".detail").loc } + } + + private let media = [ + Restriction(id: "camera", icon: "camera"), + Restriction(id: "microphone", icon: "mic") + ] + private let device = [ + Restriction(id: "battery", icon: "battery.75percent"), + Restriction(id: "proximity", icon: "sensor") + ] + private let events = [ + Restriction(id: "screenshotEvents", icon: "camera.viewfinder") + ] + + private var all: [Restriction] { media + device + events } + + var body: some View { + Form { + Section { + Label("lcos.privacy.explanation".loc, systemImage: "info.circle") + .font(.subheadline) + .foregroundStyle(.secondary) + if model.isAppRunning { + Label("lcos.privacy.running".loc, systemImage: "arrow.clockwise") + .font(.subheadline) + } + } + Section { + ForEach(media) { restrictionRow($0) } + } header: { + Text("lcos.privacy.media".loc) + } + Section { + ForEach(device) { restrictionRow($0) } + } header: { + Text("lcos.privacy.device".loc) + } + Section { + ForEach(events) { restrictionRow($0) } + } header: { + Text("lcos.privacy.events".loc) + } + Section { + Button { + if let url = URL(string: UIApplication.openSettingsURLString) { + UIApplication.shared.open(url) + } + } label: { + Label("lcos.access.systemSettings".loc, systemImage: "gear") + } + } footer: { + Text("lcos.privacy.systemHelp".loc) + } + Section { + Button("lcos.privacy.reset".loc, role: .destructive) { + confirmReset = true + } + .disabled(enabled.isEmpty) + } + } + .navigationTitle("lcos.privacy.title".loc) + .navigationBarTitleDisplayMode(.inline) + .onAppear(perform: reload) + .alert("lc.common.error".loc, isPresented: $saveFailed) { + Button("lc.common.ok".loc, role: .cancel) {} + } message: { + Text("lcos.privacy.saveFailed".loc) + } + .confirmationDialog("lcos.privacy.reset".loc, isPresented: $confirmReset, titleVisibility: .visible) { + Button("lcos.privacy.reset".loc, role: .destructive) { + for restriction in all where enabled.contains(restriction.id) { + if !appInfo.setPrivacyRestriction(restriction.id, enabled: false) { + saveFailed = true + } + } + reload() + } + Button("lc.common.cancel".loc, role: .cancel) {} + } + } + + private func reload() { + enabled = Set(all.filter { appInfo.privacyRestrictionEnabled($0.id) }.map(\.id)) + } + + private func restrictionRow(_ restriction: Restriction) -> some View { + Toggle(isOn: Binding( + get: { enabled.contains(restriction.id) }, + set: { value in + if appInfo.setPrivacyRestriction(restriction.id, enabled: value) { + if value { enabled.insert(restriction.id) } + else { enabled.remove(restriction.id) } + } else { + saveFailed = true + reload() + } + } + )) { + Label { + VStack(alignment: .leading, spacing: 4) { + Text(restriction.title) + Text(restriction.detail) + .font(.footnote) + .foregroundStyle(.secondary) + .fixedSize(horizontal: false, vertical: true) + } + } icon: { + Image(systemName: restriction.icon) + } + } + .accessibilityIdentifier("lifecontainer.privacy." + restriction.id) + } +} From 44b40b2b9dcf854b3003f81a1515122ffa150c54 Mon Sep 17 00:00:00 2001 From: Zephyrax <103900579+CORBENDALLAS111@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:43:26 +0000 Subject: [PATCH 08/16] Link guest privacy settings, remove nested list scrolling and allow long bundle identifiers to wrap on compact iPhones --- .../AppSettings/LCAppSettingsView.swift | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/LiveContainerSwiftUI/Views/AppList/AppSettings/LCAppSettingsView.swift b/LiveContainerSwiftUI/Views/AppList/AppSettings/LCAppSettingsView.swift index 494d1ea57..da3553679 100644 --- a/LiveContainerSwiftUI/Views/AppList/AppSettings/LCAppSettingsView.swift +++ b/LiveContainerSwiftUI/Views/AppList/AppSettings/LCAppSettingsView.swift @@ -49,12 +49,12 @@ struct LCAppSettingsView: View { var body: some View { Form { Section { - HStack { + VStack(alignment: .leading, spacing: 6) { Text("lc.appSettings.bundleId".loc) - Spacer() Text(appInfo.relativeBundlePath) - .foregroundColor(.gray) - .multilineTextAlignment(.trailing) + .font(.subheadline) + .foregroundStyle(.secondary) + .fixedSize(horizontal: false, vertical: true) .textSelection(.enabled) } HStack { @@ -110,13 +110,11 @@ struct LCAppSettingsView: View { } Section { - List{ - ForEach(model.uiContainers.indices, id:\.self) { i in - NavigationLink { - LCContainerView(container: model.uiContainers[i], uiDefaultDataFolder: $model.uiDefaultDataFolder, delegate: self) - } label: { - Text(model.uiContainers[i].name) - } + ForEach(model.uiContainers.indices, id: \.self) { i in + NavigationLink { + LCContainerView(container: model.uiContainers[i], uiDefaultDataFolder: $model.uiDefaultDataFolder, delegate: self) + } label: { + Text(model.uiContainers[i].name) } } if(model.uiContainers.count < SharedModel.keychainAccessGroupCount) { @@ -341,6 +339,16 @@ struct LCAppSettingsView: View { } footer: { Text("lcos.files.openInPlaceDescription".loc) } + Section { + NavigationLink { + LCAppPrivacyView(appInfo: appInfo, model: model) + } label: { + Label("lcos.privacy.title".loc, systemImage: "hand.raised") + } + } footer: { + Text("lcos.privacy.summary".loc) + } + Section { Button("lcos.access.systemSettings".loc) { if let url = URL(string: UIApplication.openSettingsURLString) { UIApplication.shared.open(url) } From b94baf8558dca9d7a7f527767794454249355fcc Mon Sep 17 00:00:00 2001 From: Zephyrax <103900579+CORBENDALLAS111@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:43:45 +0000 Subject: [PATCH 09/16] Localize guest privacy restrictions and clearly describe their API-level limits --- Resources/Localizable.xcstrings | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Resources/Localizable.xcstrings b/Resources/Localizable.xcstrings index e4f13b8b1..6ec88c39a 100644 --- a/Resources/Localizable.xcstrings +++ b/Resources/Localizable.xcstrings @@ -1,6 +1,26 @@ { "sourceLanguage" : "en", "strings" : { + "lcos.privacy.title" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Privacy & Permissions"}},"ru":{"stringUnit":{"state":"translated","value":"Конфиденциальность и разрешения"}}}}, + "lcos.privacy.summary" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Limit selected APIs for this guest app."}},"ru":{"stringUnit":{"state":"translated","value":"Ограничение отдельных API этого приложения."}}}}, + "lcos.privacy.explanation" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Opt-in restrictions on supported guest APIs. Restart the guest to apply changes. These are not separate iOS permissions and cannot guarantee isolation from every API."}},"ru":{"stringUnit":{"state":"translated","value":"Ограничения поддерживаемых API. Полностью перезапустите приложение для применения. Это не отдельные разрешения iOS и не гарантированная изоляция всех API."}}}}, + "lcos.privacy.running" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Stop this guest completely and relaunch to apply new settings."}},"ru":{"stringUnit":{"state":"translated","value":"Полностью завершите гостевое приложение и запустите его снова."}}}}, + "lcos.privacy.media" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Camera & microphone"}},"ru":{"stringUnit":{"state":"translated","value":"Камера и микрофон"}}}}, + "lcos.privacy.device" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Device signals"}},"ru":{"stringUnit":{"state":"translated","value":"Сигналы устройства"}}}}, + "lcos.privacy.events" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Activity notifications"}},"ru":{"stringUnit":{"state":"translated","value":"Уведомления о действиях"}}}}, + "lcos.privacy.camera" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Restrict camera"}},"ru":{"stringUnit":{"state":"translated","value":"Ограничить камеру"}}}}, + "lcos.privacy.camera.detail" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Deny common AVFoundation video authorization and capture inputs; other capture paths are not guaranteed."}},"ru":{"stringUnit":{"state":"translated","value":"Запрет стандартных запросов доступа AVFoundation и добавления видеовходов. Другие способы захвата не гарантированно блокируются."}}}}, + "lcos.privacy.microphone" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Restrict microphone"}},"ru":{"stringUnit":{"state":"translated","value":"Ограничить микрофон"}}}}, + "lcos.privacy.microphone.detail" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Deny common recording permission requests, capture inputs and AVAudioRecorder. Does not block all audio engines."}},"ru":{"stringUnit":{"state":"translated","value":"Запрет стандартных запросов записи, аудиовходов и AVAudioRecorder. Не блокирует все аудиодвижки."}}}}, + "lcos.privacy.battery" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Restrict battery information"}},"ru":{"stringUnit":{"state":"translated","value":"Ограничить сведения о батарее"}}}}, + "lcos.privacy.battery.detail" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Disable UIDevice battery monitoring and return unavailable status."}},"ru":{"stringUnit":{"state":"translated","value":"Отключение мониторинга батареи через UIDevice; состояние недоступно."}}}}, + "lcos.privacy.proximity" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Restrict proximity sensor"}},"ru":{"stringUnit":{"state":"translated","value":"Ограничить датчик приближения"}}}}, + "lcos.privacy.proximity.detail" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Disable standard UIDevice proximity monitoring."}},"ru":{"stringUnit":{"state":"translated","value":"Отключение стандартного мониторинга приближения через UIDevice."}}}}, + "lcos.privacy.screenshotEvents" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Restrict screenshot notifications"}},"ru":{"stringUnit":{"state":"translated","value":"Ограничить события скриншотов"}}}}, + "lcos.privacy.screenshotEvents.detail" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Filter explicit UIKit screenshot notification subscriptions. Does not change system capture protection, screen recording or other detection paths."}},"ru":{"stringUnit":{"state":"translated","value":"Фильтрация явных подписок на уведомление UIKit о скриншоте. Не меняет системную защиту захвата, запись экрана или другие способы обнаружения."}}}}, + "lcos.privacy.systemHelp" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Location, photos, contacts, Bluetooth, local network and tracking permissions remain controlled by iOS for the LC+ host. Guest restrictions are not a security boundary."}},"ru":{"stringUnit":{"state":"translated","value":"Геолокация, фото, контакты, Bluetooth, локальная сеть и отслеживание контролируются iOS для LC+. Ограничения гостя не являются границей безопасности."}}}}, + "lcos.privacy.reset" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Reset restrictions"}},"ru":{"stringUnit":{"state":"translated","value":"Сбросить ограничения"}}}}, + "lcos.privacy.saveFailed" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Could not save the guest privacy setting. Check app storage and try again."}},"ru":{"stringUnit":{"state":"translated","value":"Не удалось сохранить настройку. Проверьте доступ к хранилищу приложения."}}}}, "lcos.memory.hostStatus" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"LC+ Extra Memory"}},"ru":{"stringUnit":{"state":"translated","value":"Extra Memory для LC+"}}}}, "lcos.memory.hostStatusHelp" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"This status reads the entitlement in the installed LC+ process, not the IPA or Developer Portal. Signing LC+ with an Apple-granted profile and reinstalling it are required."}},"ru":{"stringUnit":{"state":"translated","value":"Статус проверяет право запущенного процесса LC+, а не IPA или Apple Developer Portal. Нужно подписать LC+ профилем с разрешением Apple и переустановить."}}}}, "lcos.memory.title" : {"extractionState":"manual","localizations":{"en":{"stringUnit":{"state":"translated","value":"Extra Memory · LC+"}},"ru":{"stringUnit":{"state":"translated","value":"Extra Memory · LC+"}}}}, From ab4e39919c024ab026f3f6c7c872c3967098b696 Mon Sep 17 00:00:00 2001 From: Zephyrax <103900579+CORBENDALLAS111@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:44:06 +0000 Subject: [PATCH 10/16] Remove iPad device-wide Apps toolbar overlay that collides with pushed settings and compact windows --- LiveContainerSwiftUI/Views/LCTabView.swift | 91 ---------------------- 1 file changed, 91 deletions(-) diff --git a/LiveContainerSwiftUI/Views/LCTabView.swift b/LiveContainerSwiftUI/Views/LCTabView.swift index 571a3a5c9..9d1aab491 100644 --- a/LiveContainerSwiftUI/Views/LCTabView.swift +++ b/LiveContainerSwiftUI/Views/LCTabView.swift @@ -22,9 +22,6 @@ extension Notification.Name { } struct LCTabView: View { - @AppStorage("LCOSHomeScreenEnabled", store: LCUtils.appGroupUserDefault) private var homeScreenEnabled = true - @State private var homeScreenEditing = false - @Environment(\.colorScheme) private var colorScheme @State var errorShow = false @State var crashReportShow = false @State var errorInfo = "" @@ -41,16 +38,6 @@ struct LCTabView: View { tabContent // Do not force an edge blur on every nested Form/List or the tab bar. // Let UIKit/SwiftUI render each navigation and tab bar natively. - .overlay(alignment: .topTrailing) { floatingHomeActions } - .onReceive(NotificationCenter.default.publisher(for: .lcosTopBarEditingChanged)) { note in - homeScreenEditing = note.object as? Bool ?? false - } - .onChange(of: sharedModel.selectedTab) { tab in - if tab != .apps { homeScreenEditing = false } - } - .onChange(of: homeScreenEnabled) { enabled in - if !enabled { homeScreenEditing = false } - } .downloadAlert(helper: downloadHelper) .environmentObject(downloadHelper) .alert("lc.common.error".loc, isPresented: $errorShow){ @@ -151,84 +138,6 @@ struct LCTabView: View { } } - // On iPadOS 26+ the system draws the centered tab strip at the top. - // Overlay these actions in the same top safe-area row, keeping all existing - // install, SideStore and desktop menu behavior in their owning views. - @ViewBuilder - private var floatingHomeActions: some View { - if #available(iOS 26.0, *) { - if UIDevice.current.userInterfaceIdiom == .pad && - homeScreenEnabled && sharedModel.selectedTab == .apps { - LCGlassGroup { - HStack(spacing: 12) { - if homeScreenEditing { - Button { - NotificationCenter.default.post(name: .lcosTopBarDone, object: nil) - } label: { - Text("lcos.home.done".loc) - .font(.body.weight(.semibold)) - .padding(.horizontal, 16) - .frame(height: 44) - .lcGlass(in: Capsule(), interactive: true) - }.accessibilityIdentifier("lifecontainer.editDone") - } else { - if sharedModel.multiLCStatus != 2 { - Menu { - Button("lc.appList.installFromIpa".loc) { - NotificationCenter.default.post(name: .lcosTopBarImportIPA, object: nil) - } - Button("lc.appList.installFromUrl".loc) { - NotificationCenter.default.post(name: .lcosTopBarImportURL, object: nil) - } - } label: { topActionIcon("plus") } - .lcFixedInstallOrder() - .accessibilityLabel("lc.appList.installFromIpa".loc) - } - if UserDefaults.sideStoreExist() { - Button { - NotificationCenter.default.post(name: .lcosTopBarOpenSideStore, object: nil) - } label: { - IconImageView(icon: BuiltInSideStoreAppInfo.shared.iconIsDarkIcon(colorScheme == .dark)) - .frame(width: 22, height: 22) - .frame(width: 44, height: 44) - .lcGlass(in: Circle(), interactive: true) - }.accessibilityLabel("SideStore") - } - Menu { - Toggle("lcos.home.enabled".loc, isOn: $homeScreenEnabled) - Button("lcos.home.edit".loc) { - NotificationCenter.default.post(name: .lcosTopBarEdit, object: nil) - } - Button("lcos.home.list".loc) { homeScreenEnabled = false } - Button("lc.appList.openLink".loc) { - NotificationCenter.default.post(name: .lcosTopBarOpenLink, object: nil) - } - if UserDefaults.sideStoreExist() { - Button("SideStore") { - NotificationCenter.default.post(name: .lcosTopBarOpenSideStore, object: nil) - } - } - Button("lcos.home.reset".loc) { - NotificationCenter.default.post(name: .lcosTopBarReset, object: nil) - } - } label: { topActionIcon("ellipsis") } - .accessibilityLabel("lcos.home.options".loc) - } - }.buttonStyle(.plain) - } - .padding(.trailing, 20) - .padding(.top, 6) - } - } - } - - private func topActionIcon(_ symbol: String) -> some View { - Image(systemName: symbol) - .font(.system(size: 18, weight: .medium)) - .frame(width: 44, height: 44) - .lcGlass(in: Circle(), interactive: true) - } - func dispatchURL(url: URL) { repeat { if url.isFileURL { From 04e074663852cd17f78155396dc8acd12a3c4475 Mon Sep 17 00:00:00 2001 From: Zephyrax <103900579+CORBENDALLAS111@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:44:19 +0000 Subject: [PATCH 11/16] Move all iPad/iPhone app actions into the home safe area and clamp scaled icons to available cell width --- .../HomeScreen/LCHomeScreenView.swift | 46 +++++++------------ 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/LiveContainerSwiftUI/HomeScreen/LCHomeScreenView.swift b/LiveContainerSwiftUI/HomeScreen/LCHomeScreenView.swift index 6a12001dc..f98f46da6 100644 --- a/LiveContainerSwiftUI/HomeScreen/LCHomeScreenView.swift +++ b/LiveContainerSwiftUI/HomeScreen/LCHomeScreenView.swift @@ -181,8 +181,9 @@ struct LCHomeScreenView: View { /// addition to simpler ownership, this avoids SwiftUI's simulator /// compiler timeout when type-checking an oversized GeometryReader body. private func homeCanvas(_ geometry: GeometryProxy) -> some View { - let reservedHeight: CGFloat = usesTopTabActions - ? (searching ? 154 : 110) : (searching ? 206 : 162) + // Window height is not used to paginate the root grid. + // Folder layout keeps its own available-height calculation. + let reservedHeight: CGFloat = searching ? 206 : 162 let metrics = LCHomeMetrics( width: geometry.size.width, height: max(0, geometry.size.height - reservedHeight), @@ -194,7 +195,11 @@ struct LCHomeScreenView: View { accessibility: sizeCategory.isAccessibilityCategory, isLandscape: geometry.size.width > geometry.size.height ) - let side = CGFloat(metrics.iconSide) * CGFloat(min(1.1, max(0.85, iconScale))) + let cellWidth = max(1, (geometry.size.width - 2 * CGFloat(metrics.horizontalInset) + - CGFloat(max(0, metrics.columns - 1)) * 10) + / CGFloat(metrics.columns)) + let side = min(max(24, cellWidth - 4), + CGFloat(metrics.iconSide) * CGFloat(min(1.1, max(0.85, iconScale)))) let ids = query.isEmpty ? layout.rootItems(available) : layout.ordered(available).filter { id in @@ -248,20 +253,12 @@ struct LCHomeScreenView: View { @ViewBuilder private func homeChrome(_ content: Content) -> some View { if #available(iOS 26.0, *) { - if usesTopTabActions { - // iPad's tab strip already owns the top action row. - content - .safeAreaBar(edge: .top, spacing: 0) { pinnedHeader } - .safeAreaBar(edge: .bottom, spacing: 0) { pinnedSearch } - } else { - // Keep the title above the effect. Only the button row is - // inside the native top bar, so its soft transition begins - // at the level of the controls instead of behind the title. - content - .safeAreaBar(edge: .top, spacing: 0) { pinnedControls } - .safeAreaInset(edge: .top, spacing: 0) { pinnedTitle } - .safeAreaBar(edge: .bottom, spacing: 0) { pinnedSearch } - } + // This screen, not a window-wide overlay, owns all app actions. + // Compact iPad windows and iPhones get the same safe-area behavior. + content + .safeAreaBar(edge: .top, spacing: 0) { pinnedControls } + .safeAreaInset(edge: .top, spacing: 0) { pinnedTitle } + .safeAreaBar(edge: .bottom, spacing: 0) { pinnedSearch } } else { content .safeAreaInset(edge: .top, spacing: 0) { pinnedHeader } @@ -309,13 +306,6 @@ struct LCHomeScreenView: View { } } - private var usesTopTabActions: Bool { - if #available(iOS 26.0, *) { - return UIDevice.current.userInterfaceIdiom == .pad - } - return false - } - /// Outside the glass boundary: keeps the iPhone page title crisp even /// when a long grid scrolls underneath the action row. private var pinnedTitle: some View { @@ -326,7 +316,7 @@ struct LCHomeScreenView: View { .padding(.horizontal, 20) .padding(.top, 12) .padding(.bottom, 8) - .background(scheme == .dark ? Color.black : Color.white) + .background(Color(uiColor: .systemBackground)) } /// The pinned top actions, and only the actions, receive the iOS 26 @@ -340,7 +330,7 @@ struct LCHomeScreenView: View { .accessibilityIdentifier("lifecontainer.editDone") .font(.body.weight(.semibold)) .padding(.horizontal, 16) - .frame(height: 44) + .frame(minHeight: 44) .lcGlass(in: Capsule(), interactive: true) } else { if shared.multiLCStatus != 2 { @@ -381,9 +371,7 @@ struct LCHomeScreenView: View { private var header: some View { VStack(spacing: 0) { pinnedTitle - if !usesTopTabActions { - pinnedActionBar - } + pinnedActionBar } } private func chromeIcon(_ name: String) -> some View { From dea6d7ce57d7eb105eb2b27853cf6166d36dc489 Mon Sep 17 00:00:00 2001 From: Zephyrax <103900579+CORBENDALLAS111@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:44:40 +0000 Subject: [PATCH 12/16] Adapt grid columns to actual compact window and accessibility text width --- .../HomeScreen/Core/LCHomeMetrics.swift | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/LiveContainerSwiftUI/HomeScreen/Core/LCHomeMetrics.swift b/LiveContainerSwiftUI/HomeScreen/Core/LCHomeMetrics.swift index 4e6254d93..2b2212f2a 100644 --- a/LiveContainerSwiftUI/HomeScreen/Core/LCHomeMetrics.swift +++ b/LiveContainerSwiftUI/HomeScreen/Core/LCHomeMetrics.swift @@ -18,16 +18,18 @@ struct LCHomeMetrics: Equatable { init(width: Double, height: Double, tablet: Bool, mini: Bool, accessibility: Bool = false, isLandscape: Bool? = nil) { let landscape = isLandscape ?? (width > height) - if tablet { - columns = width < 600 ? 4 : (landscape ? 6 : 5) - rows = mini && !landscape ? 6 : 5 - } else { - columns = landscape ? 6 : 4 - rows = landscape ? 3 : 6 - } - horizontalInset = tablet ? max(20, min(64, width * 0.055)) : 20 - let cellWidth = max(1, (width - 2 * horizontalInset) / Double(columns)) - iconSide = max(42, min(accessibility ? 72 : (tablet ? 68 : 62), cellWidth - 18)) + let preferredColumns = tablet ? (width < 600 ? 4 : (landscape ? 6 : 5)) : (landscape ? 6 : 4) + horizontalInset = min(max(0, width * 0.08), + tablet ? max(12, min(64, width * 0.055)) : 20) + let available = max(1, width - 2 * horizontalInset) + // Preserve familiar 4/5/6-column layouts at normal widths, but + // prioritize room for labels at Accessibility Dynamic Type or in + // narrow Stage Manager/Split View windows. + let minimumCell = accessibility ? 105.0 : 60.0 + columns = max(1, min(preferredColumns, Int(available / minimumCell))) + rows = tablet ? (mini && !landscape ? 6 : 5) : (landscape ? 3 : 6) + let cellWidth = max(1, available / Double(columns)) + iconSide = max(1, min(accessibility ? 72 : (tablet ? 68 : 62), cellWidth - 18)) // The root home screen is one continuous vertical grid, not a page // of rows that must fill the viewport. Keep spacing stable when window // height changes (rotation, keyboard and Stage Manager resizing). From 17540c981a1c4a349ae58082c48a114774a18178 Mon Sep 17 00:00:00 2001 From: Zephyrax <103900579+CORBENDALLAS111@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:44:52 +0000 Subject: [PATCH 13/16] Test compact iPad windows and accessible grid widths across iPhone and iPad sizes --- .../HomeScreenCoreTests.swift | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Tests/HomeScreenCoreTests/HomeScreenCoreTests.swift b/Tests/HomeScreenCoreTests/HomeScreenCoreTests.swift index 57a38b815..0fad79854 100644 --- a/Tests/HomeScreenCoreTests/HomeScreenCoreTests.swift +++ b/Tests/HomeScreenCoreTests/HomeScreenCoreTests.swift @@ -33,6 +33,22 @@ final class HomeScreenCoreTests: XCTestCase { XCTAssertGreaterThan(value.capacity, 0) } } + func testCompactIPadAndAccessibilityGridNeverOverflows() { + let compact = LCHomeMetrics(width: 260, height: 600, tablet: true, mini: false) + XCTAssertLessThan(compact.columns, 4) + let accessible = LCHomeMetrics(width: 402, height: 680, tablet: false, mini: false, accessibility: true) + XCTAssertLessThan(accessible.columns, 4) + for width in [260.0, 320, 375, 402, 430, 600, 744, 1024, 1366] { + for accessibility in [false, true] { + let metrics = LCHomeMetrics(width: width, height: 800, tablet: true, + mini: false, accessibility: accessibility) + XCTAssertGreaterThan(metrics.columns, 0) + XCTAssertLessThanOrEqual(Double(metrics.columns) * (metrics.iconSide + 18) + + 2 * metrics.horizontalInset, width + 1) + } + } + } + func testLargeHomeInventoryIsNeverTruncatedToPageCapacity() { let inventory = (0..<240).map { "org.example.guest\($0):Guest\($0).app" } let metrics = LCHomeMetrics(width: 402, height: 680, tablet: false, mini: false) From 45f6c7ce5cc713316992d370f52ad978baab5349 Mon Sep 17 00:00:00 2001 From: Zephyrax <103900579+CORBENDALLAS111@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:45:04 +0000 Subject: [PATCH 14/16] Test per-app policy isolation, malformed values and default-off binary plist round trip --- Tests/GuestPrivacyPolicyTests.m | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Tests/GuestPrivacyPolicyTests.m diff --git a/Tests/GuestPrivacyPolicyTests.m b/Tests/GuestPrivacyPolicyTests.m new file mode 100644 index 000000000..a51f0b817 --- /dev/null +++ b/Tests/GuestPrivacyPolicyTests.m @@ -0,0 +1,22 @@ +#import +#import "../LiveContainer/Tweaks/LCGuestPrivacyPolicy.h" + +int main(void) { + @autoreleasepool { + NSDictionary *guestA = @{@"LCGuestPrivacy": @{@"camera": @YES, @"battery": @YES}}; + NSDictionary *guestB = @{@"LCGuestPrivacy": @{@"microphone": @YES}}; + NSCAssert(LCGuestPrivacyEnabled(guestA, @"camera"), @"Camera opt-in"); + NSCAssert(LCGuestPrivacyEnabled(guestA, @"battery"), @"Battery opt-in"); + NSCAssert(!LCGuestPrivacyEnabled(guestB, @"camera"), @"Separate guest policies"); + NSCAssert(LCGuestPrivacyEnabled(guestB, @"microphone"), @"Microphone opt-in"); + NSCAssert(!LCGuestPrivacyEnabled(@{}, @"camera"), @"Legacy app defaults to off"); + NSCAssert(!LCGuestPrivacyEnabled(@{@"LCGuestPrivacy": @"invalid"}, @"camera"), @"Malformed policy"); + NSCAssert(!LCGuestPrivacyEnabled(@{@"LCGuestPrivacy": @{@"camera": @"true"}}, @"camera"), @"Malformed value"); + NSCAssert(!LCGuestPrivacyEnabled(@{@"LCGuestPrivacy": @{@"unknown": @YES}}, @"unknown"), @"Unknown key"); + NSData *data = [NSPropertyListSerialization dataWithPropertyList:guestA format:NSPropertyListBinaryFormat_v1_0 options:0 error:NULL]; + NSDictionary *decoded = [NSPropertyListSerialization propertyListWithData:data options:0 format:NULL error:NULL]; + NSCAssert(LCGuestPrivacyEnabled(decoded, @"camera"), @"Binary plist round trip"); + NSLog(@"Guest privacy policy defaults, opt-in, isolation and plist round trip passed."); + } + return 0; +} From 7540ad57957c82007425ec5c28d9555717adcc2b Mon Sep 17 00:00:00 2001 From: Zephyrax <103900579+CORBENDALLAS111@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:45:07 +0000 Subject: [PATCH 15/16] Run native Objective-C guest privacy policy regression tests during integrated IPA CI --- .github/workflows/livecontainer-os.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/livecontainer-os.yml b/.github/workflows/livecontainer-os.yml index e9f51a5ad..e50bf4124 100644 --- a/.github/workflows/livecontainer-os.yml +++ b/.github/workflows/livecontainer-os.yml @@ -51,6 +51,8 @@ jobs: run: | set -o pipefail python3 -m unittest discover -s Tests -p 'test_*.py' + xcrun --sdk macosx clang -fobjc-arc -framework Foundation Tests/GuestPrivacyPolicyTests.m -o /tmp/guest-privacy-policy-tests + /tmp/guest-privacy-policy-tests swift test 2>&1 | tee package-tests.log - name: Archive using upstream configuration run: | From 2a01b1045ae0f84b1c128246031a133f3cffe22f Mon Sep 17 00:00:00 2001 From: Zephyrax <103900579+CORBENDALLAS111@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:45:23 +0000 Subject: [PATCH 16/16] Document actual guest restriction coverage, unsupported APIs and adaptive UI verification checklist --- GUEST_PRIVACY.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 GUEST_PRIVACY.md diff --git a/GUEST_PRIVACY.md b/GUEST_PRIVACY.md new file mode 100644 index 000000000..4f1c49377 --- /dev/null +++ b/GUEST_PRIVACY.md @@ -0,0 +1,39 @@ +# Guest Privacy & Permissions + +Open a guest app's settings, then Privacy & Permissions. Each preference belongs +to that app's LCAppInfo.plist, not a global user default. Defaults are off. +Completely stop the guest and relaunch it before testing changes. The embedded +SideStore is excluded; guest extension bootstrap reads the supplied guest info. + +| Setting | Implemented scope | Limits | +| --- | --- | --- | +| Camera | AVFoundation authorization/request, device input factory, session canAddInput/addInput, UIImagePickerController availability | Other media APIs, direct initializers and system services are not guaranteed | +| Microphone | AVFoundation audio input, permission callbacks, AVAudioRecorder methods | Other engines, audio units and system services are not guaranteed | +| Battery | UIDevice monitoring, level/state and explicit notifications | Other APIs may expose information | +| Proximity | UIDevice monitoring and explicit notifications | Other sensors and APIs unaffected | +| Screenshot notifications | Named UIKit screenshot subscriptions | Does not change OS capture protection, screen recording state or other detection paths | + +These are in-process API restrictions, not security boundaries. System location, +photos, contacts, Bluetooth, local network, tracking and other permissions remain +shared with LC+. No invented hardware/profile values, fake system permissions, +or guarantees against hostile guests. For strict hardware permission denial use +the iOS Settings for LC+, affecting all its guests. + +## Adaptive UI changes +- Apps actions now belong to the Home safe-area layout rather than a global + iPad overlay, avoiding overlap with pushed settings and narrow windows. +- Home retains a continuous vertical grid and native scroll-edge rendering. +- Columns adapt to available width and accessibility text sizes; scaled icons + are clamped to cell width. Titles use semantic system backgrounds. +- App settings no longer nest a List inside Form. Long identifiers wrap. +- Native Privacy Form, localized in English/Russian, includes errors and reset. + +## Verification +Source review and CI are not screenshot verification. On physical devices check +camera and microphone authorization and media input denial; battery/proximity +unknown state; opt-in named screenshot event filtering; disabled-policy behavior; +one guest's settings do not affect another. Check restart and reset; ensure SideStore +still works. Review iPhone SE/standard/Max, iPad mini, 11/13-inch iPad, portrait, +landscape, compact windows, light/dark, accessibility Dynamic Type, VoiceOver, +and Reduce Motion. Open and close app settings to verify the Apps toolbar does +not remain over the child view. A full visual review requires actual screenshots.