This is open source lib implement from PandaDevelopment's lua v2 lib
Provided basic function like GetKey, Key Validation
Install Using jitpack
Start by add this to build.gradle
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
Then add implementation to dependencies
dependencies {
implementation 'com.github.SayHiEveryday:PandaKey-Implement:VERSION'
}
Change the version to latest version see Release
Start by adding jitpack repository to build file
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Then add dependency
<dependency>
<groupId>com.github.SayHiEveryday</groupId>
<artifactId>PandaKey-Implement</artifactId>
<version>VERSION</version>
</dependency>
See jitpack packages for more information
Start by Import necessary class and creating instance of PandaKey
import me.sallyio.PandaKey.PandaKey;
import me.sallyio.PandaKey.common.IdentifierProvider;
public class Main {
public static void main(String[] args) {
// Retrieve a unique hardware identifier using the IdentifierProvider class.
String identifier = IdentifierProvider.getHardwareIdentifier();
// Create PandaKey Object with service name and hardware identifier.
PandaKey pandakey = PandaKey.newBuilder("Service name")
.setIdentifier(identifier)
.build();
// Generate the key link using the PandaKey instance.
String keyLink = pandakey.getKey();
System.out.println("Key Link: " + keyLink);
}
}
We offer utility classes such as BrowserUtil to streamline the process of launching a web browser within your application.
import me.sallyio.PandaKey.common.BrowserUtil;
public class Main {
public static void main(String[] args) {
// Create an instance of PandaKey with a specified service name and identifier
PandaKey pandakey = PandaKey.newBuilder("Your Service Name")
.setIdentifier("Identifier")
.build();
// Open the browser using the generated key
BrowserUtil.open(pandakey.getKey());
}
}
To validate key
import me.sallyio.PandaKey.PandaKey;
import me.sallyio.PandaKey.common.IdentifierProvider;
public class Main {
public static void main(String[] args) {
String identifier = IdentifierProvider.getHardwareIdentifier();
PandaKey pandakey = PandaKey.newBuilder("Service name")
.setIdentifier(identifier)
.build();
// Validation with key
if (pandakey.validate("Key").isSuccess()) {
System.out.println("Key is valid");
} else {
System.out.println("Key is invalid");
}
// Keyless Validation
if (pandakey.validate().isSuccess()) {
System.out.println("Identifier is valid");
} else {
System.out.println("Identifier is invalid");
}
}
}
We also have Rest Client for accessing Panda api
import me.sallyio.PandaKey.rest.RestClient;
import java.time.LocalDate;
public static void main(String[] args) {
RestClient restClient = new RestClient("YOUR_API_KEY");
// Example Generate key
restClient.generateKey(
LocalDate.of(2024,12,31), // Expiration date
1, // Generate Count
false, // mark keys as non-premium
"Test Key" // Note
);
}