5,598,610 Members 43,675 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
_AtilA_
Old
#1  
Junior Member - OP
Thanks Meter 46
Posts: 24
Join Date: Jul 2011
Default [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/androi...=es#hammerhead
[2] CWM Installable .zip : https://mega.co.nz/#!lJVxWCaA!QA4Zo0...QCuIzuYFN bnFU
[3] boot.img : https://mega.co.nz/#!sYE0xDZL!PpR1Gz...Sdsee4mGF 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
The Following 6 Users Say Thank You to _AtilA_ For This Useful Post: [ Click to Expand ]
 
BRiANj64
Old
#2  
Member
Thanks Meter 15
Posts: 90
Join Date: Apr 2012
Location: Maassluis
Err would be nice if we could auto patch a boot.img from other custom kernels ^^
<INSERT PHONE HERE>
<INSERT ROM HERE>
<INSERT KERNEL HERE>
<INSERT RANDOM FORUM REMINDERS HERE>
 
_AtilA_
Old
#3  
Junior Member - OP
Thanks Meter 46
Posts: 24
Join Date: Jul 2011
Quote:
Originally Posted by BRiANj64 View Post
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.
 
P.Mobile
Old
#4  
P.Mobile's Avatar
Senior Member
Thanks Meter 934
Posts: 4,332
Join Date: Nov 2011
Location: RhOdE IsLAnD... 401
can we flash using twrp recovery?? i think most people use twrp
 
_AtilA_
Old
#5  
Junior Member - OP
Thanks Meter 46
Posts: 24
Join Date: Jul 2011
Quote:
Originally Posted by P.Mobile View Post
can we flash using twrp recovery?? i think most people use twrp
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
 
jumparound246
Old
#6  
jumparound246's Avatar
Senior Member
Thanks Meter 222
Posts: 623
Join Date: Oct 2012
Quote:
Originally Posted by _AtilA_ View Post
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 ----------



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

Sent from my Nexus 5 using Tapatalk
 
cliff p
Old
#7  
Member
Thanks Meter 10
Posts: 94
Join Date: Oct 2011
Quote:
Originally Posted by _AtilA_ View Post
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/androi...=es#hammerhead
[2] CWM Installable .zip : https://mega.co.nz/#!lJVxWCaA!QA4Zo0...QCuIzuYFN bnFU
[3] boot.img : https://mega.co.nz/#!sYE0xDZL!PpR1Gz...Sdsee4mGF 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

The Following User Says Thank You to cliff p For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Sony Z Ultra Google Play Edition Receives Bluetooth Certification for Android 4.4.3

You may recall that a few days ago, Sprint jumped the gun … more

Easily Configure Xposed Module Projects in Eclipse

XDA Recognized Developer rovo89‘s innovative and versatile Xposed Framework allows … more

Android Control Center Becomes Quick Control Panel, Brings Host of New Features

You may recall that back in August of last year, we talked … more

Polish Your Custom Themes with Theme Debugger

Creating a custom Android theme from scratch can be quite the laborious task. In addition to … more