//
// SPDX-FileCopyrightText: The LineageOS Project
// SPDX-License-Identifier: Apache-2.0
//

android_app {
    name: "Updater",

    defaults: ["SpaPrivilegedLib-defaults"],

    srcs: [
        "src/main/java/**/*.java",
        "src/main/java/**/*.kt",
    ],

    resource_dirs: ["src/main/res"],
    manifest: "src/main/AndroidManifest.xml",

    platform_apis: true,
    privileged: true,
    privapp_allowlist: "org.lineageos.updater.xml",
    certificate: "platform",
    system_ext_specific: true,

    overrides: [
        "SystemUpdater",
    ],

    plugins: [
        "androidx.room_room-compiler-plugin"
    ],

    javacflags: [
        "-Aroom.schemaLocation=packages/apps/Updater/schemas"
    ],

    kotlin_plugins: [
        "kotlin-serialize-compiler-plugin",
    ],

    static_libs: [
        // DO NOT EDIT THIS SECTION MANUALLY
        "androidx.activity_activity-compose",
        "androidx.compose.animation_animation",
        "androidx.compose.animation_animation-core",
        "androidx.compose.foundation_foundation",
        "androidx.compose.foundation_foundation-layout",
        "androidx.compose.material_material-icons-core",
        "androidx.compose.material_material-icons-extended",
        "androidx.compose.material_material-ripple",
        "androidx.compose.material3_material3",
        "androidx.compose.runtime_runtime",
        "androidx.compose.runtime_runtime-annotation",
        "androidx.compose.runtime_runtime-saveable",
        "androidx.compose.ui_ui",
        "androidx.compose.ui_ui-geometry",
        "androidx.compose.ui_ui-graphics",
        "androidx.compose.ui_ui-text",
        "androidx.compose.ui_ui-tooling-preview",
        "androidx.compose.ui_ui-unit",
        "androidx.compose.ui_ui-util",
        "androidx.core_core-ktx",
        "androidx.datastore_datastore",
        "androidx.datastore_datastore-core",
        "androidx.datastore_datastore-preferences",
        "androidx.graphics_graphics-shapes",
        "androidx.lifecycle_lifecycle-livedata-ktx",
        "androidx.lifecycle_lifecycle-runtime",
        "androidx.lifecycle_lifecycle-runtime-compose",
        "androidx.lifecycle_lifecycle-runtime-ktx",
        "androidx.lifecycle_lifecycle-viewmodel-ktx",
        "androidx.lifecycle_lifecycle-viewmodel-savedstate",
        "androidx.preference_preference",
        "androidx.room_room-runtime",
        "androidx.savedstate_savedstate",
        "androidx.savedstate_savedstate-compose",
        "androidx.sqlite_sqlite",
        "androidx.sqlite_sqlite-framework",
        "androidx.work_work-runtime-ktx",
        "Updater_com.squareup.okhttp3_okhttp",
        "kotlin-stdlib",
        "kotlinx_serialization_json",
    ],

    optimize: {
        optimize: true,
        proguard_flags_files: ["proguard-rules.pro"],
        shrink_resources: true,
    },

    required: [
        "default-permissions_org.lineageos.updater"
    ],
}

prebuilt_etc {
    name: "default-permissions_org.lineageos.updater",
    system_ext_specific: true,
    sub_dir: "default-permissions",
    src: "default-permissions_org.lineageos.updater.xml",
    filename_from_src: true,
}
