Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,742,223 Members 52,463 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 50
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 10 Users Say Thank You to _AtilA_ For This Useful Post: [ Click to Expand ]
 
BRiANj64
Old
#2  
Senior Member
Thanks Meter 22
Posts: 125
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 50
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:
Select 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 935
Posts: 4,336
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 50
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 302
Posts: 692
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: 96
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:
Select Code
https://mega.co.nz/#!lJVxWCaA!QA4Zo04_bnzxEjmHDyjUDl9cFiAjJ5QCuIzuYFNbnFU
The Following User Says Thank You to cliff p For This Useful Post: [ Click to Expand ]
 
osebee
Old
#8  
Member
Thanks Meter 49
Posts: 75
Join Date: May 2010
Quote:
Originally Posted by _AtilA_ View Post
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.

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

Advanced Search
Display Modes


XDA PORTAL POSTS

Xperia Z1 Stereo Speaker Mod, Cell Phone Unlocking Legal Again! – XDA Developer TV

Cell Phone Unlocking is legal again!! That and much … more

[OTA Captured] Verizon LG G Pad 8.3 Finally Gets Official KitKat Update

It’s been almost nine months since the LG G Pad … more

Enjoy Wallpaper Overload with PhotoPhase

We don’t usually feature live wallpapers on the XDA Portal unless they are somewhat innovative … more

Monitor What Your Phone’s Camera Sees with Android Wear

Having a smart device strapped to your wrist certainly has its merits. A … more