This is a fork of conormcd/osx-keychain-java, which has been updated and published to an OSS repository.
The exposed keychain API has been compiled to support both x86/64 and arm64 architectures.
repositories {
mavenCentral()
}
dependencies {
implementation("pt.davidafsilva.apple:jkeychain:1.1.0")
}
<dependencies>
<dependency>
<groupId>pt.davidafsilva.apple</groupId>
<artifactId>jkeychain</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>
final OSXKeychain keychain = OSXKeychain.getInstance();
final Optional<String> appKey = keychain.findGenericPassword("application", "key");
To build locally, you need JavaJDK >= 1.8 and macOS >= 11. Make sure that you have a softlink to your jdk
at /Library/Java/JavaVirtualMachines/openjdk.jdk
.
Please run the command below to execute the tests and build the final package (jar).
$ ./gradlew build
To test the integration with locally modified versions of the API, you can:
To accomplish 2. please run the command below.
$ ./gradlew publishToMavenLocal