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

Commit 9d4876fe authored by Luca Stefani's avatar Luca Stefani Committed by Michael Bestas
Browse files

Make adb use a custom prop for adb root

Change-Id: Ie2b8c5e9d75371da43305f003607869370bbd1a4
parent b1260205
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ static bool should_drop_privileges() {
    bool drop = ro_secure;

    // ... except "adb root" lets you keep privileges in a debuggable build.
    std::string prop = android::base::GetProperty("service.adb.root", "");
    std::string prop = android::base::GetProperty("lineage.service.adb.root", "");
    bool adb_root = (prop == "1");
    bool adb_unroot = (prop == "0");
    if (ro_debuggable && adb_root) {
+2 −2
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ void restart_root_service(unique_fd fd) {
#endif

    LOG(INFO) << "adbd restarting as root";
    android::base::SetProperty("service.adb.root", "1");
    android::base::SetProperty("lineage.service.adb.root", "1");
    WriteFdExactly(fd.get(), "restarting adbd as root\n");
}

@@ -85,7 +85,7 @@ void restart_unroot_service(unique_fd fd) {
    }

    LOG(INFO) << "adbd restarting as nonroot";
    android::base::SetProperty("service.adb.root", "0");
    android::base::SetProperty("lineage.service.adb.root", "0");
    WriteFdExactly(fd.get(), "restarting adbd as non root\n");
}