leejunyoung5819 wayland-android-remote
공개Ubuntu(Wayland/X11)에서 Android 기기 화면 미러링 및 원격 제어 (Rust)
| 1 | import java.util.Properties |
| 2 | |
| 3 | plugins { |
| 4 | alias(libs.plugins.android.application) |
| 5 | } |
| 6 | |
| 7 | /** |
| 8 | * 서명 키 정보. 저장소 밖(~/.config/android-remote-signing/keystore.properties, 또는 |
| 9 | * ANDROID_REMOTE_SIGNING 환경 변수가 가리키는 파일)에 두고 커밋하지 않는다. |
| 10 | * 디버그 빌드도 같은 키로 서명해 디버그·릴리스 APK를 지우지 않고 서로 덮어 설치할 수 있게 한다. |
| 11 | */ |
| 12 | val signingProps: Properties? = run { |
| 13 | val path = System.getenv("ANDROID_REMOTE_SIGNING") |
| 14 | ?: "${System.getProperty("user.home")}/.config/android-remote-signing/keystore.properties" |
| 15 | val f = file(path) |
| 16 | if (f.exists()) Properties().apply { f.inputStream().use { load(it) } } else null |
| 17 | } |
| 18 | |
| 19 | android { |
| 20 | namespace = "com.androidremote" |
| 21 | compileSdk = 36 |
| 22 | |
| 23 | defaultConfig { |
| 24 | applicationId = "com.androidremote" |
| 25 | // 기획서 2절: Android 15(API 35) 이상 |
| 26 | minSdk = 35 |
| 27 | targetSdk = 36 |
| 28 | // 데몬 버전 = APK versionCode (기획서 5.4) |
| 29 | versionCode = 2 |
| 30 | versionName = "0.1.1" |
| 31 | |
| 32 | ndk { |
| 33 | // Conscrypt 네이티브 라이브러리를 64비트 ARM(실기기)과 x86_64(에뮬레이터)만 넣는다. |
| 34 | abiFilters += listOf("arm64-v8a", "x86_64") |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | signingConfigs { |
| 39 | if (signingProps != null) { |
| 40 | create("shared") { |
| 41 | storeFile = file(signingProps.getProperty("storeFile")) |
| 42 | storePassword = signingProps.getProperty("storePassword") |
| 43 | keyAlias = signingProps.getProperty("keyAlias") |
| 44 | keyPassword = signingProps.getProperty("keyPassword") |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | buildTypes { |
| 50 | debug { |
| 51 | signingConfigs.findByName("shared")?.let { signingConfig = it } |
| 52 | } |
| 53 | release { |
| 54 | signingConfigs.findByName("shared")?.let { signingConfig = it } |
| 55 | isMinifyEnabled = true |
| 56 | isShrinkResources = true |
| 57 | proguardFiles( |
| 58 | getDefaultProguardFile("proguard-android-optimize.txt"), |
| 59 | "proguard-rules.pro", |
| 60 | ) |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | buildFeatures { |
| 65 | // 클립보드 변경 리스너(IOnPrimaryClipChangedListener) 스텁 생성용 |
| 66 | aidl = true |
| 67 | } |
| 68 | |
| 69 | compileOptions { |
| 70 | sourceCompatibility = JavaVersion.VERSION_17 |
| 71 | targetCompatibility = JavaVersion.VERSION_17 |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | dependencies { |
| 76 | // Android 플랫폼에는 Ed25519 서명 검증이 없어 PC 인증(기획서 5.3)에 BouncyCastle 경량 API를 쓴다. |
| 77 | implementation(libs.bouncycastle.prov) |
| 78 | // 동반 앱이 기기 자신의 무선 디버깅(adbd)에 접속해 데몬을 띄운다 (기획서 5.4). |
| 79 | // 라이선스: GPL-3.0-or-later 또는 Apache-2.0 중 Apache-2.0으로 사용. |
| 80 | implementation(libs.libadb) { |
| 81 | // 같은 BouncyCastle 클래스를 가진 jdk18on 판을 이미 쓰므로 중복을 뺀다. |
| 82 | exclude(group = "org.bouncycastle", module = "bcprov-jdk15to18") |
| 83 | } |
| 84 | // 무선 디버깅 페어링(TLS 키 내보내기)에 쓰는 Conscrypt. 플랫폼 Conscrypt는 숨은 API라 쓰지 않는다. |
| 85 | implementation(libs.conscrypt) |
| 86 | } |