Explore the core architecture of the operating system, including the kernel, memory management, and process scheduling.

Post

Replies

Boosts

Views

Activity

Integrating Two Separate Apps for Parental Control: Queries on Family Picker, Filtering, and Screen Time Permissions
Hello Apple Developer Community, We have developed two totally separate apps for parental control: one for parents (xyz/parent.com) and one for children (abc/child.com). These are not two sides of the same app, but rather distinct applications. Recently, we integrated these two apps and encountered a few challenges and questions that we hope the community can help with. Family Picker Behavior: We noticed that only the parent app on the current device is displayed in the Family Activity Picker. Is this the intended behavior? Our expectation was that the Family Activity Picker would show both the parent and child apps available on the device. Is there a way to ensure that both types of apps are listed? Filtering Apps in Family Picker: Is it possible to filter the apps displayed in the Family Activity Picker to show only the child’s app and exclude the parent app? Our goal is to streamline the selection process for users by removing irrelevant apps from the picker. If direct filtering is not possible, are there any recommended workarounds or best practices to achieve a similar result? Screen Time Permission Requirements: We’ve successfully implemented screen time permissions using the Authorization Center for the child app. However, do we also need to request screen time permissions from within the parent app? If so, are there any specific guidelines or best practices for managing screen time permissions across two interconnected apps? Triggering Child Managed Settings from Multiple Apps: Is it feasible to trigger managed settings (e.g., enabling restrictions) for the child app from both the parent and child apps? We want to ensure consistent enforcement of settings regardless of which app initiates the change. Are there any limitations or conflicts we should be aware of when managing settings from two different apps? We appreciate any guidance or insights you can provide on these issues. We’ve referred to the Family Controls and Screen Time documentation, but we're seeking more specific advice related to the integration of two separate apps in this context. Thank you in advance for your help!
0
0
267
Aug ’24
app to develop
i have a suggestion for an app that will help many families and once installed you won't be able to do without it. I'm sure that at least 70% of families will use it at least twice a day. who do I sell my project to? applace many families will remember me. finally sorry my english comes from a translator.
1
0
174
Aug ’24
iOS18 WebKit crash when use System Input Method(系统输入法)
When using the system input method to input Chinese, deleting the input character will crash when the last character is deleted. crash info: reason:NSMutableRLEArray objectAtIndex:effectiveRange:: Out of bounds -[WKContentView(WKInteraction) setAttributedMarkedText:selectedRange:]_block_invoke -[WKContentView(WKInteraction) objc_msgSend$attributesAtIndex:effectiveRange: (像是WebKit处理系统输入法删除输入信息时,处理文本编辑的问题)
5
3
658
Aug ’24
Inconsistent return values from open function between libc and kernel syscall
Description: When attempting to open a non-existent file on an iOS device, I observed inconsistent return values between the open function from the standard libc library and the kernel syscall (syscall number 5). While the libc open function returns -1, as expected and documented, the kernel syscall open function unexpectedly returns 2. This discrepancy necessitates clarification and documentation to understand the underlying behavior and ensure predictable results when working with file I/O operations in iOS. Code snippet for ASM code: #if defined(__arm64__) #define __asm_syscall(...) do { \ asm volatile ("svc 0x80" : "=r"(x0) : __VA_ARGS__ : "memory", "cc"); \ return x0; \ } while (0) __attribute__((always_inline)) static inline long asm_open(const void* __path, int __flags, int __mode) { register long x16 __asm__("x16") = 5; // 5: open register long x0 __asm__("x0") = (long)__path; register long x1 __asm__("x1") = (long)__flags; register long x2 __asm__("x2") = (long)__mode; __asm_syscall("r"(x16), "0"(x0), "r"(x1), "r"(x2)); } #endif This is how I call the function: char file_path[1024]; int fd = 0; // Set the file path strcpy(file_path, getenv("HOME")); strcat(file_path, "/Documents/non-existent.txt"); // Open file fd = (int)asm_open(file_path, (O_RDWR | O_CREAT), 0666); // -> This returns 2 instead of -1 like stand open function from libc LOGI("[INFO] : Open %d", fd); // [INFO] : Open 2
0
1
131
Aug ’24
Multiple Resolutions in one Virtual Machine
Hi team, I was trying to launch Virtual machine on MacOS 14 using native framework with different Resolutions. let graphicsConfiguration = VZMacGraphicsDeviceConfiguration() graphicsConfiguration.displays = [ VZMacGraphicsDisplayConfiguration(widthInPixels: 2700, heightInPixels: 2200, pixelsPerInch: 100), VZMacGraphicsDisplayConfiguration(widthInPixels: 1920, heightInPixels: 1200, pixelsPerInch: 80) ] return graphicsConfiguration } But I'm getting below error: Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=VZErrorDomain Code=2 "More than one display is configured." UserInfo={NSLocalizedFailure=Invalid virtual machine configuration., NSLocalizedFailureReason=More than one display is configured.} Please let me know it is possible to have multiple resolutions in single VM or not. My use case is to get support of multiple resolutions like 1920x1080, 2048x1536, 1024x728 etc. Thanks.
4
0
310
Aug ’24
Unable to get certificates via TKTokenWatcher
Hello, We have an application which gets our HSM certificates via TKTokenWatcher, there is a snippet: let tokens = TKTokenWatcher() for token in tokens.tokenIDs { // Use our HSM certs if token.contains("SPECIFIC_IDENTIFIER") { let tokenQuery = [kSecClass as String: kSecClassIdentity, kSecAttrTokenID as String: token, kSecAttrKeyType as String: kSecAttrKeyTypeRSA, kSecReturnRef as String: true] as CFDictionary var item: CFTypeRef? let result = SecItemCopyMatching(tokenQuery as CFDictionary, &item) if result == noErr.... Normally, result is all right, but problem occurred when we added "App Groups" entitlement. This application has to share some Defaults with other app, so they need to be in the same App Group. So, when we added this App Group entitlement, result from the code snippet is -34018, which according to OSStatus means errSecMissingEntitlement. Does anybody know, which entitlement has to be added, so app can be in the App Group, and at the same time it is able to get certificates? Thank you.
0
1
382
Aug ’24
Ability to detect macOS upgrade using Endpoint Security Events
Use case: Enable more efficient and quick OS Upgrade on mac systems by detecting the OS upgrade. Our observations: To understand how OS upgrade works, we observed ES events during the upgrade (using eslogger) and found the below observations: For OTA upgrade: nsurlsessiond starts downloading the UpdateBrainService to a temporary location nsurlsessiond also downloads the Mac OS update to the same temporary location com.apple.StreamingUnzipService.privileged service unzips the update archive to the same temp folder mobileassetd later moves it to a permanent folder UpdateBrainService is started For full installer upgrade: Processes from within the full installer App like InstallAssistant_springboard, InstallAssistant, osinstallersetupd, osisstashhelper, osishelperd_intel. Information needed Confirm if the above processes and events we are looking at are good enough, or if there are more significant events (file operations or process launches) that we can look at to more certainly detect the OS upgrade start. We want to understand the exact start point of the OS upgrades in different methods OTA, full installer etc for both major and minor OS upgrades. Information on additional fields in ES message which we could look that make the processes involved in OS upgrade unique, for example "signing_id".
2
1
295
Aug ’24
`cp` ( & friends ) silent loss of extended attributes & file flags
Since the introduction of the siblings / and /System/Volumes/Data architecture, some very basic, critical commands seems to have a broken behaviour ( cp, rsync, tar, cpio…). As an example, ditto which was introduced more than 10 years ago to integrate correctly all the peculiarity of HFS Apple filesystem as compared to the UFS Unix filesystem is not behaving correctly. For example, from man ditto: --rsrc Preserve resource forks and HFS meta-data. ditto will store this data in Carbon-compatible ._ AppleDouble files on filesystems that do not natively support resource forks. As of Mac OS X 10.4, --rsrc is default behavior. [...] --extattr Preserve extended attributes (requires --rsrc). As of Mac OS X 10.5, --extattr is the default. and nonetheless: # ls -@delO /private/var/db/ConfigurationProfiles/Store drwx------@ 5 root wheel datavault 160 Jan 20 2024 /private/var/db/ConfigurationProfiles/Store                            ********* com.apple.rootless 28 *************************** # mkdir tmp # ditto /private/var/db/ConfigurationProfiles tmp ditto: /Users/alice/Security/Admin/Apple/APFS/tmp/Settings: Operation not permitted ditto: /Users/alice/Security/Admin/Apple/APFS/tmp/Store: Operation not permitted # ls -@delO tmp/Store drwx------ 5 root wheel - 160 Aug 8 13:55 tmp/Store                            * # The extended attribute on copied directory Store is empty, the file flags are missing, not preserved as documented and as usual behaviour of ditto was since a long time ( macOS 10.5 ). cp, rsync, tar, cpio exhibit the same misbehaviour. But I was using ditto to be sure to avoid any incompatibility with the Apple FS propriaitary modifications. As a consequence, all backup scripts and applications are failing more or less silently, and provide corrupted copies of files or directories. ( I was here investigating why one of my security backup shell script was making corrupted backups, and only on macOS ). How to recover the standard behaviour --extattr working on modern macOS?
1
0
245
Aug ’24
My app's dylibs not getting recognized as Mach-o after migration. How to troubleshoot / prevent this from happening?
As the title says, I have an application that has a few dylibs right next to it. More often than not, when one of my users migrates from one Mac to another using the Migration Assistant, my app starts crashing since it is not able to recognize the dylibs as a Mach-O file. Both my app & the libraries are compiled for x86 and run on top of Rosetta. Does this maybe play a part in causing in this issue? Doing a file <dylib name> returns "data" as the file type. How to prevent this from happening?
1
0
171
Aug ’24
Headset button not responds in a call on my app
Hi, Team. We are currently creating a VoIP calling app using pjsip and want to be able to end a call using the headset button while the app is in the middle of a call (AVAudioSession.category == .playAndRecord), but MPRemoteCommand does not receive any events. After trying various things, We found that the button will respond if the audio output destination is set to the speaker or if .allowBluetoothA2DP is set as an option, but this is not suitable for this use case because audio input and output would be from the device rather than the headset. ================================================= Problem Headset button events cannot be received from MPRemoteCommand during a call. What is expected to happen? When the headset button is pressed during a call, a handler registered in some MPRemoteCommand is called back. What does actually happen? No MPRemoteCommand responds when the headset button is pressed during a call. Information Sample code Echoes back the audio input with a 5-second delay to simulate a phone call. https://github.com/ryu-akaike/HeadsetTalkTest-iOS/ Versions macOS: Sonoma 14.5 Xcode: 15.3 iPhone: 11 iOS: 17.5.1 ================================================= Thank you. Ryu Akaike
1
0
300
Aug ’24
How to Programmatically Obtain the Current System Firmware Version in macOS Using C++ Without Using System Profiler
The current system firmware version is reported by System Profiler as “SPHardwareDataType”. System firmware versions are also reported (as “Boot ROM”) in diagnostic logs, but here they are the system firmware versions at the time the logs were generated – not necessarily the current system firmware version. Is there a way to programmatically obtain the current system firmware version in macOS using C++ without using System Profiler?
0
0
131
Aug ’24
How to disable Finder "Move to Bin" action for non materialised files
In the context of a NSFileProviderReplicatedExtension I would like to only see the "Move to Bin" Finder action when files have been materlialised ( isDownloaded fileprovider attribute ) I thought it might be possible to get the isDownloaded attribute in my NSFileProviderItemProtocol class capabilities method but that doesn't seem to be the case. Possible ?
1
0
220
Aug ’24
A Live Caller ID Extension is unable to read data from a shared group
Hello Apps and their extensions are able to communicate with each other by reading/writing data stored in a shared group location. However this isn't the case with the the Live Caller ID Extension - if data is written to group defaults for example (as opposed to standard defaults) by the app, then that data isn't readable by the Caller ID extension. This has the consequence that its not possible for a user to dynamically switch which data set the extension connects to. Consider the use case where the Live Caller ID Server has one data set where callers are not blocked, and another where they are blocked, then the caller id extension can route different requests to different datasets based on the "user tier". However as the extension can't read data from the shared group then the app can't communicate user preferences to the extension, therefore the switching isn't possible. Is this by design or due to the immaturity of the feature? If its by design, then it means the use case outlined above isn't possible, and thus greatly reduces the possible functionality of the Live Caller Id feature. (It would be possible for the app to install multiple extensions, each of which connects to a different data set by specifying a different user tier, but the user having to flip these one and off within the Settings app is a dreadful user experience).
0
1
230
Aug ’24
Clear Rosetta Flag for Desktop App
A little bit of background: If you make an app with no compiled Arm64 binaries in the Content/MacOS folder, MacOS erroneously identifies it as an Intel based app. After launching the app, MacOS will prompt the user to install rosetta, despite the app running fine natively. I found a simple solution to this issue, either include a do-nothing compiled binary to Contents/MacOS, or add <key>LSArchitecturePriority</key> <array> <string>arm64</string> </array> to the plist. The problem is this change only fixes the issue if you also change the BundleID. If you run the app even once with the bad configuration, MacOS seems to cache the intel flag somewhere based on the BundleID. It does not seem to be cached in the usual places. How to reproduce: (On apple silicon) You probably already have rosetta, and it is a pain to remove, so a VM is likely needed. Make an empty app with Script Editor, export with file format: Application. Replace Example.app/Content/MacOS/applet with a script of the same name. Make sure the old applet is gone, don't rename it and leave it in the directory. I used: #!/usr/bin/osascript display dialog "Hello, world" Make it executable sudo chmod +x ./Example.app/Content/MacOS/applet Run the app and observe that it asks you to install rosetta Add the previously mentioned fix to you plist, including the BundleID change Run it again and observe that it now works Change your BundleID back. Running this now raises the rosetta prompt despite the fact that it runs fine on a clean install of MacOS. Things I have tried: Rebooting, no effect Reforming the app, no effect Reboot in recovery mode, no effect lsregister -delete, no effect ~/Library/Preferences, ~/Library/Caches, /Library/Preferences, and /Library/Caches, none contain an entry for the BundleId defaults delete, domain not found
1
0
329
Aug ’24