Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I compile an Android kernel with root permission?

I have successfully compiled an AOSP branch (andriod 5.1.1) and installed it to my nexus 5. I have also recompiled a new kernel and replaced the former kernel. I want to know if it is possible to gain root privilege by modify the kernel source code. If so, how?

Thanks!

like image 228
Dillion Wang Avatar asked Dec 04 '25 04:12

Dillion Wang


1 Answers

in build/core/main.mk find block:

ifneq (,$(user_variant))
  # Target is secure in user builds.
  ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1

change ro.secure=0

like image 68
Zbigniew Mazur Avatar answered Dec 05 '25 18:12

Zbigniew Mazur