Installation

This page is devoted to showing you how to install Lazysodium into your project.

Java

Lazysodium for Java requires:

  • JDK 8 or higher.

  • Gradle 4.7 or higher (if compiling and building).

  • No effort whatsoever.

Substitute VERSION_NUMBER with the latest version available on this page. Substitute LATEST_JNA_VERSION for the latest JNA version.

Gradle
Maven
JARs
Gradle
// Top level build file
repositories {
// Add this to the end of any existing repositories
mavenCentral()
}
// Project level dependencies section
dependencies {
implementation "com.goterl:lazysodium-java:VERSION_NUMBER"
implementation "net.java.dev.jna:jna:JNA_NUMBER"
}
Maven
<--! Now add the dependencies !-->
<dependency>
<groupId>com.goterl</groupId>
<artifactId>lazysodium-java</artifactId>
<version>VERSION_NUMBER</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>LATEST_JNA_VERSION</version>
</dependency>
JARs

If you're wanting a JAR instead then grab it from the Download button on the right hand side of the Maven Sonatype search page. Then verify it using our GPG key which can be found on our FAQ page. You will also need the Java JNA jar file (link above).

Android

Lazysodium for Android requires:

  • Android 19 or higher. Untested on lower versions.

  • Gradle (if compiling and building).

  • No effort whatsoever.

Substitute VERSION_NUMBER with the latest version available on this page. Substitute LATEST_JNA_VERSION for the latest JNA version, keep the @aar ending.

Gradle
AARs
Gradle
// Top level build file
repositories {
// Add this to the end of any existing repositories
mavenCentral()
}
// Project level dependencies section
dependencies {
implementation "com.goterl:lazysodium-android:[email protected]"
implementation "net.java.dev.jna:jna:[email protected]"
}
AARs

If you're wanting to just add the AAR then grab it from the Download button on the right hand side of the Maven Sonatype search page. Then optionally verify it using our GPG key which can be found on our FAQ page. You will also need to grab the AAR JNA file (link above).

Proguard

If you are using Proguard then it is advisable to use the following rules for JNA. This is taken from the JNA's wiki page.

-dontwarn java.awt.*
-keep class com.sun.jna.* { *; }
-keepclassmembers class * extends com.sun.jna.* { public *; }

Verification using GPG

If you want to verify an AAR or a JAR or any file, then this question in the FAQ on GPG usage will help.