- wear: Compose for Wear UI, polls api.anthropic.com, shows 5h/7d utilization - mobile: companion app — token input + Data Layer API + WiFi ADB install - ADB pairing via libadb-android (SPAKE2 + TLS), pm install on watch - Build: AGP 8.7.3, Gradle 8.13, Kotlin 1.9.22, compileSdk 35
69 lines
2.4 KiB
Kotlin
69 lines
2.4 KiB
Kotlin
plugins {
|
|
id("com.android.application")
|
|
id("org.jetbrains.kotlin.android")
|
|
}
|
|
|
|
android {
|
|
namespace = "com.eps.claudemeter"
|
|
compileSdk = 35
|
|
|
|
defaultConfig {
|
|
applicationId = "com.eps.claudemeter"
|
|
minSdk = 26
|
|
targetSdk = 35
|
|
versionCode = 1
|
|
versionName = "0.1"
|
|
}
|
|
|
|
buildFeatures { compose = true }
|
|
composeOptions { kotlinCompilerExtensionVersion = "1.5.8" }
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
kotlinOptions { jvmTarget = "17" }
|
|
|
|
packaging {
|
|
resources {
|
|
excludes += setOf(
|
|
"META-INF/DEPENDENCIES", "META-INF/LICENSE", "META-INF/LICENSE.txt",
|
|
"META-INF/NOTICE", "META-INF/NOTICE.txt",
|
|
"META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA",
|
|
)
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation("androidx.core:core-ktx:1.12.0")
|
|
implementation("androidx.activity:activity-compose:1.8.2")
|
|
implementation(platform("androidx.compose:compose-bom:2024.02.00"))
|
|
implementation("androidx.compose.ui:ui")
|
|
implementation("androidx.compose.material3:material3")
|
|
implementation("androidx.compose.material:material-icons-extended")
|
|
|
|
// Coroutines
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
|
|
|
|
// Wearable Data Layer — передача токена на часы
|
|
implementation("com.google.android.gms:play-services-wearable:18.1.0")
|
|
|
|
// libadb-android — full ADB protocol: SPAKE2 pairing + TLS connection + streams
|
|
implementation("com.github.MuntashirAkon:libadb-android:3.1.1")
|
|
// sun-security-android — exposes android.sun.security.x509.* at compile time
|
|
implementation("com.github.MuntashirAkon:sun-security-android:1.1")
|
|
// hiddenapibypass — access hidden Android APIs at runtime
|
|
implementation("org.lsposed.hiddenapibypass:hiddenapibypass:6.1")
|
|
// Conscrypt — TLS 1.3 provider, required for ADB pairing
|
|
implementation("org.conscrypt:conscrypt-android:2.5.2")
|
|
}
|
|
|
|
// ponytail: копируем wear APK в assets mobile перед сборкой
|
|
tasks.register<Copy>("copyWearApk") {
|
|
from(project(":wear").layout.buildDirectory.file("outputs/apk/debug/wear-debug.apk"))
|
|
into(layout.projectDirectory.dir("src/main/assets"))
|
|
rename { "wear.apk" }
|
|
dependsOn(":wear:assembleDebug")
|
|
}
|
|
tasks.named("preBuild") { dependsOn("copyWearApk") }
|