Post

Replies

Boosts

Views

Activity

Fetch workgroup / active directory domain name programatically in Obj-C / Swift
Previously, I used to have the below code to get workgroup / domain name of the active directory service provider. SCDynamicStoreRef storeRef = SCDynamicStoreCreate(NULL, (CFStringRef)@"GetWorkgroup", NULL, NULL); CFPropertyListRef global = SCDynamicStoreCopyValue (storeRef,CFSTR("State:/Network/Global/SMB")); id workgroup = [(__bridge NSDictionary *)global valueForKey:@"Workgroup"]; On few Macs (probably starting from Sonoma), the workgroup property is not set. What is the alternative to get this information programatically?
1
0
236
Oct ’24
App icon color not changing dynamically according to background color from Ventura onwards
In my Swift app for MacOS, I used to set the app icon in status bar with following logic. If dark mode is enabled, white colour template icon If light mode is enabled, black colour template icon Until BigSur with this configuration, if the background wallpaper color was changed being in the same display mode, the status bar icon color used to change dynamically. From Ventura onwards, it does not depend on the background colour anymore with same configuration in the code. Can someone please help here?
0
0
296
Aug ’24
Unable to identify if logged-in user belongs to AD in Mac - CBIdentityAuthority is not giving correct results
For our application, we need to check whether a logged in user belongs to an active directory group or not. We use CBIdentityAuthority to check whether user belongs to domain but in one of the cases of open internet, it is occuring that CBIdentityAuthority is not able to fetch AD details. managedIdentityAuthority authorities is not identifying the AD user record respectively. Instead, the record is found under localIdentityAuthority. dscl utility on the terminal seems to be working fine though. Could this be due to cache issue or the AD service being not reachable? What could be another approach to find if an user belongs to AD?
0
0
236
Aug ’23
Changing app icon of brandaware codesigned app in Mac OS Ventura Beta
We have an application which is codes signed and distributed out of the App Store and packaged via an installer. Since the app is brandaware and distributed through different names, the app icon has to be changed corresponding to the brand. But the brand is determined only during installation. Until now, the installer used to replace the AppIcon.icns file under the code-signed app bundle directory Example.app/Contents/Resources with the appropriate brand icon .icns file. This has no issues until Mac OS Monterey. But on Ventura Beta, when the app is opened, it pops up and error saying "the app is damaged and can't be opened". I agree that a code-signed app cannot be modified, but is there any workaround to change the app icon of the code-signed app without modifying its signature?
0
0
428
Aug ’22
On building an universal binary on Xcode 12.3, why are the dynamic libraries under Example.app/Contents/Frameworks directory buillt for x86_64 archirecture only and not for arm64?
I build my application as an universal binary, for both arm64 and x86_64 architectures. The app is linked to frameworks like CoreFoundation and CoreData. However on building the app using Xcode 12.3, the dynamic libraries under my app directory Example.app/Contents/Frameworks are built for x86_64 architecture only, and not for arm64. On going through the build logs, I see that these libraries are copied from the location /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/macosx/libswiftCoreData.dylib All the libraries under this ndirectory are for x86_64 architecture only. /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/macosx/libswiftCoreData.dylib: Mach-O 64-bit dynamically linked shared library x86_64 Does anyone know the reason for this? Is it fine to discard these libraries or build them for arm64 too? PS - The application does not seem to use these libraries, as my app runs on arm64 architecture without any hassle.
1
0
637
Aug ’22
Webview not loading in Mac OSX app
Only one particular URL does not load in the webview. Every other URL works. Not able to trace the issue but the console logs indicate the following error. Can anyone help around with this please? Provisional navigation does not even start. Logs: default 11:18:42.686145-0400 WebViewTest -[SOConfigurationClient _reloadConfig] on default 11:18:42.686180-0400 WebViewTest -[SOClient configurationWithCompletion:] on default 11:18:42.686886-0400 WebViewTest configurationWithCompletion: success = YES, error = (null) default 11:18:42.688152-0400 WebViewTest client.trigger:#N CCFG for cid 0x62 has # of profiles: 0 default 11:18:42.688756-0400 WebViewTest 0x7ff7b095a658 - WKSOAuthorizationDelegate::setSession: (existing session = 0x0, new session = 0x11401c400) default 11:18:42.688785-0400 WebViewTest 0x11401c400 - [InitiatingAction=Redirect][State=Idle] SOAuthorizationSession::shouldStart: m_page=0x7f8fe384a220 default 11:18:42.688811-0400 WebViewTest 0x11401c400 - [InitiatingAction=Redirect][State=Idle] NavigationSOAuthorizationSession::shouldStartInternal: m_page=0x7f8fe384a220 default 11:18:42.688863-0400 WebViewTest 0x11401c400 - [InitiatingAction=Redirect][State=Idle] RedirectSOAuthorizationSession::beforeStart default 11:18:42.688888-0400 WebViewTest 0x11401c400 - [InitiatingAction=Redirect][State=Idle] *NavigationSOAuthorizationSession::shouldStartInternal: Starting Extensible SSO authentication for a web view that is not attached to a window. Loading will pause until a window is attached.* default 11:18:44.383363-0400 WebViewTest 0x114030800 - [PID=0] WebProcessCache::setApplicationIsActive: (isActive=0)\
2
0
802
Jun ’22
com.apple.WebKit.WebContent process is hung,, due to which webview in OSX app is not loading
The following is the stack trace. Call graph: 2246 Thread_14270191 DispatchQueue_1: com.apple.main-thread (serial) + 2246 start (in dyld) + 462 [0x1125c851e] + 2246 WebKit::XPCServiceMain(int, char const**) (in WebKit) + 85 [0x7ff911bbb759] + 2246 xpc_main (in libxpc.dylib) + 99 [0x7ff80d4af239] + 2246 _xpc_objc_main (in libxpc.dylib) + 773 [0x7ff80d4af816] + 2246 -[NSRunLoop(NSRunLoop) run] (in Foundation) + 76 [0x7ff80e70e8d7] + 2246 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] (in Foundation) + 216 [0x7ff80e683d9a] + 2246 CFRunLoopRunSpecific (in CoreFoundation) + 562 [0x7ff80d82f7ac] + 2237 __CFRunLoopRun (in CoreFoundation) + 1276 [0x7ff80d830368] + ! 2237 __CFRunLoopServiceMachPort (in CoreFoundation) + 319 [0x7ff80d831cdd] + ! 2237 mach_msg (in libsystem_kernel.dylib) + 56 [0x7ff80d72ece8] + ! 2237 mach_msg_trap (in libsystem_kernel.dylib) + 10 [0x7ff80d72e97a] + 8 __CFRunLoopRun (in CoreFoundation) + 2010 [0x7ff80d830646] + ! 3 __CFRunLoopDoTimers (in CoreFoundation) + 307 [0x7ff80d849ef8] + ! : 2 __CFRunLoopDoTimer (in CoreFoundation) + 923 [0x7ff80d84a388] + ! : | 2 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ (in CoreFoundation) + 20 [0x7ff80d84a899] + ! : | 1 WebCore::timerFired(__CFRunLoopTimer*, void*) (in WebCore) + 18 [0x7ff90edb9a62] + ! : | + 1 WTF::AutodrainedPool::AutodrainedPool() (in JavaScriptCore) + 0 [0x7ff825ef0050] + ! : | 1 WebCore::timerFired(__CFRunLoopTimer*, void*) (in WebCore) + 31 [0x7ff90edb9a6f] + ! : | 1 WTF::Detail::CallableWrapper<WebCore::ThreadTimers::setSharedTimer(WebCore::SharedTimer*)::$_0, void>::call() (in WebCore) + 148 [0x7ff91092a534] + ! : 1 __CFRunLoopDoTimer (in CoreFoundation) + 104 [0x7ff80d84a055] + ! : 1 CFRetain (in CoreFoundation) + 65 [0x7ff80d7b598e] + ! 2 __CFRunLoopDoTimers (in CoreFoundation) + 191 [0x7ff80d849e84] + ! : 1 __NSArrayM_new (in CoreFoundation) + 50 [0x7ff80d7cf1cc] + ! : | 1 __CFAllocateObject (in CoreFoundation) + 15 [0x7ff80d7b58ef] + ! : | 1 class_createInstance (in libobjc.A.dylib) + 64 [0x7ff80d5fe1da] + ! : | 1 _malloc_zone_calloc (in libsystem_malloc.dylib) + 60 [0x7ff80d59eb75] + ! : | 1 szone_malloc_should_clear (in libsystem_malloc.dylib) + 66 [0x7ff80d5837d2] + ! : | 1 tiny_malloc_should_clear (in libsystem_malloc.dylib) + 32 [0x7ff80d584765] + ! : 1 objc_msgSend (in libobjc.A.dylib) + 26 [0x7ff80d5fe41a] + ! 2 __CFRunLoopDoTimers (in CoreFoundation) + 205 [0x7ff80d849e92] + ! : 1 -[__NSArrayM insertObject:atIndex:] (in CoreFoundation) + 399 [0x7ff80d7d27ee] + ! : | 1 _platform_bzero$VARIANT$Haswell (in libsystem_platform.dylib) + 0 [0x7ff80d77e600] + ! : 1 -[__NSArrayM insertObject:atIndex:] (in CoreFoundation) + 257 [0x7ff80d7d2760] + ! 1 __CFRunLoopDoTimers (in CoreFoundation) + 222 [0x7ff80d849ea3] + 1 __CFRunLoopRun (in CoreFoundation) + 1280 [0x7ff80d83036c] 2246 Thread_14270227: WebCore: Scrolling + 2246 thread_start (in libsystem_pthread.dylib) + 15 [0x7ff80d766f6b] + 2246 _pthread_start (in libsystem_pthread.dylib) + 125 [0x7ff80d76b4e1] + 2246 WTF::wtfThreadEntryPoint(void*) (in JavaScriptCore) + 9 [0x7ff825ef0039] + 2246 WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) (in JavaScriptCore) + 246 [0x7ff82711ffa6] + 2246 WTF::RunLoop::run() (in JavaScriptCore) + 19 [0x7ff827109c53] + 2246 CFRunLoopRun (in CoreFoundation) + 40 [0x7ff80d8b782b] + 2246 CFRunLoopRunSpecific (in CoreFoundation) + 562 [0x7ff80d82f7ac] + 2246 __CFRunLoopRun (in CoreFoundation) + 1276 [0x7ff80d830368] + 2246 __CFRunLoopServiceMachPort (in CoreFoundation) + 319 [0x7ff80d831cdd] + 2246 mach_msg (in libsystem_kernel.dylib) + 56 [0x7ff80d72ece8] + 2246 mach_msg_trap (in libsystem_kernel.dylib) + 10 [0x7ff80d72e97a] 1 Thread_14270224 DispatchQueue_13: com.apple.root.default-qos (concurrent) 1 start_wqthread (in libsystem_pthread.dylib) + 15 [0x7ff80d766f57] 1 _pthread_wqthread (in libsystem_pthread.dylib) + 326 [0x7ff80d767fd0] 1 _dispatch_workloop_worker_thread (in libdispatch.dylib) + 753 [0x7ff80d5c0eee] 1 _dispatch_mach_invoke (in libdispatch.dylib) + 484 [0x7ff80d5c9b77] 1 _dispatch_lane_serial_drain (in libdispatch.dylib) + 342 [0x7ff80d5b61cd] 1 _dispatch_mach_msg_invoke (in libdispatch.dylib) + 445 [0x7ff80d5c9041] 1 _dispatch_client_callout4 (in libdispatch.dylib) + 9 [0x7ff80d5b03b1] 1 _xpc_connection_mach_event (in libxpc.dylib) + 1382 [0x7ff80d4a5947] 1 _xpc_connection_call_event_handler (in libxpc.dylib) + 56 [0x7ff80d4a6b6c] 1 WebKit::LaunchServicesDatabaseManager::handleEvent(NSObject<OS_xpc_object>*) (in WebKit) + 176 [0x7ff911a6b0de] 1 -[LSDatabaseContext(WebKitChangeTracking) observeDatabaseChange4WebKit:] (in LaunchServices) + 519 [0x7ff80dd8e80a] 1 _LSDatabaseCreate (in LaunchServices) + 68 [0x7ff80dcc7a7c] 1 _LSDatabaseCreateWithAccessQueue (in LaunchServices) + 769 [0x7ff80dd81865] 1 _CSGetStringForCharacters (in CoreServicesStore) + 56 [0x7ff8100cc7af] 1 CSStore2::String::Find(CSStore2::Store&, char const*, unsigned int) (in CoreServicesStore) + 554 [0x7ff8100cca02] 1 invocation function for block in CSStore2::String::Find(CSStore2::Store&, char const*, unsigned int) (in CoreServicesStore) + 27 [0x7ff8100ccbfe] Looks like the last thread is stuck in a database read call. Can anyone please help in a workaround for this?
1
0
689
Jun ’22