Unrooted, but can't remove superuser.apk - One (M7) Q&A, Help & Troubleshooting

My employer uses an enterprise email application (Good) that scans the device for root etc.
I restored my device to an old old backup that I made when I first got the device, but for some reason superuser.apk is still lingering around in my system folder.
I can confirm that the device is no longer rooted as superSU fails to find a binary, and my carrier OTA updates have been coming through fine.
However, that pesky superuser apk is sticking around, and I'm convinced that it is the reason my device is failing the compliance test with the software.
Any suggestions on how I can remove the superuser apk from the system directory? Preferably without blowing up my current android install?
I've dug high and low with no luck, and i'm hboot 1.57, so going S-Off and using an RUU to isn't an option.

SD360 said:
My employer uses an enterprise email application (Good) that scans the device for root etc.
I restored my device to an old old backup that I made when I first got the device, but for some reason superuser.apk is still lingering around in my system folder.
I can confirm that the device is no longer rooted as superSU fails to find a binary, and my carrier OTA updates have been coming through fine.
However, that pesky superuser apk is sticking around, and I'm convinced that it is the reason my device is failing the compliance test with the software.
Any suggestions on how I can remove the superuser apk from the system directory? Preferably without blowing up my current android install?
I've dug high and low with no luck, and i'm hboot 1.57, so going S-Off and using an RUU to isn't an option.
Click to expand...
Click to collapse
install superSU from the market .. then in superSU settings theirs cleanup / Full Unroot

clsA said:
install superSU from the market .. then in superSU settings theirs cleanup / Full Unroot
Click to expand...
Click to collapse
I actually still have SuperSU installed. The problem is that I no longer have a superuser binary, so supersu won't run. Just gives me the usual "There is no SU binary installed, and SuperSU cannot install it. This is a problem." error.
I'm starting to suspect that I might need to re-unlock and re-root just to do the cleanup and re-lock, which is frustrating. Was hoping to be able to avoid those big steps.

SD360 said:
I actually still have SuperSU installed. The problem is that I no longer have a superuser binary, so supersu won't run. Just gives me the usual "There is no SU binary installed, and SuperSU cannot install it. This is a problem." error.
I'm starting to suspect that I might need to re-unlock and re-root just to do the cleanup and re-lock, which is frustrating. Was hoping to be able to avoid those big steps.
Click to expand...
Click to collapse
yeah i know what you mean their

SD360 said:
I'm starting to suspect that I might need to re-unlock and re-root just to do the cleanup and re-lock, which is frustrating. Was hoping to be able to avoid those big steps.
Click to expand...
Click to collapse
(unless you are s-off), re-unlock -> yes, then just use a custom recovery.... custom recovery has root access to all your filesystem, there's no real need to "re-root" a full ROM.
you can accomplish pretty much anything in custom recovery

nkk71 said:
(unless you are s-off), re-unlock -> yes, then just use a custom recovery.... custom recovery has root access to all your filesystem, there's no real need to "re-root" a full ROM.
you can accomplish pretty much anything in custom recovery
Click to expand...
Click to collapse
Appreciated. I'll give it a shot. I just really want to avoid anything that's going to break my ability to get OTA updates again. It was a massive pain to get back to that point before.
I'll just be sure to dump my stock recovery before I do it.

SD360 said:
Appreciated. I'll give it a shot. I just really want to avoid anything that's going to break my ability to get OTA updates again. It was a massive pain to get back to that point before.
I'll just be sure to dump my stock recovery before I do it.
Click to expand...
Click to collapse
it's not as hard as you make it seem... their is a Guru Reset for nearly every version / brand phone and their really easy to use to get back to stock for OTA updates.
Returning to total stock, lock not relocked can be a bit more of a PITA but still doable as long as you s-off

clsA said:
it's not as hard as you make it seem... their is a Guru Reset for nearly every version / brand phone and their really easy to use to get back to stock for OTA updates.
Returning to total stock, lock not relocked can be a bit more of a PITA but still doable as long as you s-off
Click to expand...
Click to collapse
Not really worried about the locked/relocked flag. I don't think that's a check that good does. Pretty sure it just looks for certain files and conditions.
Unfrotunately there is no recent guru reset for my carrier (Rogers), and my device is trapped in S-On as my hboot is super new.
I was able to get twrp up and running, and manually removed all traces of root. Now just hoping I can get my stock recovery back. Hopefully will get me back into the game.

Related

Avoid losing root with OTA update.

Warning: crawrj mentioned this wouldn't flash in TWRP. I use CWM, so not sure whether it's compatible with TWRP (or any other recoveries) at the moment. So, if you're not using CWM... I would suggest waiting a bit.
So as most people know, the new OTA update aims to kill root on the device and the motochopper root method. Once I received the update and saw that it removed root, I immediately set out to figure out what was causing the issue. I also noticed that I was getting the notice about an application performing unauthorized tasks, or something to that effect.
After doing a few file deletions and restores, I finally found the file (KNOXAgent.apk) that was causing the notice about unauthorized actions and needing to restart. I've been running the phone with the MDL update for a little over a week now, and I haven't had another notice. I did lose root during the update, but was able to easily root it again with the motochopper method once the KNOXAgent files were removed.
So, here are the steps I took to avoid losing my root.
1) adb shell
2) su
3) mount -o remount,rw /dev/block/platform/msm_sdcc.1/by-name/system /system
4) rm /system/app/KNOXAgent.*
5) Reboot into recovery and flash the OTA zip provided below. It's the OTA update with the KNOXAgent patches removed from the updater-script. This will allow the update to continue installing without having an error about KNOXAgent not being found on the device.
The same process may have to be done with future OTA updates once KNOXAgent is removed, but it's better than losing your root method each time an OTA comes out. As I mentioned, I've been using this phone since May 13th with this being done. I also had to take out the My Files updates as well, since I have the CyanogenMod file browser (My Files doesn't have root support).
Unfortunately, it seems XDA has problems with filtering spam and requires that you have 10 posts before being able to post external links. Since I don't have anything else to post at the moment, and can't post on the development forums to report problems to developers in order to legitimately increase my count without having to spam threads I don't care about, you'll have to copy and paste the link to get the update package.
Update link: http://d-h.st/Dkl
RogueSly said:
So as most people know, the new OTA update aims to kill root on the device and the motochopper root method. Once I received the update and saw that it removed root, I immediately set out to figure out what was causing the issue. I also noticed that I was getting the notice about an application performing unauthorized tasks, or something to that effect.
After doing a few file deletions and restores, I finally found the file (KNOXAgent.apk) that was causing the notice about unauthorized actions and needing to restart. I've been running the phone with the MDL update for a little over a week now, and I haven't had another notice. I did lose root during the update, but was able to easily root it again with the motochopper method once the KNOXAgent files were removed.
So, here are the steps I took to avoid losing my root.
1) adb shell
2) su
3) mount -o remount,rw /dev/block/platform/msm_sdcc.1/by-name/system /system
4) rm /system/app/KNOXAgent.*
5) Reboot into recovery and flash the OTA zip provided below. It's the OTA update with the KNOXAgent patches removed from the updater-script. This will allow the update to continue installing without having an error about KNOXAgent not being found on the device.
The same process may have to be done with future OTA updates once KNOXAgent is removed, but it's better than losing your root method each time an OTA comes out. As I mentioned, I've been using this phone since May 13th with this being done. I also had to take out the My Files updates as well, since I have the CyanogenMod file browser (My Files doesn't have root support).
Unfortunately, it seems XDA has problems with filtering spam and requires that you have 10 posts before being able to post external links. Since I don't have anything else to post at the moment, and can't post on the development forums to report problems to developers in order to legitimately increase my count without having to spam threads I don't care about, you'll have to copy and paste the link to get the update package.
Update link: d-h.st/Dkl
Click to expand...
Click to collapse
Nice find
travisw0204 said:
Nice find
Click to expand...
Click to collapse
Thanks. It took a bit to find, but I couldn't live without root. My battery is GAWD with the CPU limited. :3
OK I am messing around with this and providing feedback. It doesn't install on the stock recovery for obvious reasons. It doesn't install in TWRP. Gives update binary error. Have to backup my extsd so I can format to fat32 to test other recoveries.
crawrj said:
OK I am messing around with this and providing feedback. It doesn't install on the stock recovery for obvious reasons. It doesn't install in TWRP. Gives update binary error. Have to backup my extsd so I can format to fat32 to test other recoveries.
Click to expand...
Click to collapse
Weird. Flashed for me on CWM when I used it.
RogueSly said:
Weird. Flashed for me on CWM when I used it.
Click to expand...
Click to collapse
Yeah I am guessing it will work in CWM. But I have to backup and format first to test. Which recovery did you use?
crawrj said:
Yeah I am guessing it will work in CWM. But I have to backup and format first to test. Which recovery did you use?
Click to expand...
Click to collapse
I've been using http://forum.xda-developers.com/showthread.php?t=2254323. I tend to stay away from touch recoveries when there are 4 dogs in the house.
Lol, too little too late for me. :facepalm:
Ok it installed on Garwynn's CWM but it didn't install the modem. Is that your results also? Won't install with OUDhs either. Gives error 7. I can confirm that root works without knoxagent installed. That is runny really. We find out right away that knox was causing the security warning. But since the kernel was so widely talked about as being the killer of root we completely overlooked knox as being more than just the alert Thanks for figuring that out.
Edit: Also installs on Agat's recovery but doesn't install the modem.
Edit Again: Ok just as an FYI this no longer is an issue. Chainfire has done it again. His latest SuperSU 1.30 fixes the root issues on MDL. You can use the stock kernel and leave knox alone.
crawrj said:
Ok it installed on Garwynn's CWM but it didn't install the modem. Is that your results also? Won't install with OUDhs either. Gives error 7. I can confirm that root works without knoxagent installed. That is runny really. We find out right away that knox was causing the security warning. But since the kernel was so widely talked about as being the killer of root we completely overlooked knox as being more than just the alert Thanks for figuring that out.
Edit: Also installs on Agat's recovery but doesn't install the modem.
Edit Again: Ok just as an FYI this no longer is an issue. Chainfire has done it again. His latest SuperSU 1.30 fixes the root issues on MDL. You can use the stock kernel and leave knox alone.
Click to expand...
Click to collapse
Awesome! Glad to hear it's fixed. Not sure why the modem didn't install. I didn't get any errors on my device after taking out the patches for My Files and KNOXAgent, as both were missing on my system. I'll try restoring back to MDC and updating to SuperSU 1.3 to test it.
crawrj said:
Ok it installed on Garwynn's CWM but it didn't install the modem. Is that your results also? Won't install with OUDhs either. Gives error 7. I can confirm that root works without knoxagent installed. That is runny really. We find out right away that knox was causing the security warning. But since the kernel was so widely talked about as being the killer of root we completely overlooked knox as being more than just the alert Thanks for figuring that out.
Edit: Also installs on Agat's recovery but doesn't install the modem.
Edit Again: Ok just as an FYI this no longer is an issue. Chainfire has done it again. His latest SuperSU 1.30 fixes the root issues on MDL. You can use the stock kernel and leave knox alone.
Click to expand...
Click to collapse
I was going to ask an annoying question.... but decided it was annoying and did a search. here is what I found in the difference between SuperUser and SuperSU and SuperSU Pro ($2.49). Reference: http://android.stackexchange.com/qu...ruser-from-chainsdd-and-superuser-from-clockw
SuperSU improves everything about Superuser and adds more options. The free version offers faster notifications, there is possibility of disabling them for each app and a new interface, attractive and easy to handle. In addition, according to developer claims by using SuperSU you’ll enjoy higher speed from the apps that require root rights, especially on Android 4.0+. The paid version called SuperSU Pro provides the opportunity to keep root rights after a system update, which usually cancels these rights. Although the method is not guaranteed the option is very useful. We have password protection and advanced log configuration settings for each application.
You might also want to read SuperSU Brings Better SuperUser Root Permission Management to Android. Quoting from that article:
SuperSU is basically SuperUser on steroids. According to the developer, it “allows for advanced management of Superuser access rights for all the apps on your device that need root.”.
Edit: ::FacePalm:: What ever you do. Do not uninstall SuperUser after you install SuperSU. You will loose Root. LOL (Hey at least I can laugh at myself.) I am not worried about it yet... I know I will get it back eventually.
Edit 2: After reading the OP, all you have to do if you have TWRP Recovery installed is do the OTA, your update will install and you will automatically reboot into TWRP.
Go to Mount first and mount System.
Go to back to home and select Advanced.
Go to File Manager. NOTE: This can be very frustrating! Use BACK and Sort Options to reset Sorting if it keeps doing things you don't want it to do. Also (Up A Level) is handy. If you are on "/" directory, touch Sort Descending: Name and you will see System. Select Sysytem.
Now Sort Ascending you will see App. Select App.
Gentally and slowly Swipe down in the middle to reach Knox. I found 2 files. Select one at a time and delete them.
Reboot
Then rerun Motochopper Root method.
I am on Stock MDC still. So if you are on MDL I am not sure if this would work. Now follow the directions that I failed to see when you install SuperSU.
Install SuperSU. Open SuperSU and make sure SU binary is switched from SuperUser to SuperSU. Once you do that you can remove SuperUser.
Edit 3: Once you check to make sure SuperSU has Binary after a reboot... SuperSU will remove SuperUser for you. No need to do anything.
After all said and done... I am thinking that the TWRP stopped the OTA from installing. I have been extremely busy with work, so no time to read XDA lately has been stopping me from keeping up to date. I just need more time in the day.
crawrj said:
Ok it installed on Garwynn's CWM but it didn't install the modem. Is that your results also? Won't install with OUDhs either. Gives error 7. I can confirm that root works without knoxagent installed. That is runny really. We find out right away that knox was causing the security warning. But since the kernel was so widely talked about as being the killer of root we completely overlooked knox as being more than just the alert Thanks for figuring that out.
Edit: Also installs on Agat's recovery but doesn't install the modem.
Edit Again: Ok just as an FYI this no longer is an issue. Chainfire has done it again. His latest SuperSU 1.30 fixes the root issues on MDL. You can use the stock kernel and leave knox alone.
Click to expand...
Click to collapse
Well, crawrj.. I just rawly patched the modem.bin with the modem.img.p, and the baseband version and such still hasn't increased. My software version and baseband version are still showing MDC, while build number is showing MDL. The weird thing about it is the kernel also updated from its original. How does the modem not update when it's being directly flashed onto the partition? Trying to get all of my stuff over to MDL, if that's what it's supposed to be. It has the new boot sound and such, but the inconsistent version numbers make me hesitant that the update fully applied.
RogueSly said:
Well, crawrj.. I just rawly patched the modem.bin with the modem.img.p, and the baseband version and such still hasn't increased. My software version and baseband version are still showing MDC, while build number is showing MDL. The weird thing about it is the kernel also updated from its original. How does the modem not update when it's being directly flashed onto the partition? Trying to get all of my stuff over to MDL, if that's what it's supposed to be. It has the new boot sound and such, but the inconsistent version numbers make me hesitant that the update fully applied.
Click to expand...
Click to collapse
There is some kind of write protection of security that locks the modem down. I have tried 100 different ways of installing the modem and can't. It looks like the official installs are the only ones that work. So right now the ota is the only way to get the modem. But I am sure we will get it figured out in time.
Sent from my SPH-L720 using xda premium
crawrj said:
There is some kind of write protection of security that locks the modem down. I have tried 100 different ways of installing the modem and can't. It looks like the official installs are the only ones that work. So right now the ota is the only way to get the modem. But I am sure we will get it figured out in time.
Sent from my SPH-L720 using xda premium
Click to expand...
Click to collapse
Well, that sucks. I guess I will give up trying to flash it for now. Already removed KNOXAgent again and dropped faux's kernel on here. It's showing my build as MDL, so at least I don't get pestered by the update message.
aww come on lol too late for me too. I went through hell rooting my phone when i upgraded to MDL. I flashed the stock rom like 3 times before getting my phone rooted and the last piece of the puzzle were the knox files. Instead of deleting the files i froze them using the system tuner off from the playstore after i installed shabbat's custom kernel.
Do we know of a way to avoid all these run arounds to root on MDL by keeping the stock kernel and without removing knox???
tones160 said:
aww come on lol too late for me too. I went through hell rooting my phone when i upgraded to MDL. I flashed the stock rom like 3 times before getting my phone rooted and the last piece of the puzzle were the knox files. Instead of deleting the files i froze them using the system tuner off from the playstore after i installed shabbat's custom kernel.
Do we know of a way to avoid all these run arounds to root on MDL by keeping the stock kernel and without removing knox???
Click to expand...
Click to collapse
I think there are a few posts in the development sections that will help out with getting root on MDL. If it were me, I would just pull the SuperSU apk and unzip it. Grab the su binary out of there, push it to /system/xbin/, and then install SuperSU on the phone once it restarted. Now, I can't confirm that works... because I haven't had to get that dirty with rooting my phone. Motochopper worked perfectly fine when KNOXAgent was removed, so it should work if you have KNOXAgent frozen too.
Cf autoroot
wanna make sure I understand this right. I'm gonna flash this no knox update on top of forcesrom (which has knox removed), I should be ok right? but the modern still not install this way, is that correct? and I won't be able to update my modem until a new method comes out. do I got it all right? thanks! :thumbup::what:
gershee said:
wanna make sure I understand this right. I'm gonna flash this no knox update on top of forcesrom (which has knox removed), I should be ok right? but the modern still not install this way, is that correct? and I won't be able to update my modem until a new method comes out. do I got it all right? thanks! :thumbup::what:
Click to expand...
Click to collapse
That's apparently right, for now. I'm working on figuring out why the MDM partition won't flash. I tried to patch the files manually, as mentioned previously and here, but it seems that it didn't flash as the baseband didn't change?
Hopefully figure it out soon.
Getting E:Error in /external_sd/OTA 5-13-2013 (No Knox Agent), Status 7. Any advice?

Stock recovery and upgrading Lollipop with future OTAs after rooting

Hello everyone,
I'm back to a nexus 6 after a very short stint with a 6+.
A little background for my questions: This is the very first time that I rooted a phone. I'm rooting to only install these 3 apps:
adaway
titanium backup
greenify
I do not plan on using any custom ROMs or kernels.
I see from all the guides and tutorials that people also create a custom recovery whenever they root. I haven't done that yet and wasn't sure if I had to. I would like to maintain the stock recovery that I have currently so that I can go back to stock if I unRoot. My questions are:
1. Am I wrong in thinking that I can still use the stock recovery if I unRoot?
2. When a new OTA comes out and I flash it (since I'm rooted an no longer can install them automatically), will that also upgrade my still stock recovery properly?
3. Following up on the previous question, when I upgrade manually because I'm rooted, would that be a fresh install where I have to go in and configure things the way I like them again (system settings, apps and their settings, root the phone again, etc)?
Thanks in advance!
LordGrahf said:
Hello everyone,
I'm back to a nexus 6 after a very short stint with a 6+.
A little background for my questions: This is the very first time that I rooted a phone. I'm rooting to only install these 3 apps:
adaway
titanium backup
greenify
I do not plan on using any custom ROMs or kernels.
I see from all the guides and tutorials that people also create a custom recovery whenever they root. I haven't done that yet and wasn't sure if I had to. I would like to maintain the stock recovery that I have currently so that I can go back to stock if I unRoot. My questions are:
1. Am I wrong in thinking that I can still use the stock recovery if I unRoot?
2. When a new OTA comes out and I flash it (since I'm rooted an no longer can install them automatically), will that also upgrade my still stock recovery properly?
3. Following up on the previous question, when I upgrade manually because I'm rooted, would that be a fresh install where I have to go in and configure things the way I like them again (system settings, apps and their settings, root the phone again, etc)?
Thanks in advance!
Click to expand...
Click to collapse
1. No, you're not wrong. Recovery will stay stock and can be used normally
2. You can't simply flash the new OTA. This will not work manually nor automatically.
3. All you need to do is not flash the user data image and you will not loose your data, settings etc. You will loose root however. See bellow.
Google posts android stock images for each device typically before OTA hits your phone. That's what you want to grab and use for the update. Just make sure you don't run the automatic scripts that come with those images because you need to avoid flashing user data image.
OTA zip file does you no good unless you get your system back to unmodified stock.
Thank you sir!
obsanity said:
1. No, you're not wrong. Recovery will stay stock and can be used normally
2. You can't simply flash the new OTA. This will not work manually nor automatically.
3. All you need to do is not flash the user data image and you will not loose your data, settings etc. You will loose root however. See bellow.
Google posts android stock images for each device typically before OTA hits your phone. That's what you want to grab and use for the update. Just make sure you don't run the automatic scripts that come with those images because you need to avoid flashing user data image.
OTA zip file does you no good unless you get your system back to unmodified stock.
Click to expand...
Click to collapse
Based on the OP, it sounds like he has only rooted. Thus, the OTA will work fine. No need to flash image files.
Edit: I see that at least one other member has stated that an unroot still did not allow OTAs to function. That's a bit strange and unique. Not sure what root is modifying to prevent the OTA.
I'm kinda curious myself. I had no idea root killed OTA's. Maybe I wouldn't have done that if I knew that. I'm very new to the Nexus device. It's my 1st. I unlocked the bootloader and rooted already.
Sent from Mark's Nexus 6
crowbarman said:
Edit: I see that at least one other member has stated that an unroot still did not allow OTAs to function. That's a bit strange and unique. Not sure what root is modifying to prevent the OTA.
Click to expand...
Click to collapse
This is pretty scary. So you can unroot and GI back to stock and still can't update in anyway?
I have always side-loaded OTAs, I have never flashed anything.
After installing an OTA, on the next reboot, Android takes some time to optimize all your apps. Does this also happen after flashing a new system image? Thanks!
LordGrahf said:
This is pretty scary. So you can unroot and GI back to stock and still can't update in anyway?
Click to expand...
Click to collapse
not sure what you mean by GI, but according to some others, after uninstalling root via SuperSU an OTA will still not install. This should not be the case unless the boot or recovery images are modified. Easily fixed by following the procedures above to fastboot the stock images on your phone.
kjnangre said:
I have always side-loaded OTAs, I have never flashed anything.
After installing an OTA, on the next reboot, Android takes some time to optimize all your apps. Does this also happen after flashing a new system image? Thanks!
Click to expand...
Click to collapse
Yes, it behaves exactly the same.
crowbarman said:
Based on the OP, it sounds like he has only rooted. Thus, the OTA will work fine. No need to flash image files.
Edit: I see that at least one other member has stated that an unroot still did not allow OTAs to function. That's a bit strange and unique. Not sure what root is modifying to prevent the OTA.
Click to expand...
Click to collapse
Root on Lollipop is not what it used to be. There are files that need to be modified in order to allow root. That's why this time OTA will fail if you are rooted.
Un-rooting however, will allow OTA as long as it is done properly and all traces are covered up and returned to stock. If it does fail after you have un-rooted, go back to the developer of that un-root method and let the know they missed something.
Here is the best way to un-root. Flash all of the old stock images besides user data image.
obsanity said:
Root on Lollipop is not what it used to be. There are files that need to be modified in order to allow root. That's why this time OTA will fail if you are rooted.
Un-rooting however, will allow OTA as long as it is done properly and all traces are covered up and returned to stock. If it does fail after you have un-rooted, go back to the developer of that un-root method and let the know they missed something.
Here is the best way to un-root. Flash all of the old stock images besides user data image.
Click to expand...
Click to collapse
That makes sense. Is there a manual root procedure or list of required modifications for root out there? I did some precursors searches but Came up empty. Can't tell what's missing in SuperSU unroot without those details.
crowbarman said:
That makes sense. Is there a manual root procedure or list of required modifications for root out there? I did some precursors searches but Came up empty. Can't tell what's missing in SuperSU unroot without those details.
Click to expand...
Click to collapse
Explanation from Chainfire:
https://plus.google.com/113517319477420052449/posts/S5zoKTzKUW1
obsanity said:
Explanation from Chainfire:
https://plus.google.com/113517319477420052449/posts/S5zoKTzKUW1
Click to expand...
Click to collapse
Thanks for this. A good read, but I'm surprised nobody has demanded more details than 'patched the policies in SELinux'. Not that I don't trust Chain fire (I do) , but who really knows what has been done to our phones?
crowbarman said:
Thanks for this. A good read, but I'm surprised nobody has demanded more details than 'patched the policies in SELinux'. Not that I don't trust Chain fire (I do) , but who really knows what has been done to our phones?
Click to expand...
Click to collapse
That's the problem with Chainfire's work... he does not release source.
Again, best un-root method is to flash original images less user data.
obsanity said:
That's the problem with Chainfire's work... he does not release source.
Again, best un-root method is to flash original images less user data.
Click to expand...
Click to collapse
Thanks for sharing this info. Its a bit concerning tbh. Is there a cleaner way to root other than using superSU?
LordGrahf said:
Thanks for sharing this info. Its a bit concerning tbh. Is there a cleaner way to root other than using superSU?
Click to expand...
Click to collapse
I'm afraid not but Chainfire's is probably the cleanest possible. Koush was the one with an open source solution but he hasn't updated his to 5.0 yet.
obsanity said:
I'm afraid not but Chainfire's is probably the cleanest possible. Koush was the one with an open source solution but he hasn't updated his to 5.0 yet.
Click to expand...
Click to collapse
There is an argument that publishing the method would allow Google to close it that much quicker, I suppose.
crowbarman said:
Thanks for this. A good read, but I'm surprised nobody has demanded more details than 'patched the policies in SELinux'. Not that I don't trust Chain fire (I do) , but who really knows what has been done to our phones?
Click to expand...
Click to collapse
The base changes and reasoning for those changes are actually documented on my website. Specific policy adjustments are present in plain text in the supolicy executable, as any hex editor will show you. Those who really wanted to know rather than whine about OSS, know.
By far most policy adjustments just drop audit log output for contexts that are already permissive, though.
All that information is still completely useless unless you understand SELinux in detail and how it's implemented on Android, though.
I assume that the encryption doesn't get in the way of being able to flash the images?
When I went from 5.0 to 5.0.1 on my old Nexus 5 all I did was flash the two new 5.0.1 images I extracted from the full factory image, then re-rooted. This is far cleaner than reverting back to the previous image then doing an OTA. I've not had to update my N6 yet so I don't know if my method will work still, but I hope it does.
Chainfire said:
The base changes and reasoning for those changes are actually documented on my website. Specific policy adjustments are present in plain text in the supolicy executable, as any hex editor will show you. Those who really wanted to know rather than whine about OSS, know.
By far most policy adjustments just drop audit log output for contexts that are already permissive, though.
All that information is still completely useless unless you understand SELinux in detail and how it's implemented on Android, though.
Click to expand...
Click to collapse
Thanks for the additional information.
I did spend a fair amount of time reading your documentation but failed to utilize a hex editor. I am not 'whining' about the lack of open source, rather, simply mildly surprised, but your website aptly describes the challenges with 5.0. Many are used to various root methods being available.
Your solution is fine with me.. I love your work.
Edit: I thought I'd add that the discussion has devolved from the OP, which was whether an OTA can be applied after uninstalling root. The answer was no, due to the unknowns about what still might be modified following the uninstall via SuperSU.

Updating after root

Forgive me if this has been asked before. I did search, but I couldn't seem to find an answer to this.
I have a dev edition model. I really want to root, but have been holding off because there are bugs with the current build of Lollipop and I'm kind of hoping Moto will release a 5.02 update soon to kill the memory leak and other issues. That being said, I have really been itching for root.
If I did root, what would I have to do to this phone to update it to the new version? Would I have to completely return to stock and wipe? Or could I ADB sideload? Seems like I was reading that you can't update at all when you're rooted, even if you disable root.
Without any idea how much longer it'll be before the next update, I'm finding it harder and harder to hold off on root, but I don't want to go through hell to get it back to stock and update it.
Thanks for any help and sorry if this has already been asked.
From what I understand, root is fine. It is installing a custom recovery that will stop you from getting the OTA. You can very easily undo root. As a matter if fact, you can pretty easily reinstall the stock recovery also.
diggitydogg said:
From what I understand, root is fine. It is installing a custom recovery that will stop you from getting the OTA. You can very easily undo root. As a matter if fact, you can pretty easily reinstall the stock recovery also.
Click to expand...
Click to collapse
Thanks for the reply.
Most of the time, that's true. I have updated a lot of phones by simply unrooting, applying the update, and rooting again, or using ADB sideload and then just rooting. But from what I have been reading about the Moto X 2014, you have to completely restore it back to stock before doing anything, even if you just use the temp boot method to root.
Is that wrong? I can't seem to find any info that confirms either way.
I've installed custom recovery, how can I reverse it and install the original recovery for update?
One advantage of root is you'll have Titanium Backup, so even if you do have to do a full wipe before applying the update, you could just update it and restore everything back quickly using TiBu. With lollipop, apparently the update file checks for the entire system checksum as a whole instead of each file so any slight modification to the system will mostly require pure stock and this is the same even with the nexus. So yeah, you most likely have to wipe your device before updating. I'd say, wait till Xposed for Lollipop is out, its almost there, once it comes out go ahead and root it, it'll at least be worth the hassle then
If you're rooted with lollipop and want to take an OTA update you can flash stock recovery and the stock system image. At that point you should still have all apps/data and be able to take a OTA update. The recovery and system files should be the exact version you already have and of course anytime you flash realize you could lose data!
Steve-x said:
If you're rooted with lollipop and want to take an OTA update you can flash stock recovery and the stock system image. At that point you should still have all apps/data and be able to take a OTA update. The recovery and system files should be the exact version you already have and of course anytime you flash realize you could lose data!
Click to expand...
Click to collapse
Right. All you need to do is flash the stock /system partition and also the recovery if you replaced it. I don't know why everyone's talking about having to wipe the entire phone with the all the stock images.

I do not want to take OTA system updates...

I've unlocked the bootloader and rooted the phone with the help of the Nexus Root Toolkit by WugFresh.
I now have it setup just how I want it and I don't want an OTA to kill root or change anything so something stops working (phone isn't for me, but I've set it up just right for someone with special needs).
I've read conflicting information on whether or not an OTA will actually install on a rooted phone or not. Some things say that it won't if you've changed anything at all while others say it might be possible.
Is there some system file I can rename or something to ensure the phone doesn't get a system update unless I do it manually?
LaTropa64 said:
I've unlocked the bootloader and rooted the phone with the help of the Nexus Root Toolkit by WugFresh.
I now have it setup just how I want it and I don't want an OTA to kill root or change anything so something stops working (phone isn't for me, but I've set it up just right for someone with special needs).
I've read conflicting information on whether or not an OTA will actually install on a rooted phone or not. Some things say that it won't if you've changed anything at all while others say it might be possible.
Is there some system file I can rename or something to ensure the phone doesn't get a system update unless I do it manually?
Click to expand...
Click to collapse
no matter how many times you will try to update via ota, you will not be able to. if any files change from stock, any at all, you wont be able to install an ota. especially with root.
LaTropa64 said:
I've unlocked the bootloader and rooted the phone with the help of the Nexus Root Toolkit by WugFresh.
I now have it setup just how I want it and I don't want an OTA to kill root or change anything so something stops working (phone isn't for me, but I've set it up just right for someone with special needs).
I've read conflicting information on whether or not an OTA will actually install on a rooted phone or not. Some things say that it won't if you've changed anything at all while others say it might be possible.
Is there some system file I can rename or something to ensure the phone doesn't get a system update unless I do it manually?
Click to expand...
Click to collapse
Root solved your problem ha ha
simms22 said:
no matter how many times you will try to update via ota, you will not be able to. if any files change from stock, any at all, you wont be able to install an ota. especially with root.
Click to expand...
Click to collapse
And sometimes, even if one is 100% stock, those pesky OTAs won't install.
cam30era said:
And sometimes, even if one is 100% stock, those pesky OTAs won't install.
Click to expand...
Click to collapse
right. any system file changes prevent install.
Awesome. Thanks.
Will it even attempt to install an update, and if so, does it only attempt once and then give up so you don't get stuck in a loop?
Install a custom recovery. Done. OTAs require the stock recovery in order to flash files.
LaTropa64 said:
Awesome. Thanks.
Will it even attempt to install an update, and if so, does it only attempt once and then give up so you don't get stuck in a loop?
Click to expand...
Click to collapse
itll only attemp if you let it(it needs your approval to update), otherwise itll only tell you that an update is available. if you let it, itll try, but fail. if you boot up, youll be where you were before.
Apparently I rooted it incorrectly because it was able to update. I just got a call and the phone had rebooted and went through optimizing X of X apps and now many of the tasker profiles I had set are no longer working.
It wouldn't have optimized a bunch of apps if it hadn't updated the OS, or no?
LaTropa64 said:
Apparently I rooted it incorrectly because it was able to update. I just got a call and the phone had rebooted and went through optimizing X of X apps and now many of the tasker profiles I had set are no longer working.
It wouldn't have optimized a bunch of apps if it hadn't updated the OS, or no?
Click to expand...
Click to collapse
you can always look at your android version in aboy phone, to see if it updated or not.
LaTropa64 said:
Apparently I rooted it incorrectly because it was able to update. I just got a call and the phone had rebooted and went through optimizing X of X apps and now many of the tasker profiles I had set are no longer working.
It wouldn't have optimized a bunch of apps if it hadn't updated the OS, or no?
Click to expand...
Click to collapse
You'll find update or not optimizing apps happens a lot especially if you clear cache etc...
Your fine otas can't install with root
Just flash twrp it will cone in handy incase you brick it one day you'll have twrp to fastboot fix or sideload a rom to recover from.
ONE NOTE: Never ever ever relock your bootloader with the toolkit you'll be screwed. Always leave bootlaoder unlocked. I just had to rma manufacturer phone replacement I relock mine with toolkit and couldn't flash stock firmware or oem unlock again.
Sent from my LGMS769 using XDA Free mobile app
simms22 said:
you can always look at your android version in aboy phone, to see if it updated or not.
Click to expand...
Click to collapse
I'll take a look the next time I get over there. It's not my phone, I just set it up for someone with accessibility issues and wanted it to stay the same as the day I set it up but apparently it's not done that.

Can a rooted phone be updated?

Can a rooted phone be updated? If i root my razor, will i be able to update without re-rooting?
ChronosTrigger said:
Can a rooted phone be updated? If i root my razor, will i be able to update without re-rooting?
Click to expand...
Click to collapse
No, it fails to install. You need to reflash the stock boot image to take an OTA.
Confused still
CurtisMJ said:
No, it fails to install. You need to reflash the stock boot image to take an OTA.
Click to expand...
Click to collapse
I'm Sorry i'm so nooby in this regard.
So do you mean i have to basically get the stock ROM back again.
Then I can re-root like i did with the earlier version?
ChronosTrigger said:
I'm Sorry i'm so nooby in this regard.
So do you mean i have to basically get the stock ROM back again.
Then I can re-root like i did with the earlier version?
Click to expand...
Click to collapse
Yes. Razer's update engine doesn't seem to have the option to download full images like some other OEMs, so only fully stock ROM can be upgraded.
On that note, Razer seems to have set a week as the delay for releasing factory images, so if you want to keep root you might want to wait after an OTA, though we may be able to reproduce a slot earlier if someone captures the OTA package (but it's not as verifiable of course)
CurtisMJ said:
Yes. Razer's update engine doesn't seem to have the option to download full images like some other OEMs, so only fully stock ROM can be upgraded.
On that note, Razer seems to have set a week as the delay for releasing factory images, so if you want to keep root you might want to wait after an OTA, though we may be able to reproduce a slot earlier if someone captures the OTA package (but it's not as verifiable of course)
Click to expand...
Click to collapse
WARNING: This file is really intended for a developer to use in making a rooted slot. Flashing the file below could? remove root or cause other issues if you're rooted. Brick maybe? Although, mostly likely, it won't flash at all if you are rooted.
I used adb to capture the Razer Phone 2 MR2 OTA. It's located here.
I also downloaded it... but figure y'all would prefer a link straight to the Google source
SHA1 is the file name so you can verify it. E9F494FACBF8B7A6DF32F342C84459A7051ACE24
The SHA256 I calculated was: FF571E225BC81C8D450964E0C7BA28DF13E963798F9E5AF7E7C142DE7FBE51A5
translucentfocus said:
WARNING: Flashing the file below could? remove root or cause other issues if you're rooted. Brick maybe? I'm not rooted, just trying to help people get the files they need.
I used adb to capture the OTA. It's located here.
I also downloaded it... but figure y'all would prefer a link straight to the Google source
SHA1 is the file name so you can verify it. E9F494FACBF8B7A6DF32F342C84459A7051ACE24
The SHA256 I calculated was: FF571E225BC81C8D450964E0C7BA28DF13E963798F9E5AF7E7C142DE7FBE51A5
Click to expand...
Click to collapse
So With this. You can root, AND if they have any Update for the phone in the future, I can Update it without losing my root?
ChronosTrigger said:
So With this. You can root, AND if they have any Update for the phone in the future, I can Update it without losing my root?
Click to expand...
Click to collapse
Not quite... The update will likely fail to apply due to checksum failures. If it did go through it would probably brick the kernel so that's a good thing. Sorry, there's not really a way to automatically root after official OTAs as they update block by block between two known states, and neither is rooted. It's just sort of not possible, by design. You have to unroot, update and root again.
The OTA package translucentfocus has provided allows us to reproduce a single slot before the week's wait for the factory image so we can root sooner.
translucentfocus said:
WARNING: Flashing the file below could? remove root or cause other issues if you're rooted. Brick maybe? I'm not rooted, just trying to help people get the files they need.
I used adb to capture the OTA. It's located here.
I also downloaded it... but figure y'all would prefer a link straight to the Google source
SHA1 is the file name so you can verify it. E9F494FACBF8B7A6DF32F342C84459A7051ACE24
The SHA256 I calculated was: FF571E225BC81C8D450964E0C7BA28DF13E963798F9E5AF7E7C142DE7FBE51A5
Click to expand...
Click to collapse
which OTA is this? Also how to update
xterminater07 said:
which OTA is this? Also how to update
Click to expand...
Click to collapse
Sorry, I didn't specify. It's the MR2 update for the Razer Phone 2. Original reply has been also updated with version information in bold.
How to update? Actually, I posted the OTA because it's really for someone to make a slot with root before Razer releases the Factory MR2 Images--as @CurtisMJ mentioned previously.
CurtisMJ said:
Yes. Razer's update engine doesn't seem to have the option to download full images like some other OEMs, so only fully stock ROM can be upgraded.
On that note, Razer seems to have set a week as the delay for releasing factory images, so if you want to keep root you might want to wait after an OTA, though we may be able to reproduce a slot earlier if someone captures the OTA package (but it's not as verifiable of course)
Click to expand...
Click to collapse
Sorry to bring back an old thread but just a few questions if you don't mind.
I just bought a used Razer 2 seems like the user rooted it (I was unaware) and it has been years since I rooted anything. I downloaded root checker and it said I was rooted. I assume I'm running the stock rom, though magisk manager was installed on the phone when I turned it on so I guess it's not stock. I guess this means I can not take any OTA or it could brick? I went into system update and it still checked to make sure I was up to date so maybe OTA isn't disabled? So much has changed with apps and rooting since I messed with it that I don't know enough and I don't want to brick or bootloop the device.
Thanks
Univsoldur said:
Sorry to bring back an old thread but just a few questions if you don't mind.
I just bought a used Razer 2 seems like the user rooted it (I was unaware) and it has been years since I rooted anything. I downloaded root checker and it said I was rooted. I assume I'm running the stock rom, though magisk manager was installed on the phone when I turned it on so I guess it's not stock. I guess this means I can not take any OTA or it could brick? I went into system update and it still checked to make sure I was up to date so maybe OTA isn't disabled? So much has changed with apps and rooting since I messed with it that I don't know enough and I don't want to brick or bootloop the device.
Thanks
Click to expand...
Click to collapse
Yes, that sounds about right. When rooted the OTA function doesn't disable right away. Only after its downloaded an update and actually tries to apply it it'll refuse. The new Android update engine is pretty good at not bricking. My guess is probably stock. If it's rooted, then the bootloader is unlocked, and it's not too bad. For magisk root at least all you need to do is flash the stock boot image and the OTA will apply. With factory images around and an unlocked bootloader you'll have a hard time bricking it. Just don't untick "OEM Unlocking" in developer options. Ever. (Or at least until you've fully restored stock firmware. It's supposed to be disabled so you can't make that mistake but Magisk hide tricks the firmware into believing the bootloader is locked so it's enabled. Whaddayagonnado)
CurtisMJ said:
Yes. Razer's update engine doesn't seem to have the option to download full images like some other OEMs, so only fully stock ROM can be upgraded.
On that note, Razer seems to have set a week as the delay for releasing factory images, so if you want to keep root you might want to wait after an OTA, though we may be able to reproduce a slot earlier if someone captures the OTA package (but it's not as verifiable of course)
Click to expand...
Click to collapse
CurtisMJ said:
Yes, that sounds about right. When rooted the OTA function doesn't disable right away. Only after its downloaded an update and actually tries to apply it it'll refuse. The new Android update engine is pretty good at not bricking. My guess is probably stock. If it's rooted, then the bootloader is unlocked, and it's not too bad. For magisk root at least all you need to do is flash the stock boot image and the OTA will apply. With factory images around and an unlocked bootloader you'll have a hard time bricking it. Just don't untick "OEM Unlocking" in developer options. Ever. (Or at least until you've fully restored stock firmware. It's supposed to be disabled so you can't make that mistake but Magisk hide tricks the firmware into believing the bootloader is locked so it's enabled. Whaddayagonnado)
Click to expand...
Click to collapse
Thanks for the detailed response I managed to get up with the previous owner on swappa last night. He told me he unlocked the phone but never actually got around to rooting it. He also said it is running stock and the reason magisk is still on the phone after a wipe is because magisk persists after a wipe.
Messages from him.
Sorry about that, I did unlock the bootloader but I never actually got around to rooting. I usually relock the bootloader before I sell it but I completely forgot. You can apply an ota because I never installed a custom recovery, something else I didn't get around to doing. You can easily relock the bootloader using adb. If you need help with this let me know and I can walk you through it. But the bootloader being unlocked has zero effect on ota's. You are all good to go as far as that goes.
Oh no you're absolutely fine with an ota. I just looked it up and you're absolutely right, magisk does survive a reboot now. Since I didn't load a custom recovery though an ota will install just fine. Although when an ota does install though it will most likely remove magisk because it will write over the boot.img with the factory one. Here is the link to the factory images. It includes instructions on how to install it. But honestly a new ota should be released any time now since the last one I think was November. Once that installs you will be completely back to stock.
Does this sound accurate to y'all. Thanks again
@Univsoldur His knowledge seems a little dated. Kind of how mine was a few months ago Anyways here goes:
If a root checker says it's rooted then it probably is. I'm not sure why he says it isn't.
Magisk does indeed persist through a data wipe. I wasn't aware magiskinit could unpack the manager APK though. Neat
He's right in that an unlocked bootloader won't affect OTAs, but having magisk installed will.
The RP2 uses the new A/B update scheme. In this case it doesn't matter whether a custom recovery was ever installed. Recovery mode is not used during the process of installation. Unfortunately the new update scheme is also heavily based on deltas, even on the kernel image, so OTAs will be broken as it won't be able to retrieve a full kernel image from the OTA servers. Some OEMs' ROMs can do that, but Razer's can't. You can flash the factory images if you truly want a clean start, but to fix OTAs and remove magisk, reflashing just the kernel image with one from the factory image should be sufficient. The magisk uninstaller won't work due to the data wipe so that's probably the only option.
CurtisMJ said:
@Univsoldur His knowledge seems a little dated. Kind of how mine was a few months ago Anyways here goes:
If a root checker says it's rooted then it probably is. I'm not sure why he says it isn't.
Magisk does indeed persist through a data wipe. I wasn't aware magiskinit could unpack the manager APK though. Neat
He's right in that an unlocked bootloader won't affect OTAs, but having magisk installed will.
The RP2 uses the new A/B update scheme. In this case it doesn't matter whether a custom recovery was ever installed. Recovery mode is not used during the process of installation. Unfortunately the new update scheme is also heavily based on deltas, even on the kernel image, so OTAs will be broken as it won't be able to retrieve a full kernel image from the OTA servers. Some OEMs' ROMs can do that, but Razer's can't. You can flash the factory images if you truly want a clean start, but to fix OTAs and remove magisk, reflashing just the kernel image with one from the factory image should be sufficient. The magisk uninstaller won't work due to the data wipe so that's probably the only option.
Click to expand...
Click to collapse
So you think to get it back to stock I could just go here.
https://developer.razer.com/razer-phone-dev-tools/factory-images/
Will that remove magisk and return it back to stock I would assume there is no threat of flashing the stock image. Besides that do I need to mess with the kernel?
I'm wondering if it would be possible to flash the unlocked Razer phone 2 firmware to the AT&T version. Would the bootloader need to be unlocked?
Univsoldur said:
So you think to get it back to stock I could just go here.
https://developer.razer.com/razer-phone-dev-tools/factory-images/
Will that remove magisk and return it back to stock I would assume there is no threat of flashing the stock image. Besides that do I need to mess with the kernel?
Click to expand...
Click to collapse
Yes, that will return it to stock and remove Magisk. No, if you flash the factory image you don't need to do anything further with the kernel.
---------- Post added at 11:14 PM ---------- Previous post was at 11:11 PM ----------
DrGonzo6o said:
I'm wondering if it would be possible to flash the unlocked Razer phone 2 firmware to the AT&T version. Would the bootloader need to be unlocked?
Click to expand...
Click to collapse
The bootloader needs to be unlocked, yes. I had the unlocked one from the start, so I can't comment on how well that will work though.
Has anyone with an AT&T version successfully flashed unlocked firmware?
Univsoldur said:
So you think to get it back to stock I could just go here.
https://developer.razer.com/razer-phone-dev-tools/factory-images/
Will that remove magisk and return it back to stock I would assume there is no threat of flashing the stock image. Besides that do I need to mess with the kernel?
Click to expand...
Click to collapse
I did post a full unroot guide...

Categories

Resources