AgentSkillsCN

search-build

搜索应用构建配置——包含带有 applicationIdSuffix 的调试/发布构建类型、Compose/BuildConfig/AIDL 构建特性,以及所需权限(INTERNET、READ_CONTACTS、PACKAGE_USAGE_STATS、MANAGE_EXTERNAL_STORAGE、Shizuku、Termux)、Gradle 命令(compileDebugKotlin、assembleDebug、testDebugUnitTest)。

SKILL.md
--- frontmatter
name: search-build
description: Search app build configuration - debug/release build types with applicationIdSuffix, Compose/BuildConfig/AIDL build features, required permissions (INTERNET, READ_CONTACTS, PACKAGE_USAGE_STATS, MANAGE_EXTERNAL_STORAGE, Shizuku, Termux), gradle commands (compileDebugKotlin, assembleDebug, testDebugUnitTest).

Build Configuration

Build Types

TypeSuffixMinificationApp Name
debug.debugNo"Search Debug"
releaseNoneYes (R8)"Search"

Key Build Features

kotlin
// Location: app/build.gradle.kts

android {
    buildFeatures {
        compose = true      // Jetpack Compose
        buildConfig = true  // BuildConfig generation
        aidl = true         // AIDL for Shizuku IPC
    }
}

SDK Versions

code
compileSdk: 36
minSdk: 24 (Android 7.0 Nougat)
targetSdk: 36

Important Permissions

PermissionPurpose
INTERNETFavicon loading, web features
READ_CONTACTSContact search
READ_PHONE_STATESIM number display
READ_PHONE_NUMBERSPhone number access
PACKAGE_USAGE_STATSRecent apps tracking
MANAGE_EXTERNAL_STORAGEFile search (all files)
WRITE_SECURE_SETTINGSDev options toggle (Shizuku)
com.termux.permission.RUN_COMMANDTermux integration

Permission Locations

Permissions are declared in app/src/main/AndroidManifest.xml

Gradle Commands

bash
# Compile Kotlin (required after any .kt file change)
./gradlew :app:compileDebugKotlin

# Build debug APK
./gradlew :app:assembleDebug

# Build release APK
./gradlew :app:assembleRelease

# Run tests
./gradlew :app:testDebugUnitTest

# Clean build
./gradlew clean

# Check dependencies
./gradlew :app:dependencies

Version Catalog

Dependencies are managed via Gradle Version Catalog:

FilePurpose
gradle/libs.versions.tomlDependency version catalog
app/build.gradle.ktsApp-level build config
build.gradle.ktsRoot build config
settings.gradle.ktsModule settings
gradle.propertiesVersion info (0.0.1)

Adding a Dependency

  1. Add to version catalog (gradle/libs.versions.toml):

    toml
    [versions]
    newLib = "1.0.0"
    
    [libraries]
    new-lib = { group = "com.example", name = "lib", version.ref = "newLib" }
    
  2. Add to build.gradle.kts:

    kotlin
    dependencies {
        implementation(libs.new.lib)
    }
    

Key Dependencies

DependencyVersionPurpose
Kotlin2.0.21Language
Compose BOM2024.11+UI Framework
Material 31.5.0-α8Design System
Room2.6.1Database (FTS4)
Coroutines1.7.3Async
WorkManager2.9.1Background Work
Shizuku13.1.5Elevated Permissions

Shizuku Integration

Shizuku is used for elevated permissions (e.g., toggling Developer Options):

FilePurpose
aidl/.../IUserService.aidlIPC interface definition
UserService.ktShizuku service impl

Related Skills

  • search-overview - Project structure
  • search-guides - Adding permissions and dependencies