1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-07 09:31:31 +01:00

feat: simple log that checks if autofill is enabled

This commit is contained in:
Andreas Coroiu 2024-07-18 14:35:21 +02:00
parent b527337a10
commit bf01217e3a
No known key found for this signature in database
GPG Key ID: E70B5FFC81DFEC1A

View File

@ -1,10 +1,28 @@
#import <Foundation/Foundation.h>
#import <AuthenticationServices/ASCredentialIdentityStore.h>
#import <AuthenticationServices/ASCredentialIdentityStoreState.h>
void hello_world(char* value, char* output, int output_size)
{
NSString *string = [[NSString alloc] initWithUTF8String:value];
NSLog(@"Objc from rust, hello: %@", string);
NSLog(@"[BW] Objc from rust, hello: %@", string);
NSString *outputString = @"Hello, World from objc!";
[outputString getCString:output maxLength:output_size encoding:NSUTF8StringEncoding];
if (@available(macos 11, *)) {
NSLog(@"[BW] macOS 11 or later");
ASCredentialIdentityStore *store = [ASCredentialIdentityStore sharedStore];
[store getCredentialIdentityStoreStateWithCompletion:^(ASCredentialIdentityStoreState * _Nonnull state) {
NSLog(@"[BW] state: %@", state);
if (state.enabled) {
NSLog(@"[BW] ASCredentialIdentityStore enabled");
} else {
NSLog(@"[BW] ASCredentialIdentityStore disabled");
}
}];
} else {
NSLog(@"[BW] earlier than macOS 11");
}
}