Loading CleanSpec.mk +1 −0 Original line number Diff line number Diff line Loading @@ -77,3 +77,4 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/vndksp.libraries.txt) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/ld.config.txt) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/llndk.libraries.txt) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/vndksp.libraries.txt) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/) adb/Android.bp +1 −3 Original line number Diff line number Diff line Loading @@ -302,8 +302,6 @@ cc_binary { name: "adbd", defaults: ["adb_defaults"], // adbd must be static, as it is copied into the recovery image. static_executable: true, recovery_available: true, srcs: [ Loading Loading @@ -344,7 +342,6 @@ cc_binary { "libselinux", "libsquashfs_utils", "libqemu_pipe", "libdebuggerd_handler", "libbase", "libcutils", Loading @@ -371,6 +368,7 @@ cc_test { "liblog", "libusb", "libmdnssd", "libselinux", ], test_suites: ["device-tests"], } Loading adb/daemon/main.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ #include <scoped_minijail.h> #include <private/android_filesystem_config.h> #include "debuggerd/handler.h" #include "selinux/android.h" #include "adb.h" Loading Loading @@ -274,7 +273,6 @@ int main(int argc, char** argv) { close_stdin(); debuggerd_init(nullptr); adb_trace_init(argv); D("Handling main()"); Loading adb/daemon/shell_service.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,7 @@ #include <android-base/properties.h> #include <android-base/stringprintf.h> #include <private/android_logger.h> #include <selinux/android.h> #include "adb.h" #include "adb_io.h" Loading Loading @@ -343,6 +344,24 @@ bool Subprocess::ForkAndExec(std::string* error) { adb_write(oom_score_adj_fd, oom_score_adj_value, strlen(oom_score_adj_value))); } #ifdef __ANDROID_RECOVERY__ // Special routine for recovery. Switch to shell domain when adbd is // is running with dropped privileged (i.e. not running as root) and // is built for the recovery mode. This is required because recovery // rootfs is not labeled and everything is labeled just as rootfs. char* con = nullptr; if (getcon(&con) == 0) { if (!strcmp(con, "u:r:adbd:s0")) { if (selinux_android_setcon("u:r:shell:s0") < 0) { LOG(FATAL) << "Could not set SELinux context for subprocess"; } } freecon(con); } else { LOG(FATAL) << "Failed to get SELinux context"; } #endif if (command_.empty()) { // Spawn a login shell if we don't have a command. execle(_PATH_BSHELL, "-" _PATH_BSHELL, nullptr, cenv.data()); Loading debuggerd/Android.bp +8 −1 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ cc_library_shared { cc_library_static { name: "libtombstoned_client_static", defaults: ["debuggerd_defaults"], recovery_available: true, srcs: [ "tombstoned/tombstoned_client.cpp", "util.cpp", Loading Loading @@ -90,7 +91,6 @@ cc_library_static { cc_library_static { name: "libdebuggerd_handler", defaults: ["debuggerd_defaults"], recovery_available: true, srcs: ["handler/debuggerd_fallback_nop.cpp"], whole_static_libs: [ Loading @@ -104,6 +104,7 @@ cc_library_static { cc_library_static { name: "libdebuggerd_handler_fallback", defaults: ["debuggerd_defaults"], recovery_available: true, srcs: [ "handler/debuggerd_fallback.cpp", ], Loading @@ -120,6 +121,12 @@ cc_library_static { "liblzma", "libcutils", ], target: { recovery: { cflags: ["-DNO_LIBDEXFILE_SUPPORT"], exclude_static_libs: ["libdexfile"], }, }, export_include_dirs: ["include"], } Loading Loading
CleanSpec.mk +1 −0 Original line number Diff line number Diff line Loading @@ -77,3 +77,4 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/vndksp.libraries.txt) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/ld.config.txt) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/llndk.libraries.txt) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/vndksp.libraries.txt) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/)
adb/Android.bp +1 −3 Original line number Diff line number Diff line Loading @@ -302,8 +302,6 @@ cc_binary { name: "adbd", defaults: ["adb_defaults"], // adbd must be static, as it is copied into the recovery image. static_executable: true, recovery_available: true, srcs: [ Loading Loading @@ -344,7 +342,6 @@ cc_binary { "libselinux", "libsquashfs_utils", "libqemu_pipe", "libdebuggerd_handler", "libbase", "libcutils", Loading @@ -371,6 +368,7 @@ cc_test { "liblog", "libusb", "libmdnssd", "libselinux", ], test_suites: ["device-tests"], } Loading
adb/daemon/main.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ #include <scoped_minijail.h> #include <private/android_filesystem_config.h> #include "debuggerd/handler.h" #include "selinux/android.h" #include "adb.h" Loading Loading @@ -274,7 +273,6 @@ int main(int argc, char** argv) { close_stdin(); debuggerd_init(nullptr); adb_trace_init(argv); D("Handling main()"); Loading
adb/daemon/shell_service.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,7 @@ #include <android-base/properties.h> #include <android-base/stringprintf.h> #include <private/android_logger.h> #include <selinux/android.h> #include "adb.h" #include "adb_io.h" Loading Loading @@ -343,6 +344,24 @@ bool Subprocess::ForkAndExec(std::string* error) { adb_write(oom_score_adj_fd, oom_score_adj_value, strlen(oom_score_adj_value))); } #ifdef __ANDROID_RECOVERY__ // Special routine for recovery. Switch to shell domain when adbd is // is running with dropped privileged (i.e. not running as root) and // is built for the recovery mode. This is required because recovery // rootfs is not labeled and everything is labeled just as rootfs. char* con = nullptr; if (getcon(&con) == 0) { if (!strcmp(con, "u:r:adbd:s0")) { if (selinux_android_setcon("u:r:shell:s0") < 0) { LOG(FATAL) << "Could not set SELinux context for subprocess"; } } freecon(con); } else { LOG(FATAL) << "Failed to get SELinux context"; } #endif if (command_.empty()) { // Spawn a login shell if we don't have a command. execle(_PATH_BSHELL, "-" _PATH_BSHELL, nullptr, cenv.data()); Loading
debuggerd/Android.bp +8 −1 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ cc_library_shared { cc_library_static { name: "libtombstoned_client_static", defaults: ["debuggerd_defaults"], recovery_available: true, srcs: [ "tombstoned/tombstoned_client.cpp", "util.cpp", Loading Loading @@ -90,7 +91,6 @@ cc_library_static { cc_library_static { name: "libdebuggerd_handler", defaults: ["debuggerd_defaults"], recovery_available: true, srcs: ["handler/debuggerd_fallback_nop.cpp"], whole_static_libs: [ Loading @@ -104,6 +104,7 @@ cc_library_static { cc_library_static { name: "libdebuggerd_handler_fallback", defaults: ["debuggerd_defaults"], recovery_available: true, srcs: [ "handler/debuggerd_fallback.cpp", ], Loading @@ -120,6 +121,12 @@ cc_library_static { "liblzma", "libcutils", ], target: { recovery: { cflags: ["-DNO_LIBDEXFILE_SUPPORT"], exclude_static_libs: ["libdexfile"], }, }, export_include_dirs: ["include"], } Loading