[KERNEL][STOCK][4.4.2] Only Adb Insecure

Search This thread

_AtilA_

Member
Jul 29, 2011
25
52
[KERNEL][STOCK][4.4.2] Only Adb Insecure

Hi there!
I needed adbd to always run as root in order to push/pull files, but I wanted to stick as close as possible to stock, so I just modified the production boot.img with a patched version of adbd that enforces it to always run as root. I used a boot.img for Android 4.4.2 extracted from the factory images [1] provided by Google.
I thought that it could be usefull to somebody else so... here you have.

It comes in two flavors:

CWM installable .zip [2]
boot.img for fastboot[/URL] [3]


LINKS
[1] Google Factory Images : https://developers.google.com/android/nexus/images?hl=es#hammerhead
[2] CWM Installable .zip : https://mega.co.nz/#!lJVxWCaA!QA4Zo04_bnzxEjmHDyjUDl9cFiAjJ5QCuIzuYFN bnFU
[3] boot.img : https://mega.co.nz/#!sYE0xDZL!PpR1GzIraGCMxr9BOqrZ0wFbBnJO6HSdsee4mGF d5PA


Enjoy!!

XDA:DevDB Information
[KERNEL][STOCK][4.4.2] Only Adb Insecure, a Kernel for the Google Nexus 5

Contributors
_AtilA_
Kernel Special Features: Stock kernel, but with adbd running always as root, so you can adb push/pull/remount/shell/etc as root

Version Information
Status: Stable

Created 2014-01-16
Last Updated 2014-01-16
 

_AtilA_

Member
Jul 29, 2011
25
52
Err would be nice if we could auto patch a boot.img from other custom kernels ^^

Not really sure about what you mean... Basically, the only change I made is a patched adbd. So, the only thing that other custom kernels have to do, is replace the binary. I can provide you a link with the binary, but it's quite easy to extract it from the boot.img :)
I you want to know exactly what I've changed in the adb.c, here it is:
Code:
static int should_drop_privileges() {
#ifndef ALLOW_ADBD_ROOT
    return 1;
#else /* ALLOW_ADBD_ROOT */
    int secure = 0;
    char value[PROPERTY_VALUE_MAX];

   /* run adbd in secure mode if ro.secure is set and
    ** we are not in the emulator
    */
#if 0 /* <JGM> No privileges drop! */
    property_get("ro.kernel.qemu", value, "");
    if (strcmp(value, "1") != 0) {
        property_get("ro.secure", value, "1");
        if (strcmp(value, "1") == 0) {
            // don't run as root if ro.secure is set...
            secure = 1;

            // ... except we allow running as root in userdebug builds if the
            // service.adb.root property has been set by the "adb root" command
            property_get("ro.debuggable", value, "");
            if (strcmp(value, "1") == 0) {
                property_get("service.adb.root", value, "");
                if (strcmp(value, "1") == 0) {
                    secure = 0;
                }
            }
        }
    }
#endif
    return secure;
#endif /* ALLOW_ADBD_ROOT */
}

Simple, disable privilege drop logic and return the correct value.
 
  • Like
Reactions: Duago

jumparound246

Senior Member
Oct 22, 2012
774
329
I don't really know! I've never used TWRP, maybe someone could tell us if CWM .zip file is compatible with the TWRP installation system :)

Yup

Sent from my Nexus 5 using Tapatalk

---------- Post added at 11:16 PM ---------- Previous post was at 11:14 PM ----------

yvu3ygu4.jpg


Can't imagine why all the guys are using custom kernels...:what:

Sent from my Nexus 5 using Tapatalk
 

cliff p

Senior Member
Oct 4, 2011
250
173
Seoul
Hi there!
I needed adbd to always run as root in order to push/pull files, but I wanted to stick as close as possible to stock, so I just modified the production boot.img with a patched version of adbd that enforces it to always run as root. I used a boot.img for Android 4.4.2 extracted from the factory images [1] provided by Google.
I thought that it could be usefull to somebody else so... here you have.

It comes in two flavors:

CWM installable .zip [2]
boot.img for fastboot[/URL] [3]


LINKS
[1] Google Factory Images : https://developers.google.com/android/nexus/images?hl=es#hammerhead
[2] CWM Installable .zip : https://mega.co.nz/#!lJVxWCaA!QA4Zo04_bnzxEjmHDyjUDl9cFiAjJ5QCuIzuYFN bnFU
[3] boot.img : https://mega.co.nz/#!sYE0xDZL!PpR1GzIraGCMxr9BOqrZ0wFbBnJO6HSdsee4mGF d5PA


Enjoy!!

XDA:DevDB Information
[KERNEL][STOCK][4.4.2] Only Adb Insecure, a Kernel for the Google Nexus 5

Contributors
_AtilA_
Kernel Special Features: Stock kernel, but with adbd running always as root, so you can adb push/pull/remount/shell/etc as root

Version Information
Status: Stable

Created 2014-01-16
Last Updated 2014-01-16

FWIW: The MEGA link does not work natively with the MEGA App if you attempt to download directly from your N5. The link is
Code:
https://mega.co.nz/#!lJVxWCaA!QA4Zo04_bnzxEjmHDyjUDl9cFiAjJ5QCuIzuYFNbnFU
 
  • Like
Reactions: _AtilA_

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    [KERNEL][STOCK][4.4.2] Only Adb Insecure

    Hi there!
    I needed adbd to always run as root in order to push/pull files, but I wanted to stick as close as possible to stock, so I just modified the production boot.img with a patched version of adbd that enforces it to always run as root. I used a boot.img for Android 4.4.2 extracted from the factory images [1] provided by Google.
    I thought that it could be usefull to somebody else so... here you have.

    It comes in two flavors:

    CWM installable .zip [2]
    boot.img for fastboot[/URL] [3]


    LINKS
    [1] Google Factory Images : https://developers.google.com/android/nexus/images?hl=es#hammerhead
    [2] CWM Installable .zip : https://mega.co.nz/#!lJVxWCaA!QA4Zo04_bnzxEjmHDyjUDl9cFiAjJ5QCuIzuYFN bnFU
    [3] boot.img : https://mega.co.nz/#!sYE0xDZL!PpR1GzIraGCMxr9BOqrZ0wFbBnJO6HSdsee4mGF d5PA


    Enjoy!!

    XDA:DevDB Information
    [KERNEL][STOCK][4.4.2] Only Adb Insecure, a Kernel for the Google Nexus 5

    Contributors
    _AtilA_
    Kernel Special Features: Stock kernel, but with adbd running always as root, so you can adb push/pull/remount/shell/etc as root

    Version Information
    Status: Stable

    Created 2014-01-16
    Last Updated 2014-01-16
    1
    Err would be nice if we could auto patch a boot.img from other custom kernels ^^

    Not really sure about what you mean... Basically, the only change I made is a patched adbd. So, the only thing that other custom kernels have to do, is replace the binary. I can provide you a link with the binary, but it's quite easy to extract it from the boot.img :)
    I you want to know exactly what I've changed in the adb.c, here it is:
    Code:
    static int should_drop_privileges() {
    #ifndef ALLOW_ADBD_ROOT
        return 1;
    #else /* ALLOW_ADBD_ROOT */
        int secure = 0;
        char value[PROPERTY_VALUE_MAX];
    
       /* run adbd in secure mode if ro.secure is set and
        ** we are not in the emulator
        */
    #if 0 /* <JGM> No privileges drop! */
        property_get("ro.kernel.qemu", value, "");
        if (strcmp(value, "1") != 0) {
            property_get("ro.secure", value, "1");
            if (strcmp(value, "1") == 0) {
                // don't run as root if ro.secure is set...
                secure = 1;
    
                // ... except we allow running as root in userdebug builds if the
                // service.adb.root property has been set by the "adb root" command
                property_get("ro.debuggable", value, "");
                if (strcmp(value, "1") == 0) {
                    property_get("service.adb.root", value, "");
                    if (strcmp(value, "1") == 0) {
                        secure = 0;
                    }
                }
            }
        }
    #endif
        return secure;
    #endif /* ALLOW_ADBD_ROOT */
    }

    Simple, disable privilege drop logic and return the correct value.
    1
    Hi there!
    I needed adbd to always run as root in order to push/pull files, but I wanted to stick as close as possible to stock, so I just modified the production boot.img with a patched version of adbd that enforces it to always run as root. I used a boot.img for Android 4.4.2 extracted from the factory images [1] provided by Google.
    I thought that it could be usefull to somebody else so... here you have.

    It comes in two flavors:

    CWM installable .zip [2]
    boot.img for fastboot[/URL] [3]


    LINKS
    [1] Google Factory Images : https://developers.google.com/android/nexus/images?hl=es#hammerhead
    [2] CWM Installable .zip : https://mega.co.nz/#!lJVxWCaA!QA4Zo04_bnzxEjmHDyjUDl9cFiAjJ5QCuIzuYFN bnFU
    [3] boot.img : https://mega.co.nz/#!sYE0xDZL!PpR1GzIraGCMxr9BOqrZ0wFbBnJO6HSdsee4mGF d5PA


    Enjoy!!

    XDA:DevDB Information
    [KERNEL][STOCK][4.4.2] Only Adb Insecure, a Kernel for the Google Nexus 5

    Contributors
    _AtilA_
    Kernel Special Features: Stock kernel, but with adbd running always as root, so you can adb push/pull/remount/shell/etc as root

    Version Information
    Status: Stable

    Created 2014-01-16
    Last Updated 2014-01-16

    FWIW: The MEGA link does not work natively with the MEGA App if you attempt to download directly from your N5. The link is
    Code:
    https://mega.co.nz/#!lJVxWCaA!QA4Zo04_bnzxEjmHDyjUDl9cFiAjJ5QCuIzuYFNbnFU
    1
    I thought that it could be usefull to somebody else so... here you have.

    This insecure boot works good for stock 4.4.3.
    remount... delele... etc... by adb.

    Thank you.