首次提交

This commit is contained in:
DelLevin-Home
2026-08-16 13:44:35 +08:00
commit a9085ad83f
322 changed files with 36601 additions and 0 deletions

1
premium-api/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/build

View File

@@ -0,0 +1,22 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
namespace = "com.fan.edgex.premium.api"
compileSdk = Configs.compileSdk
defaultConfig {
minSdk = Configs.minSdk
}
compileOptions {
sourceCompatibility = Configs.javaVersion
targetCompatibility = Configs.javaVersion
}
kotlinOptions {
jvmTarget = Configs.jvmTarget
}
}

View File

@@ -0,0 +1,37 @@
package com.fan.edgex.premium
import android.content.Context
interface IPremiumPlugin {
val apiVersion: Int
/**
* Verifies that this DEX was issued by the server for the given device.
* The DEX implementation holds the RSA public key and performs the actual crypto.
* Called from system_server after the DEX is loaded; returning false disables the plugin.
*
* @param dexPath absolute path to the installed DEX file (used to compute its hash)
* @param devicePubkeyHex hex X.509 encoding of the device's Keystore EC public key
* @param sigBytes raw RSA/SHA-256 signature over sha256hex(dex)+"|"+devicePubkeyHex
* @param localDebug true only for a debug host that already verified local_debug metadata
*/
fun verifyInstallation(
dexPath: String,
devicePubkeyHex: String,
sigBytes: ByteArray,
localDebug: Boolean,
): Boolean
fun onEdgeLightingShow(
context: Context,
effect: String,
color: Int,
durationMs: Int,
widthDp: Int,
alpha: Float,
): Boolean
fun onEdgeLightingDismiss()
fun onScreenOff()
}