[KERNEL][M 6.0] US Unlocked / Developer Edition [Normal/Systemless Root][03 DEC 2015] - One (M8) Android Development

**** The posted systemless kernel is only compatible with SuperSU 2.56!!! ****
*** Starting with SuperSU 2.60+ kernel can now be auto-patched for systemless root. ***
**As of 06 December 2015 flar2 has released ElementalX 6.02 for Sense Marshmallow **
* If you still desire a stock kernel with systemless root but want to use newer SuperSU see below *​
Messed around with the boot.img from today's Marshmallow update and have made it compatible with systemless root.
Systemless root in general is experimental and so is the kernel. I've literally just made it and tested it enough to that it boots and apps are able to be granted root access, so flash at your own risk.
Kernel has been running without issue.
Other than systemless root compatibility, this kernel is completely stock and no other modifications made.
Intructions - Systemless:
Download kernel from here.
Download SuperSU 2.56 beta from this post (only one that works with this method of root).
Copy both to phone
Flash the image directly using TWRP (toggle from ZIP to IMG under install)
Immediately flash SuperSU-v2.56-20151030013730.zip afterwards.
Reboot
TWRP will notify of no SU when you reboot, click DO NOT INSTALL as TWRP needs to be updated to detect this root method (it only looks in /system)
Instructions - Traditional:
Download kernel from here.
Download SuperSU 2.52 beta from this thread (it's the M compatible version)
Copy both to phone
Flash the image directly using TWRP (toggle from ZIP to IMG under install)
Immediately flash BETA-SuperSU-v2.52.zip afterwards.
Reboot
Keeping stock kernel with updated SuperSU:
If you prefer running the stock kernel with systemless root and want to stay current on SuperSU versions you need a stock kernel when you update SuperSU. When SuperSU installs it tries to restore a backup it made of your boot.img from the last time SuperSU was installed. Since this was made before auto patching there won't be a backup. Also, in newer versions it detects if your device needs systemless or if it can modify /system. If TWRP hasn't been told to keep system read-only it will likely default to a /system install. So, if you want to keep stock kernel and systemless root there are two things you are going to need:
Stock Kernel: You can actually use the kernel provided for traditional root as a stock kernel for the purpose of these instructions.
Systemless Override: To guarantee that SuperSU gives you the systemless install over /system you need to create a file called ".supersu" with the line "SYSTEMLESS=true" and place it in /data in TWRP before you install (eg. /data/.supersu). Alternatively, you can download this one (extract from the ZIP and place in /data).
When the file is placed in /data flash the boot.img in TWRP and then flash SuperSU. It will make a backup when it installs so don't remove it as it will look for this backup again when you install an updated version.
Note: These are only to tide us over until HTC releases source allowing awesome devs like flar2 to work their kernel magic.

Not checked yet, but is systemless the only way to do it on 6.0 ?

Electronic Punk said:
Not checked yet, but is systemless the only way to do it on 6.0 ?
Click to expand...
Click to collapse
No, you can still do it by modifying /system, but Marshmallow made it so kernels had to be modified as well to allow root. @Chainfire took it a step further, since we already have to modify the boot.img we can modify it a little more and remove the need to alter /system and make it easier to accept OTA updates. The link I put in the OP explains it a little more, but here it is again.

Added root modified kernel for using "traditional" (modifies /system) root to the OP along with link to current Marshmallow compatible SuperSU.

I'm trying to do a systemless root. Just to confirm, I should flash the latest TWRP. Then from there flash the kernel then SuperSU both through TWRP?

mcta said:
I'm trying to do a systemless root. Just to confirm, I should flash the latest TWRP. Then from there flash the kernel then SuperSU both through TWRP?
Click to expand...
Click to collapse
If you still have stock kernel and no root you can just flash the latest SuperSU (v2.65).
If you're systemless already but don't have a backup you need to flash a boot.img that isn't already systemless modified as SuperSU will abort the install.
You can't flash the one in the OP for traditional (modifies /system) root and it will patch that one, but unless your set your /system partition to read-only, it will install using traditional root (this is the case with any unmodified boot.img not just this one because it's modified for traditional root). To make sure SuperSU installs using systemlesss you need to place the mentioned .supersu file in /data/ o make sure system is read-only in twrp. You also want to use latest SuperSU.
Just make sure you don't let TWRP install it's own SuperSU package that it includes. TWRP by default can't detect systemless root installs, so each time you reboot from TWRP it will warn that there is no root access on the device. It is important you make sure to click DO NOT INSTALL.
If you don't want to be bugged with the no root message in TWRP you can download this version which has the incompatible SuperSU package removed disabling the root check.

HAHAHAHAHA!!!!! Silly me...... it was written up there......
mcta said:
I'm trying to do a systemless root. Just to confirm, I should flash the latest TWRP. Then from there flash the kernel then SuperSU both through TWRP?
Click to expand...
Click to collapse

Okay, hopefully this is a stupid question, but I want to be sure before I flash something to boot.
I followed the instructions before the later versions of SuperSU betas came out, so I have the above linked custom boot image, but would like to be able to update to later versions. Can I safely assume that the boot_signed.img file I pulled out of ROM.ZIP in the Developer Edition Marshmallow RUU is the correct "stock" bootloader? Note that I ran the RUU, let it pause on accepting the license, then pulled the ROM.ZIP out of the temp folder to extract the binary.

Hi! Im pretty much new to rooting and I was wondering does the phone have to be S-OFF or S-ON. If it has to be S-OFF, how do you do it?
Thank you for help!

Related

[MM] [Flashable] Patcher to provide root access without /system modification

This patcher is now outdated. Use the new SuperSU instead. http://forum.xda-developers.com/showpost.php?p=64161125&postcount=3
This zip is a systemless version. That means that you'll get root and be able to use it normally, but your system partition will not be modified, like in normal root methods. Only for Marshmallow.
Keep reading for disadvantages and advantages
Chainfire had released a newer version of his SuperSU that doesn't need to modify the system partition to provide root access. This method doesn't have much of a practical application right now, but it allows you to flash OTA updates without having to unroot or flash the stock system partition.
HOW TO USE:
If you have rooted before, flash the system partition (or reinstall the ROM) before flashing this zip.
Download the attached zip, and flash it from a recovery (I tested it with TWRP).
Download SuperSU 2.56 from here: http://forum.xda-developers.com/showpost.php?p=63197935&postcount=2 (Just download the apk)
Reboot to TWRP. If it asks you whether you want system to be mounted as r/w, and if you want to take OTAs later, choose to keep system read-only (this will replace TWRP with stock recovery on reboot).
Flash SuperSU-v2.56-20151030013730.zip
Reboot
TWRP will say that you are not rooted, just ignore that. Do not tell it to root it.
This will work with all Marshmallow kernels, even the stock kernel.
Drawback : A factory data reset will remove superuser privileges. If that happens, simply flash SuperSU-v2.56-20151030013730.zip again.
TO RECEIVE OTA UPDATES :
Just make sure not to do anything that modifies /system. For example, no build.prop changes, and no system app removal. Or even if you do these, make sure to undo these changes before flashing an OTA. You can flash OTAs without unrooting now.
Flash the stock boot.img for your current Android version before flashing OTAs.
BUGS :
I didn't find any, yet, but Chainfire wrote the following on his thread:
Apps with hardcoded paths to su (seriously?) will bork
Factory reset unroots
Factory reset wipes pin
...
Bugs... Bugs everywhere!
ADDITIONAL INFO :
This zip will replace sepolicy as mentioned on Chainfire's thread (thanks to @metaspook for the patched sepolicy, which I extracted from his zip), so you'll be able to get root access even on SELinux enforcing kernels (only the stock MM kernels right now). Also, you can flash any other kernel (as long as it comes in a zip format, not as an img) before or after flashing this, and you'll still have root access.
out386 said:
Chainfire had released a newer version of his SuperSU that doesn't need to modify the system partition to provide root access. This method doesn't have much of a practical application right now, but it allows you to flash OTA updates without having to unroot or flash the stock system partition.
HOW TO USE:
Download the attached zip, and flash it from a recovery (I tested it with TWRP).
Download SuperSU 2.56 (or newer, if it supports systemless mode) from here: http://forum.xda-developers.com/showpost.php?p=63197935&postcount=2 (Just download the apk)
Flash SuperSU-v2.56-20151030013730.zip
Reboot
This will work with all Marshmallow kernels, even the stock kernel.
Drawback : A factory data reset will remove superuser privileges. If that happens, simply flash SuperSU-v2.56-20151030013730.zip again.
TO RECEIVE OTA UPDATES :
Just make sure not to do anything that modifies /system. For example, no build.prop changes, and no system app removal. Or even if you do these, make sure to undo these changes before flashing an OTA. You can flash OTAs without unrooting now.
Flash the stock boot.img for your current Android version before flashing OTAs.
BUGS :
I didn't find any, yet, but Chainfire wrote the following on his thread:
Apps with hardcoded paths to su (seriously?) will bork
Factory reset unroots
Factory reset wipes pin
...
Bugs... Bugs everywhere!
ADDITIONAL INFO :
This zip will replace sepolicy as mentioned on Chainfire's thread (thanks to @metaspook for the patched sepolicy, which I extracted from his zip), so you'll be able to get root access even on SELinux enforcing kernels (only the stock MM kernels right now). Also, you can flash any other kernel (as long as it comes in a zip format, not as an img) before or after flashing this, and you'll still have root access.
Click to expand...
Click to collapse
Well done bro!
I'm just waiting for this
Help regarding installation
I am using MicroMax Android One with Marshmallow
Currently, I've not tired the phone.
When I open recovery, I see some options like Apply update from SD card, mount, cache wipe, factory reset, etc.
So which option should I use to flash the zip file.
out386 said:
Chainfire had released a newer version of his SuperSU that doesn't need to modify the system partition to provide root access. This method doesn't have much of a practical application right now, but it allows you to flash OTA updates without having to unroot or flash the stock system partition.
HOW TO USE:
Download the attached zip, and flash it from a recovery (I tested it with TWRP).
Download SuperSU 2.56 (or newer, if it supports systemless mode) from here: http://forum.xda-developers.com/showpost.php?p=63197935&postcount=2 (Just download the apk)
Flash SuperSU-v2.56-20151030013730.zip
Reboot
This will work with all Marshmallow kernels, even the stock kernel.
Drawback : A factory data reset will remove superuser privileges. If that happens, simply flash SuperSU-v2.56-20151030013730.zip again.
TO RECEIVE OTA UPDATES :
Just make sure not to do anything that modifies /system. For example, no build.prop changes, and no system app removal. Or even if you do these, make sure to undo these changes before flashing an OTA. You can flash OTAs without unrooting now.
Flash the stock boot.img for your current Android version before flashing OTAs.
BUGS :
I didn't find any, yet, but Chainfire wrote the following on his thread:
Apps with hardcoded paths to su (seriously?) will bork
Factory reset unroots
Factory reset wipes pin
...
Bugs... Bugs everywhere!
ADDITIONAL INFO :
This zip will replace sepolicy as mentioned on Chainfire's thread (thanks to @metaspook for the patched sepolicy, which I extracted from his zip), so you'll be able to get root access even on SELinux enforcing kernels (only the stock MM kernels right now). Also, you can flash any other kernel (as long as it comes in a zip format, not as an img) before or after flashing this, and you'll still have root access.
Click to expand...
Click to collapse
Good work n thanks for mention bt can't understand why u created a patcher again where I'v already created one!
Its ok, good job.
Good.... Thanks for posting
metaspook said:
Good work n thanks for mention bt can't understand why u created a patcher again where I'v already created one!
Its ok, good job.
Click to expand...
Click to collapse
Yes, well, I would never have reposted the same thing, so, I'm sorry if it seemed like that.
This one uses Chainfire's new systemless root method. Unlike other root methods that need modifications to /system, this method uses modifications to the boot image to set up and run the su daemon from a loop device on the /data partition and achieve root. Right now, that doesn't have much of an advantage except to make flashing OTAs easier. Chainfire made it because future devices might need it. I made the patch because someone on FB asked about it.
<accidental double post, sorry. Can't delete>
kalpitandroid said:
I am using MicroMax Android One with Marshmallow
Currently, I've not tired the phone.
When I open recovery, I see some options like Apply update from SD card, mount, cache wipe, factory reset, etc.
So which option should I use to flash the zip file.
Click to expand...
Click to collapse
You need to install a custom recovery first. Go to the Android One (First generation) General forums on this site. You'll find a how-to at the very top of the list of threads. Once you have a custom recovery, flash this using the "install zip" option.
out386 said:
Yes, well, I would never have reposted the same thing, so, I'm sorry if it seemed like that.
This one uses Chainfire's new systemless root method. Unlike other root methods that need modifications to /system, this method uses modifications to the boot image to set up and run the su daemon from a loop device on the /data partition and achieve root. Right now, that doesn't have much of an advantage except to make flashing OTAs easier. Chainfire made it because future devices might need it. I made the patch because someone on FB asked about it.
Click to expand...
Click to collapse
Hmm... gotcha now.. Good work!
If u ever need any help just pm.
Thank you...
out386 said:
<accidental double post, sorry. Can't delete>
Click to expand...
Click to collapse

[GUIDE] How to keep root and Xposed while still receiving OTA updates

Hey guys. I thought I'll share what I found out on this because it will help many many out there.
Requirements : TWRP on Read- only mode, Non-rooted device.
1. Take a back up of only "BOOT" partition from TWRP.
2. Download the latest system-less superSU(stable v2.76) {http://forum.xda-developers.com/showthread.php?t=1538053}
3. Flash it with TWRP(make sure you're on read-only mode, I'm stressing)
4. Reboot to system and download "System-less Xposed" ( Many don't know this. This is a mod of original xposed to fit in with system-less superSU for recieving OTAs) - http://forum.xda-developers.com/attachment.php?attachmentid=3783179&d=1465938666
5. Again, flash it with TWRP. Reboot and install the Xposed Installer - Material Version(only material detects system-less) - http://forum.xda-developers.com/xposed/material-design-xposed-installer-t3137758
6. When you see any OTA, download the incremental zip for your version.
7. Boot to TWRP and Restore the Boot Image you backed up.
8. Now, Flash the OTA zip through TWRP.
9. Repeat from step 1 for next OTA and benefit.
*** DONOT FLASH SUPERSU AND XPOSED AT ONCE. BOOT TO SYSTEM IN THE MIDDLE IS REQUIRED. SUPERSU SHOULD BE FLASHED FIRST. DONOT EDIT THE /system AFTER ROOTING
This problem prevails only for the OnePlus 3 because the boot image cannot be properly patched by SuperSU.
I cannot give a 100% surity for this to work but it will, as it did for me.
Can you upload your backup of boot image and recovery image,
I would like to try something.
Sent from my ONEPLUS A3003 using XDA-Developers mobile app
How did the backup work ?
Each time I try to back up I get fork error

How to use Magisk??? (add lost txt)

Hi to all
I have rooted OP3T and every time when I install new update, BETA small or full version zip file, I need again to install stock.zip from boatloader , then again, install TWRP and Super Su.
I hear that with Magisk I can easy install any update without lost TWRP and Root. I have flash Magisk and install from Google Store Magisk Manager.
So my question is how to install new update with Magisk and dont lost TWRP and Root?
Please tell me step by step
thx a lot for your answers
Magisk doesn't touch the recovery. And you'll still have to flash the Magisk zip since the boot image is updated whenever you update your system (Magisk modifies the boot image).
What does stay after an update (as long as you don't wipe /data) is any Magisk modules that you have installed. If you have a bunch of modules that change build.prop values, debloat system apps, change screen density, replaces system UI sounds, etc, you won't have to do those changes again after an update. They are found in the Magisk image in /data and will be loaded by Magisk at boot.
Even if you've wiped /data, it's just a matter of flashing the Magisk and module zips in TWRP after updating your system. No tedious manual editing of build.prop or deleting apps, etc. It literally takes seconds...
If you have issues with loosing TWRP after an update, you can easily fix that, right after updating. Just keep a copy of the recovery image on your device and flash it in TWRP.

[DEV][Help][pre-Magisked] Integrating Magisk into kernel

Hi, I am trying to make some kind of "pre-Magisked" kernel, so that, when I flash that kernel already contains the necessary files to Magisk Superuser, avoiding the need to flash Magisk after each kernel flash.
I know the current script patches the ramdisk image when installing it, but I cant see which changes are executed exactly. Tried some of them resulting in bootloop
So, is there a way to create a pre-Magisked kernel or, at least, integrate basic files and later manually install Magisk Manager APK? There was a way to do it in Nougat with SuperSU which doesnt work with Oreo anymore...
bamsbamx said:
Hi, I am trying to make some kind of "pre-Magisked" kernel, so that, when I flash that kernel already contains the necessary files to Magisk Superuser, avoiding the need to flash Magisk after each kernel flash.
I know the current script patches the ramdisk image when installing it, but I cant see which changes are executed exactly. Tried some of them resulting in bootloop
So, is there a way to create a pre-Magisked kernel or, at least, integrate basic files and later manually install Magisk Manager APK? There was a way to do it in Nougat with SuperSU which doesnt work with Oreo anymore...
Click to expand...
Click to collapse
No its not possible to have a pre magisk'd kernel as magisk sets up files in /data/adb which you cannot do later on otherwise magisk will be non functional, you must flash the zip after wiping your data.

Question How To Update System While Keeping Magisk

I have several modules in Magisk app and couple of apps having root authority after get root with Magisk (like Tasker). Now I want to update system while keeping my magisk apps and root-to-use apps working without any risk of stucking in reboot after install a new ROM.
Could I just firstly patch the boot.img of objective ROM in Magisk, replace the boot.img with magisk_pathed_XXXX.img and flash all the .img files needed? Will this way work? Or any other ways?
while flashing a newer rom version, the magisk modules are not deleted. After flashing the new version install magisk again and everything is working well. Before updatating the rom version "restore hide magisk by itself" if you have enabled it.
If you have modules like SmaliPatcher - These will cause a bootloop after update.
Disable all modules before any update and make sure to Restore the Magisk App if its hidden.
zuize411 said:
I have several modules in Magisk app and couple of apps having root authority after get root with Magisk (like Tasker). Now I want to update system while keeping my magisk apps and root-to-use apps working without any risk of stucking in reboot after install a new ROM.
Could I just firstly patch the boot.img of objective ROM in Magisk, replace the boot.img with magisk_pathed_XXXX.img and flash all the .img files needed? Will this way work? Or any other ways?
Click to expand...
Click to collapse
I take from your description that you are flashing a fastboot ROM. In that case you are correct, i.e.
take boot.img from new ROM, patch in Magisk and copy back into the original installation folder. Simplest is to rename the original boot image and name the new magisk boot image: boot.img
now you can simply start the installation batch and it will automatically install the magisk-patched boot.img
If you are using TWRP to flash the ROM this is not needed, just flash the corresponsing magisk installation ZIP/APK in TWRP right after the system update and BEFORE rebooting.
In addition @JazonX gave a good advice , but it really depends on which modules you use.

Categories

Resources