XuqmGroup-AndroidSDK/sdk-license/src/main/java/com/xuqm/sdk/license/LicenseConfig.kt
XuqmGroup eb27e8f112 feat(sdk-license): client-side package name validation
Package name matching is now done entirely in the SDK before any network call:
- License file flow (tryAutoInitialize): compare licenseFile.packageName with
  context.packageName; refuse initialization if mismatch
- appKey-only flow (checkLicense): fetch GET /api/license/app-info and compare
  configured package names locally before register/verify
- LicenseConfig: add fromLicenseFile flag to distinguish the two flows
- LicenseModels: add AppInfoResponse with matchesPackageName helper
- LicenseApiService: add getAppInfo() endpoint

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 00:30:00 +08:00

11 行
391 B
Kotlin

package com.xuqm.sdk.license
data class LicenseConfig(
val appKey: String,
val baseUrl: String = "https://auth.dev.xuqinmin.com/",
val deviceName: String? = null,
val cacheWindowMs: Long = 10 * 60 * 1000L, // 10 minutes
/** True when initialized from a license file; package name validated locally before any network call. */
val fromLicenseFile: Boolean = false,
)