All Projects → evdenis → Adb_root

evdenis / Adb_root

Licence: gpl-2.0
Magisk Module that allows you to run "adb root".

Projects that are alternatives of or similar to Adb root

Appopsx
🔧A front-end application for the Android AppOpsService.
Stars: ✭ 420 (+332.99%)
Mutual labels:  root, adb
Latest-adb-fastboot-installer-for-windows
A Simple Android Driver installer tool for windows (Always installs the latest version). Sponsored by https://sendletter.org, the Cheapest way to Send Letters
Stars: ✭ 242 (+149.48%)
Mutual labels:  adb, root
Droid-Explorer
Cross-platform root file explorer for Android phones.
Stars: ✭ 34 (-64.95%)
Mutual labels:  adb, root
Airfrozengranter
AirFrozen
Stars: ✭ 52 (-46.39%)
Mutual labels:  root, adb
Cloud Mta Build Tool
Multi-Target Application (MTA) build tool for Cloud Applications https://sap.github.io/cloud-mta-build-tool
Stars: ✭ 94 (-3.09%)
Mutual labels:  makefile
Ssd Text detection
A modified SSD model for text detection
Stars: ✭ 91 (-6.19%)
Mutual labels:  makefile
Flash2cocos2d X
use this tool you can export the flash data, and use the data in cocos2d-x game
Stars: ✭ 90 (-7.22%)
Mutual labels:  makefile
Apk File
Search apk package contents via the command line.
Stars: ✭ 89 (-8.25%)
Mutual labels:  makefile
Gomk
An opinionated Makefile for Go projects.
Stars: ✭ 96 (-1.03%)
Mutual labels:  makefile
Wlr Protocols
Wayland protocols designed for use in wlroots (and other compositors)
Stars: ✭ 94 (-3.09%)
Mutual labels:  makefile
Dockerphp
基于Docker容器化PHP开发环境解决方案
Stars: ✭ 93 (-4.12%)
Mutual labels:  makefile
Aira
Autonomous intelligent robot agent (AIRA) project implements the standard of economic interaction between human-robot and robot-robot.
Stars: ✭ 91 (-6.19%)
Mutual labels:  makefile
Counter Strike Docker
Docker image for Counter Strike 1.6 Dedicated Server
Stars: ✭ 93 (-4.12%)
Mutual labels:  makefile
Local Dev With Docker For Mac Kubernetes
Notes about local development with Docker for Mac and Kubernetes
Stars: ✭ 91 (-6.19%)
Mutual labels:  makefile
Buildroot
Buildroot, making embedded Linux easy. Note that this is not the official repository, but only a mirror. The official Git repository is at http://git.buildroot.net/buildroot/. Do not open issues or file pull requests here.
Stars: ✭ 1,320 (+1260.82%)
Mutual labels:  makefile
Drake
An R-focused pipeline toolkit for reproducibility and high-performance computing
Stars: ✭ 1,301 (+1241.24%)
Mutual labels:  makefile
Rootvalidator
Small Android app that checks the root state of your device.
Stars: ✭ 92 (-5.15%)
Mutual labels:  root
Ayu Jetbrains
Ayu colour scheme for JetBrains' IDEs.
Stars: ✭ 94 (-3.09%)
Mutual labels:  makefile
Mysqlswiftnative
MySQL Swift Native Driver
Stars: ✭ 92 (-5.15%)
Mutual labels:  makefile
Wallpapers
Wallpapers for Pop!_OS
Stars: ✭ 91 (-6.19%)
Mutual labels:  makefile

ADB Root

You don't need this module if you don't know what is "adb root". It's not an ordinary root (su), it's the adbd daemon running on your phone with root rights. adb root allows you to "adb push/pull" to system directories and run such commands as "adb remount" or "adb disable-verify".

This is a highly insecure magisk module. Don't forget to disable it once you've done all the things you need. Don't use it constantly.

This module allows you to run adb daemon from root user. It provides own adbd binary. The binary obtained from AOSP sources with the following patch that disables props checks and usb auth. The binary is required because "adb root" can be disabled in compile time by some vendors. Aarch64 only.

Patch:
diff --git a/adb/daemon/main.cpp b/adb/daemon/main.cpp
index d064d0d..a520bfd 100644
--- a/adb/daemon/main.cpp
+++ b/adb/daemon/main.cpp
@@ -51,48 +51,11 @@
 static const char* root_seclabel = nullptr;
 
 static bool should_drop_capabilities_bounding_set() {
-#if defined(ALLOW_ADBD_ROOT)
-    if (__android_log_is_debuggable()) {
-        return false;
-    }
-#endif
-    return true;
+    return false;
 }
 
 static bool should_drop_privileges() {
-#if defined(ALLOW_ADBD_ROOT)
-    // The properties that affect `adb root` and `adb unroot` are ro.secure and
-    // ro.debuggable. In this context the names don't make the expected behavior
-    // particularly obvious.
-    //
-    // ro.debuggable:
-    //   Allowed to become root, but not necessarily the default. Set to 1 on
-    //   eng and userdebug builds.
-    //
-    // ro.secure:
-    //   Drop privileges by default. Set to 1 on userdebug and user builds.
-    bool ro_secure = android::base::GetBoolProperty("ro.secure", true);
-    bool ro_debuggable = __android_log_is_debuggable();
-
-    // Drop privileges if ro.secure is set...
-    bool drop = ro_secure;
-
-    // ... except "adb root" lets you keep privileges in a debuggable build.
-    std::string prop = android::base::GetProperty("service.adb.root", "");
-    bool adb_root = (prop == "1");
-    bool adb_unroot = (prop == "0");
-    if (ro_debuggable && adb_root) {
-        drop = false;
-    }
-    // ... and "adb unroot" lets you explicitly drop privileges.
-    if (adb_unroot) {
-        drop = true;
-    }
-
-    return drop;
-#else
-    return true; // "adb root" not allowed, always drop privileges.
-#endif // ALLOW_ADBD_ROOT
+    return false;
 }
 
 static void drop_privileges(int server_port) {
@@ -183,9 +146,7 @@ int adbd_main(int server_port) {
     // descriptor will always be open.
     adbd_cloexec_auth_socket();
 
-    if (ALLOW_ADBD_NO_AUTH && !android::base::GetBoolProperty("ro.adb.secure", false)) {
-        auth_required = false;
-    }
+    auth_required = false;
 
     adbd_auth_init();
 
diff --git a/adb/services.cpp b/adb/services.cpp
index 8518f2e..24f9def 100644
--- a/adb/services.cpp
+++ b/adb/services.cpp
@@ -78,12 +78,6 @@ void restart_root_service(int fd, void *cookie) {
         WriteFdExactly(fd, "adbd is already running as root\n");
         adb_close(fd);
     } else {
-        if (!__android_log_is_debuggable()) {
-            WriteFdExactly(fd, "adbd cannot run as root in production builds\n");
-            adb_close(fd);
-            return;
-        }
-
         android::base::SetProperty("service.adb.root", "1");
         WriteFdExactly(fd, "restarting adbd as root\n");
         adb_close(fd);

How to install:

Stable release:

  1. Dowload latest adb_root.zip from releases page https://github.com/evdenis/adb_root/releases
  2. MagiskManager -> Modules + Downloads/adb_root.zip -> Reboot

Master branch:

  1. git clone https://github.com/evdenis/adb_root
  2. cd adb_root
  3. make install

Support

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].