plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' } android { namespace 'com.example.deviceagent' compileSdk 34 defaultConfig { applicationId "com.example.deviceagent" minSdk 29 // Android 10;剪贴板限制就是从这一版开始的 targetSdk 34 versionCode 6 versionName "1.5" // 1.5:身份页显示本机账号台账(accounts_b64) } buildTypes { release { minifyEnabled false // 工具类 App,不混淆(方便排查) proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } debug { applicationIdSuffix "" } } compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { jvmTarget = '17' } // 设备都是 arm64,只出一个架构的包,构建快、体积小 splits { abi { enable false } } } dependencies { // 刻意只引两个: // androidx.core —— 只为 FileProvider(把下载的 APK 授权给系统安装器读) // zxing core —— 扫码配置用。**刻意不用 ML Kit**:那要 Google Play 服务, // 国内机型上普遍没有,扫码会直接不可用。 // HTTP 用 HttpURLConnection、JSON 用 org.json(系统内置),不引网络/序列化库。 implementation 'androidx.core:core-ktx:1.13.1' implementation 'com.google.zxing:core:3.5.3' }