Android One Expanding to Bangladesh, Nepal, and Sri Lanka

At Google I/O 2013, Google proudly announced that the Android operating system was … more

Android 5.0.2 Fixes 2012 Nexus 7! Sony’s Making a Google Glass Competitor? – XDA TV

Android 5.0.2 Lollipop is available for the … more

Early Lollipop Ports for Micromax A116 and A117

It feels like it was only yesterday when Google announced the mysterious Android L.After … more

Now Gesture Tweaks Replaces Google Now with Custom Action

On most modern Android devices with software navigation keys, swiping up from the … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP _AtilA_

16th January 2014, 10:01 AM   |  #1  
OP Junior Member
Thanks Meter: 52
 
25 posts
Join Date:Joined: Jul 2011
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: [ View ]
16th January 2014, 07:35 PM   |  #2  
Senior Member
Flag Maassluis
Thanks Meter: 30
 
161 posts
Join Date:Joined: Apr 2012
More
Err would be nice if we could auto patch a boot.img from other custom kernels ^^
17th January 2014, 09:44 AM   |  #3  
OP Junior Member
Thanks Meter: 52
 
25 posts
Join Date:Joined: Jul 2011
Quote:
Originally Posted by BRiANj64

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.
17th January 2014, 11:07 AM   |  #4  
P.Mobile's Avatar
Senior Member
Flag RhOdE IsLAnD... 401
Thanks Meter: 936
 
4,341 posts
Join Date:Joined: Nov 2011
More
can we flash using twrp recovery?? i think most people use twrp
19th January 2014, 10:13 PM   |  #5  
OP Junior Member
Thanks Meter: 52
 
25 posts
Join Date:Joined: Jul 2011
Quote:
Originally Posted by P.Mobile

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
23rd January 2014, 11:16 PM   |  #6  
jumparound246's Avatar
Senior Member
Thanks Meter: 325
 
756 posts
Join Date:Joined: Oct 2012
Quote:
Originally Posted by _AtilA_

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
27th February 2014, 02:46 PM   |  #7  
Senior Member
Thanks Meter: 21
 
129 posts
Join Date:Joined: Oct 2011
More
Quote:
Originally Posted by _AtilA_

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: [ View ]
10th June 2014, 01:05 AM   |  #8  
Member
Thanks Meter: 52
 
76 posts
Join Date:Joined: May 2010
Quote:
Originally Posted by _AtilA_

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: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes