How to modify the native android app allows to obtain root privileges

First of all, your phone must be the root, this seems to be the general's hand can not do, and if there are ways you can root the phone, congratulations, you are very skilled, you can go to the mobile phone manufacturers of the security sector a. (gab...)

Then only need to modify the source code can be in two places

The first place is the security / under commoncap.c

if (ns == cred->user_ns)
            return cap_raised(cred->cap_effective, cap) ? 0 : -EPERM;

change into

if (ns == cred->user_ns)
            return  0;

Second place:

int hand ( int argc, char** argv) {
//     uid_t current_uid = getuid (); // removed
//    if (current_uid != AID_ROOT && current_uid != AID_SHELL) error(1, 0, "not allowed");//去掉

This OK

Then verify the manner in accordance with: https://blog.csdn.net/dodod2012/article/details/81082169

Guess you like

Origin blog.csdn.net/liuhongbin2011net/article/details/83536367