• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[ROOT REACHED] Rooting Android N Preview 2/3/4 - Preview 3/4 rooted

Search This thread

Gustavo RD78

Senior Member
May 19, 2011
1,723
2,400
Maringá - PR
I am sharing the progress of my work, so you can help make our devices working seamlessly with root
Android Preview N sources have been published so I built a kernel from them

Modifications:
Removed dm_verity (zImage and ramdisk dependencies)
Built with Permissive selinux (command line)

Status N preview 2:
root working
mount RW working
although packaged as selinux permissive is still enforcing what causes some problems like not recognition SIM card, reboots and startup delays.
in some tests by adding only sepolicy patch he presented this problem

How to install:
flash recovery FOTA partition thanks to @shoey63
Code:
fastboot flash recovery recovery.img
make full backup in recovery to return later
flash my kernel (rename to boot.img)
Code:
fastboot flash boot boot.img
flash @Chainfire SuperSU 2.71 via TWRP

Note:
Android N Preview use new bootloader!
To enter the menu unplug the appliance plug the USB cable into your computer or charger and plug the device by holding volume up
Navigate the menu and choose the desired option

github repository

Update N preview 3:
Root post SuperSU 2.74-2 working in preview 3 thanks @shoey63
Guys, please follow instructions EXACTLY.
- Use flashtool to flash This FTF fromThis thread
- Fastboot a recovery image. (There is one in the OP, and it works)
- Reboot to recovery mode in the N Preview 3 bootloader menu using buttons.
- Install SuperSU-v2.74-2-20160519174328.zip
- Let the device boot. You can re-enter recovery using a reboot app.

Also please note:
- Do NOT attempt to flash a "system root" SuperSu zip. I Have tried and the phone wont fully boot.
- Do NOT flash byeselinux, you will get a kernel panic, and end up back in recovery. (Same goes for RecRoot)
- Do NOT expect all apps working on LP or MM to work properly on N-Preview.
- Do NOT use F-Droid Adaway, use the one from This thread, and flash the AdAway_systemless_hosts_v2.zip from the that threads OP before installing the app.

Please do not spam
.
 

Attachments

  • Screenshot_20160425-213114.png
    Screenshot_20160425-213114.png
    149 KB · Views: 6,311
Last edited:

shoey63

Recognized Contributor
Jun 5, 2012
4,036
4,014
Somewhere in Oz...
I am sharing the progress of my work, so you can help make our devices working seamlessly with root
Android Preview N sources have been published so I built a kernel from them....
First of all, good work getting the repo up and fixing the build errors so that we can compile the kernel.:good:
We are faced with two main issues.
1/ - Chainfire's systemless root patches the sepolicy in the ramdisk, and in the process borks recognition of the sim card and causes reboots.
This doesn't occur on Nexus devices which he supports, so it is unlikely he will look at it for the z3 N preview.
2/ - If we try to bypass the need to patch the sepolicy, we need system root. This requires the kernel to be set to permissive.
However, trying to set it in the kernel or the command line doesn't work, because the /init binary sets it back to enforcing during boot.

So we need a hacked init binary or an update to Supersu.
Or something else? Any ideas?
 

Chainfire

Moderator Emeritus / Senior Recognized Developer
Oct 2, 2007
11,442
87,719
www.chainfire.eu
First of all, good work getting the repo up and fixing the build errors so that we can compile the kernel.:good:
We are faced with two main issues.
1/ - Chainfire's systemless root patches the sepolicy in the ramdisk, and in the process borks recognition of the sim card and causes reboots.
This doesn't occur on Nexus devices which he supports, so it is unlikely he will look at it for the z3 N preview.
2/ - If we try to bypass the need to patch the sepolicy, we need system root. This requires the kernel to be set to permissive.
However, trying to set it in the kernel or the command line doesn't work, because the /init binary sets it back to enforcing during boot.

So we need a hacked init binary or an update to Supersu.
Or something else? Any ideas?

If you want support from my end you need to provide all the necessary info (logs, anything helpful you can think of) in the SuperSU threads or forum.
 

shoey63

Recognized Contributor
Jun 5, 2012
4,036
4,014
Somewhere in Oz...
If you want support from my end you need to provide all the necessary info (logs, anything helpful you can think of) in the SuperSU threads or forum.
Here are all the logs I could gather, plus the the ramdisk and kernel parts for anyone to peruse and offer feedback. I will post them in Chainfire's main thread as well.View attachment logs.zip
 

shoey63

Recognized Contributor
Jun 5, 2012
4,036
4,014
Somewhere in Oz...
Have you tried Tobias waldvogels script already? And supersu beta 2.71

Sent from my 10ZE45RG99QY86B1 using XDA-Developers mobile app

---------- Post added at 02:39 AM ---------- Previous post was at 02:28 AM ----------

http://forum.xda-developers.com/showthread.php?p=64990566

Sent from my 10ZE45RG99QY86B1 using XDA-Developers mobile app
I'm very interested in that method of patching the kernel, in particular the way a TA backup can be incorporated to restore full functionality of the DRM keys. However, we need to wait for Chainfire to release a new version to accommodate Sony's sepolicy (and maybe /init?) for N preview. 2.71 is not working properly as stated above.
 

flatpedals

Senior Member
Nov 16, 2012
266
149
An ftf of preview 3 has been released here http://forum.xda-developers.com/showthread.php?p=66480449, So :-
- Flash it
- Fastboot a TWRP recovery.img
- Enter recovery from bootloader menu
- Flash supersu274-2
- You are rooted.
Done this but I get the screen that my 'device is corrupted blah blah'. I don't press power button to pause boot but it hangs after this, the screen freezes.
I get the same message without supersu, but it boots ok after that.
What's up?
 

Omario-242

Senior Member
Feb 18, 2011
1,132
389
Munich
Google Pixel 6 Pro
Done this but I get the screen that my 'device is corrupted blah blah'. I don't press power button to pause boot but it hangs after this, the screen freezes.
I get the same message without supersu, but it boots ok after that.
What's up?
You need to flash SuperSu as soon as you flashed the Recovery I guess, otherwise it will check for original recovery, "sees" that something has been altered and will give out the corrupted device message. It does this on Preview 2 and older SuperSU versions as well so make sure you're up to date.

Reflash original Preview 3 with Flashtool (keep your /data, unckeck wipe /data if you want to) and then flash a recovery through fast boot, then instantly boot the phone out of the fast boot mode into the recovery mode (TWRP), copy the SuperSU zip onto the device and flash it.
 
Last edited:

shoey63

Recognized Contributor
Jun 5, 2012
4,036
4,014
Somewhere in Oz...
Guys, please follow instructions EXACTLY.
- Unlocked bootloaders only!
- Use flashtool to flash This FTF fromThis thread
- Fastboot a recovery image. (There is one in the OP, and it works)
Code:
fastboot flash recovery recovery.img
- Reboot to recovery mode in the N Preview 3 bootloader menu using buttons.
- Install SuperSU-v2.74-2-20160519174328.zip
- Let the device boot. You can re-enter recovery using a reboot app.

Also please note:
- Do NOT attempt to flash a "system root" SuperSu zip. I Have tried and the phone wont fully boot.
- Do NOT flash byeselinux, you will get a kernel panic, and end up back in recovery. (Same goes for RecRoot)
- Do NOT expect all apps working on LP or MM to work properly on N-Preview.
- Do NOT use F-Droid Adaway, use the one from This thread, and flash the AdAway_systemless_hosts_v2.zip from the that threads OP before installing the app.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 17
    We have a breakthrough!
    SuperSU 2.74-2 successfully roots N-3 preview in system-less mode. R/W access to /system as well. I will post a flashable zip for testing over the weekend.:victory:
    No need for a flashable zip. N-Preview 3 FTF has been posted Here
    17
    First of all, good work getting the repo up and fixing the build errors so that we can compile the kernel.:good:
    We are faced with two main issues.
    1/ - Chainfire's systemless root patches the sepolicy in the ramdisk, and in the process borks recognition of the sim card and causes reboots.
    This doesn't occur on Nexus devices which he supports, so it is unlikely he will look at it for the z3 N preview.
    2/ - If we try to bypass the need to patch the sepolicy, we need system root. This requires the kernel to be set to permissive.
    However, trying to set it in the kernel or the command line doesn't work, because the /init binary sets it back to enforcing during boot.

    So we need a hacked init binary or an update to Supersu.
    Or something else? Any ideas?

    If you want support from my end you need to provide all the necessary info (logs, anything helpful you can think of) in the SuperSU threads or forum.
    14
    I am sharing the progress of my work, so you can help make our devices working seamlessly with root
    Android Preview N sources have been published so I built a kernel from them

    Modifications:
    Removed dm_verity (zImage and ramdisk dependencies)
    Built with Permissive selinux (command line)

    Status N preview 2:
    root working
    mount RW working
    although packaged as selinux permissive is still enforcing what causes some problems like not recognition SIM card, reboots and startup delays.
    in some tests by adding only sepolicy patch he presented this problem

    How to install:
    flash recovery FOTA partition thanks to @shoey63
    Code:
    fastboot flash recovery recovery.img
    make full backup in recovery to return later
    flash my kernel (rename to boot.img)
    Code:
    fastboot flash boot boot.img
    flash @Chainfire SuperSU 2.71 via TWRP

    Note:
    Android N Preview use new bootloader!
    To enter the menu unplug the appliance plug the USB cable into your computer or charger and plug the device by holding volume up
    Navigate the menu and choose the desired option

    github repository

    Update N preview 3:
    Root post SuperSU 2.74-2 working in preview 3 thanks @shoey63
    Guys, please follow instructions EXACTLY.
    - Use flashtool to flash This FTF fromThis thread
    - Fastboot a recovery image. (There is one in the OP, and it works)
    - Reboot to recovery mode in the N Preview 3 bootloader menu using buttons.
    - Install SuperSU-v2.74-2-20160519174328.zip
    - Let the device boot. You can re-enter recovery using a reboot app.

    Also please note:
    - Do NOT attempt to flash a "system root" SuperSu zip. I Have tried and the phone wont fully boot.
    - Do NOT flash byeselinux, you will get a kernel panic, and end up back in recovery. (Same goes for RecRoot)
    - Do NOT expect all apps working on LP or MM to work properly on N-Preview.
    - Do NOT use F-Droid Adaway, use the one from This thread, and flash the AdAway_systemless_hosts_v2.zip from the that threads OP before installing the app.

    Please do not spam
    .
    8
    Guys, please follow instructions EXACTLY.
    - Unlocked bootloaders only!
    - Use flashtool to flash This FTF fromThis thread
    - Fastboot a recovery image. (There is one in the OP, and it works)
    Code:
    fastboot flash recovery recovery.img
    - Reboot to recovery mode in the N Preview 3 bootloader menu using buttons.
    - Install SuperSU-v2.74-2-20160519174328.zip
    - Let the device boot. You can re-enter recovery using a reboot app.

    Also please note:
    - Do NOT attempt to flash a "system root" SuperSu zip. I Have tried and the phone wont fully boot.
    - Do NOT flash byeselinux, you will get a kernel panic, and end up back in recovery. (Same goes for RecRoot)
    - Do NOT expect all apps working on LP or MM to work properly on N-Preview.
    - Do NOT use F-Droid Adaway, use the one from This thread, and flash the AdAway_systemless_hosts_v2.zip from the that threads OP before installing the app.
    5
    If you want support from my end you need to provide all the necessary info (logs, anything helpful you can think of) in the SuperSU threads or forum.
    Here are all the logs I could gather, plus the the ramdisk and kernel parts for anyone to peruse and offer feedback. I will post them in Chainfire's main thread as well.View attachment logs.zip