Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e24a4b37 authored by Josh Gao's avatar Josh Gao Committed by Gerrit Code Review
Browse files

Merge changes from topic "adbd_apex"

* changes:
  Move adbd to an apex.
  adbd: use libadbd_auth for authentication.
parents 7cfb77ed 594f70ff
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -89,3 +89,4 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/product_services)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/product_services)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/debug_ramdisk/product_services)
$(call add-clean-step, find $(PRODUCT_OUT) -type l -name "charger" -print0 | xargs -0 rm -f)
$(call add-clean-step, rm -f $(PRODUCT_OUT)/system/bin/adbd)
+56 −51
Original line number Diff line number Diff line
@@ -356,11 +356,12 @@ cc_library_static {
    generated_headers: ["platform_tools_version"],

    static_libs: [
        "libadbconnection_server",
        "libdiagnose_usb",
    ],

    shared_libs: [
        "libadbconnection_server",
        "libadbd_auth",
        "libasyncio",
        "libbase",
        "libcrypto",
@@ -408,12 +409,13 @@ cc_library {
    ],

    static_libs: [
        "libadbconnection_server",
        "libadbd_core",
        "libdiagnose_usb",
    ],

    shared_libs: [
        "libadbconnection_server",
        "libadbd_auth",
        "libasyncio",
        "libbase",
        "libcrypto",
@@ -460,6 +462,8 @@ cc_library {
    ],

    shared_libs: [
        "libadbconnection_server",
        "libadbd_auth",
        "libadbd_services",
        "libasyncio",
        "libbase",
@@ -492,23 +496,34 @@ cc_binary {
        keep_symbols: true,
    },

    shared_libs: [
    stl: "libc++_static",
    static_libs: [
        "libadbd",
        "libadbd_auth",
        "libadbd_services",
        "libasyncio",
        "libbase",
        "libcap",
        "libcrypto",
        "libcrypto_utils",
        "libcutils",
        "libdiagnose_usb",
        "liblog",
        "libmdnssd",
        "libminijail",
        "libselinux",
    ],

    shared_libs: [
        "libadbconnection_server",
        "libcrypto",
    ],
}

phony {
    name: "adbd_system_binaries",
    required: [
        "abb",
        "libadbd_auth",
        "reboot",
        "set-verity-state",
    ]
@@ -521,53 +536,6 @@ phony {
    ],
}

cc_binary {
    name: "static_adbd",
    defaults: ["adbd_defaults", "host_adbd_supported"],

    recovery_available: false,
    static_executable: true,
    host_supported: false,

    srcs: [
        "daemon/main.cpp",
    ],

    cflags: [
        "-D_GNU_SOURCE",
        "-Wno-deprecated-declarations",
    ],

    strip: {
        keep_symbols: true,
    },

    static_libs: [
        "libadbconnection_server",
        "libadbd",
        "libadbd_services",
        "libasyncio",
        "libavb_user",
        "libbase",
        "libbootloader_message",
        "libcap",
        "libcrypto_static",
        "libcrypto_utils",
        "libcutils",
        "libdiagnose_usb",
        "libext4_utils",
        "libfec",
        "libfec_rs",
        "libfs_mgr",
        "liblog",
        "liblp",
        "libmdnssd",
        "libminijail",
        "libselinux",
        "libsquashfs_utils",
    ],
}

cc_binary {
    name: "abb",

@@ -615,6 +583,7 @@ cc_test {

    static_libs: [
        "libadbd",
        "libadbd_auth",
        "libbase",
        "libcutils",
        "libcrypto_utils",
@@ -759,3 +728,39 @@ cc_test_host {
        "fastdeploy/testdata/sample.cd",
    ],
}

prebuilt_etc {
    name: "com.android.adbd.ld.config.txt",
    src: "apex/ld.config.txt",
    filename: "ld.config.txt",
    installable: false,
}

apex {
    name: "com.android.adbd",
    manifest: "apex/apex_manifest.json",

    binaries: ["adbd"],
    prebuilts: ["com.android.adbd.init.rc", "com.android.adbd.ld.config.txt"],

    key: "com.android.adbd.key",
    certificate: ":com.android.adbd.certificate",
}

apex_key {
    name: "com.android.adbd.key",
    public_key: "apex/com.android.adbd.avbpubkey",
    private_key: "apex/com.android.adbd.pem",
}

android_app_certificate {
    name: "com.android.adbd.certificate",
    certificate: "apex/com.android.adbd",
}

prebuilt_etc {
    name: "com.android.adbd.init.rc",
    src: "apex/adbd.rc",
    filename: "init.rc",
    installable: false,
}
+1 −0
Original line number Diff line number Diff line
@@ -300,6 +300,7 @@ static void handle_new_connection(atransport* t, apacket* p) {
    handle_online(t);
#else
    if (!auth_required) {
        LOG(INFO) << "authentication not required";
        handle_online(t);
        send_connect(t);
    } else {

adb/apex/adbd.rc

0 → 100644
+6 −0
Original line number Diff line number Diff line
service adbd /apex/com.android.adbd/bin/adbd --root_seclabel=u:r:su:s0
    class core
    socket adbd seqpacket 660 system system
    disabled
    override
    seclabel u:r:adbd:s0
+4 −0
Original line number Diff line number Diff line
{
  "name": "com.android.adbd",
  "version": 1
}
Loading