Code: Apeaksoft Android Toolkit Registration
// UI Kit (free) set
// 4️⃣ Parse JSON response val json = JSONObject(response.body?.string() ?: "") val valid = json.getBoolean("valid") if (!valid) throw LicenseException("License key is invalid or expired.")
// 5️⃣ Optional: verify signature (HMAC) for tamper‑proofing // The server also sends a `signature` field which is HMAC‑SHA256 // of the payload using a secret known only to the server. val signature = json.getString("signature") if (!verifySignature(payload, signature)) throw LicenseException("License response signature mismatch.")
// 2️⃣ Build request body val payload = JSONObject().apply put("key", key) put("machineId", machineId) .toString() apeaksoft android toolkit registration code
class MainActivity : AppCompatActivity() {
Create a file apeaksoft_license.properties at the project root (same folder as settings.gradle ). Example content:
val response = httpClient.newCall(request).execute() if (!response.isSuccessful) throw LicenseException("Server error ($response.code)") // UI Kit (free) set // 4️⃣ Parse
./gradlew validateApeaksoftLicense If everything is correct, you’ll see:
// 6️⃣ Build the LicenseInfo object val expires = json.getString("expires") val features = json.getJSONArray("features") val featureSet = mutableSetOf<String>() for (i in 0 until features.length()) featureSet.add(features.getString(i))
// Kotlin DSL tasks.register<JavaExec>("validateApeaksoftLicense") group = "verification" description = "Validates the APEAKSOFT Toolkit license." Returns a [LicenseInfo] on success, * throws a
override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState)
/** * Validate the key. Returns a [LicenseInfo] on success, * throws a [LicenseException] otherwise. */ @Throws(LicenseException::class) fun verify(key: String, machineId: String = ""): LicenseInfo // 1️⃣ Basic sanity checks require(key.matches(Regex("^[A-Z0-9]32$"))) "License key must be a 32‑character alphanumeric string."