How to remove persistent /supersu dir from unrooted device? - SuperSU

Context: my motorola g4 is 5 years old and saw many different kinds of root attempts and amateurish handling (like modifying the system image) in its early days. I settled on magisk when it became a thing. Now I'm trying to go back to being rootless, including removing left-behind stuff like addon.d scripts.
TWRP shows a /supersu folder in the root fs, containing the usual apk, sh scripts, etc. I can delete this folder, but next time I boot my device (even just recovery!) it gets restored _somehow_. This is the only remaining trace of rooting I'm aware of, aside from the image just "not being untouched stock" anymore.
I'd like to get this folder permanently removed, without erasing my data.
Things I've tried:
- flash the stock rom: somehow it's defective (Package Installer crashes and I can't fix it by any means), despite it being the same zip I flashed two years ago and still use today, so this is not an option
- flashed stock boot
- unSU https://forum.xda-developers.com/showpost.php?p=63615067&postcount=2459
- installed supersu just to run its own unroot procedure, then ran unsu again, then flashed stock boot again
It just keeps coming back after every time I delete it and I'm out of ideas to stop it. All the threads I've found online offered only the above solutions that don't work.
Thanks for any good tips

@Marnes That sounds like it's TWRP's superuser. It won't exist if you are not booted to TWRP and it'll be repopulated everytime you boot to TWRP...

@Didgeridoohan I hadn't considered that possibility... I guess there's no way to verify it since checking after a regular boot if the folder is there would require rooting again. Thanks for the input!

Related

Boot loop on a HTC M9 (with 6.0), which was fine with systemless root in the past

My HTC M9 (with Android 6.0, HTC version number is 3.36.709.3) was working fine with Magisk(systemless framework)V3 + SuperSU v2.76 (mod by @topjohnwu) before last Friday. After a power shortage (running out of battery) of the device, the UI keep crashing and reboot. I can't do anything, therefore, I planned to backup and full-reset my device and start from beginning. But I found that I can't make any root work again. I had tried several combinations of flashable zip packages:
MagiskV3+SuperSUv2.76(mod, filename SuperSU-v2.76-magisk.zip )<=I use exact same package on my local storage, which was working in the past, therefore it can't be the issue of these archives
MagiskV3+SuperSUv2.76(mod, newer than file above, filename UPDATE-SuperSU-v2.76-magisk.zip)
UPDATE-SuperSU-v2.76-20160630161323.zip
SuperSU-v2.78-201609011115.zip
Once I flashed anyone of these zip combinations in TWRP (with no error message in screen) and reboot, the system will start boot looping, with no adb capability at all, therefore I don't know how to debug here.
(I believe that launch_daemonsu.sh had been ran since SuperSU.apk had been installed correctly and SuperSU.apk no longer in /data/ after reboot)
(And I've also tried to confirm patch status by extracting boot partition with sukernel and check if the boot partition is patched/fstab had been modified/scripts are added, they are)
But once I restore the boot.img from backup (no matter TWRP restore or fastboot flash boot), the system will boot correctly again.
I did restore TWRP backup between each test, and I even tried to restore RUU between each of test, no success.
Can anyone help to guide me how to debug in such situation?
Does it matter if my device is still S-ON?
I attache the log of SuperSU installer in TWRP for reference.
Is the systemless supersu from www.supersuroot.com/ even legit? On this kind of things my trust is all in XDA
cbroeter said:
Is the systemless supersu from www.supersuroot.com/ even legit? On this kind of things my trust is all in XDA
Click to expand...
Click to collapse
It is not.
There are people taking a number of my apps, registering domains, and putting them up without my consent. That site is one of the fakers (the guy behind it has many).
The APK and ZIPs they serve may be the originals, they might be modified. I don't know.
I've tried taking them down in the past, but it's a never-ending story. Can't even get Google to stop serving ads to these pages
For my stuff, only trust links from my own site (chainfire.eu) and the Play store.

TWRP, System writing, Supersu, Impossible?

I have had my fair share of problems modifying android before but I have never had a phone flat out lie to me and say an operation was successful and actually nothing happened at all.
Have had my nexus 6 for a year or so now. Have had minor issues rooting / modifying marshmallow in the past but I figured out it was all caused by the system partition having basically 0 free space. Made a huge mistake and installed to the latest 7.0 OTA. Wanted to simply enable tethering and edit the thermal config to not shut cores down. Should be as simple as pulling the files, editing them, pushing them back to the phone in twrp with the system partition mounted and thats the end of it right? Wrong.
First of all twrp 3.0.2 refuses to let me touch the system partition without some giant prompt about how its going to make itself stick and offer to root the phone. Simple enough I have seen it in previous versions I say yes as usual except twrp proceedes to immediately spew a bunch of superuser files that do nothing throughout the system partition without asking me if I want root. Dumb but whatever. I mount /system as read write and I go edit and replace my two files like usual (build.prop and thermal config). No matter if I ADB push or use twrps built in file manager it claims the file replacement is successful. Reboot into android and not only have both files not been touched (Verified by adb pull) but the recovery gets overwritten with the factory recovery anyways. (NEVER had issues with twrp sticking on marshmallow. Now after every reboot it gets wiped out)
Second of all if I select yes to twrp mounting system as writable and it does its spewing as I mentioned before then installing SuperSU instantly causes the phone to not boot. Rewrite the boot.img to factory and it boots fine OR Rewrite the clean factory system image and the SuperSU boot works fine. But modifying /system with twrp and then running supersu at the same time is a no go. TWRP is obviously doing something stupid to system that pisses off supersu so undoing twrps mess or uninstalling supersu makes it bootable again.
I dont even want root! Everyone is claiming you need to run "settings put global tether_dun_required 0" as root along with adding the usual "net.tethering.noprovisioning=true" in the build.prop to get native tethering working again! On 6.X only the build.prop edit was needed to get it working.
So long story short. I just want native tethering to work and to tweak my /system/etc/thermal-engine-shamu.conf . Is there anyone here who has done this successfully on nougat? I feel like its all twrps fault but im far too tired and frustrated to try another version tonight.
You must be running an old version of TWRP. Update to the latest, as the latest no longer offers to root your device for you. The version of superuser included was ancient and caused the device to bootloop.
As to TWRP being overwritten Android 7.0 I believe does that on a stock system. If I recall, there is a script that needs to be modified to prevent it.
Strephon Alkhalikoi said:
You must be running an old version of TWRP. Update to the latest, as the latest no longer offers to root your device for you. The version of superuser included was ancient and caused the device to bootloop.
As to TWRP being overwritten Android 7.0 I believe does that on a stock system. If I recall, there is a script that needs to be modified to prevent it.
Click to expand...
Click to collapse
It's stated in the op he's using twrp 3.0.2.
Didgeridoohan said:
It's stated in the op he's using twrp 3.0.2.
Click to expand...
Click to collapse
I misread his post then. I wonder if perhaps he is running TWRP via fastboot instead of installing it.
Flashing recovery using "fastboot flash recovery XXX.img"

Lost TWRP + Philz + System RW LB Lollipop 24.A.1.232 - Still Rooted, Help

I'm almost entirely new to messing around with stock firmware on a locked bootloader, its been unlocked for 2 years. I relocked it, TA keys are fine, I had TWRP, I was able to write to the system partition, I had external storage write permissions, and all of those things have dissapeared entirely. I was able to use an xposed module for getting external storage permission back.
-I can't install TWRP again because the installer on a locked bootloader requires the system to be remounted rw or already have access to a recovery.
-The xposed solution to the exteral sd isn't ideal, and again I need TWRP or to do it manually by mounting the system rw.
-FlashFire doesn't work regardless of what variation of options I give it.
-I pulled the kernel image out of the pre-rooted zip I initially used but it won't fastboot. It says USB debugging isn't enabled when I try it using flashtool, though it is on when the system is up. I was hoping that the rewrite permissions or possibly even TWRP would be available if I reflashed the kernel image. This won't work.
The reason for being on Lollipop is that for whatever reason, push notifications still really suck for me on Marshmallow, enough so that it isn't a workable option.
Having either TWRP or being able to remount the system rw would, from the look of it, lead to being able to fix the thing entirely.
The only workable solution I have right now is to flash stock Marshmallow, install TWRP which is rather easy on current MM, then reinstall the pre-made zip I already had for Lollipop. This is a huge pain given that I just put a lot of time into my setup and even just the settings I'm using in Xposed would in itself be difficult to restore as its quite a lot. Everything is backed up via Titanium.
Essentially, "Is there a workable solution to my problem that doesn't involve flashing MM, putting TWRP back, reflashing LP, then setting up what I know I need to all over again followed by the inevitable supprise down the line of still needing to re-do some of my apps that didn't quite go well? The goal is to get TWRP back, and this seems like it isn't going to happen if I can't write to the system.
??
Also, If I just pull /data entirely via adb, my laptop already uses ext4 for the filesystem, but it there a way in this scenario where I could absolutely ensure that I could do it, and then put it back while not screwing up file permissions assuming I did the whole falsh MM, install TWRP, flash LP thing?

Correct root and TWRP recovery for OOS 4.1.6 on OP3T - please.

I've been all over the OP3T forums looking for current information about the correct versions of TWRP and (Magisk or SuperSU) to use with stock OOS 4.1.6. I kept my old TWRP 3.0.4-1 and when I tried to apply SuperSU 2.79 SR3 I got an unusable system and had to restore from nandroid backup. I updated to TWRP 3.1.1-2 as per the Official TWRP app and now every time I try to reboot to system from TWRP it warns "No OS installed", but the reboot works fine. I have Magisk 13.2 ready to install but I'm reluctant until I know I have the right combination - the TWRP 3.1.1-2 backup is missing some partitions and I want to make sure I can at least recover my system if Magisk screws things up.
I've been all over the forums and all the relevant threads were closed months ago, or are written about OOS 4.0.3 or 4.1.1, or describes some hideous way someone turned their 3T into a pile of molten lava. Is there any current information about what combination of TWRP and a root zip will work with the latest OOS 4.1.6? Everything is stock except the unlocked bootloader. I don't want to flash a different ROM, I don't care about passing SafetyNet, I just want to root and go on with my life.
A couple of numbers is all I ask. I can't be the only one. Please - I've been without root for a week and it's bugging me.
TWRP 3.1.1-2 has got at least one major bug where it reports the OP3T as a OP3. That'll mess up your OP3T specific installations... Don't know if there are any other bugs, since I'm staying on 3.1.1-0 until they fix that bug. You also have the option of using blu_spark's TWRP. I've never tried it, but many users swears by it.
What works for me:
OOS 4.1.6
Franco Kernel r25
TWRP 3.1.1-0 (official)
Magisk v13.2
Magisk Manager 5.0.6
No issues whatsoever (for me)...
Thanks for that. I'd rather not change kernels, though. How likely is it that the same combination works with the stock kernel? Does anyone have that running?
OK, I tried it. Swiped the Magisk 13.2 zipfile in TWRP. The script ran partway through and then said "Can't mount system" in red letters. Now the phone boots into OOS, Magisk Manager is there and says "Rooted but no root permissions, not allowed?" It has reported several times that it needs to update, to the same version of Magisk and Manager that are already there. I allowed it to go through the cycle and reboot, with no change to behavior. When I try to run an app that needs root I get the permissions screen, but when I grant I get the dialog that says "Rooted Android required" - Either the su binary could not be found or you did not allow root permission..."
So, the phone works fine but unprivileged as before. I'd like to try clearing the cache, but since TWRP still reports no OS found (3.1.1-0 does this, just like -2) I don't really want to write into a system the recovery can't see. Besides, the existence of the su binary doesn't seem like something a cache clear will fix.
Advice?
OK, I tried it. Swiped the Magisk 13.2 zipfile in TWRP. The script ran partway through and then said "Can't mount system" in red letters. Now the phone boots into OOS, Magisk Manager is there and says "Rooted but no root permissions, not allowed?" It has reported several times that it needs to update, to the same version of Magisk and Manager that are already there. I allowed it to go through the cycle and reboot, with no change to behavior. When I try to run an app that needs root I get the permissions screen, but when I grant I get the dialog that says "Rooted Android required" - Either the su binary could not be found or you did not allow root permission..."
So, the phone works fine but unprivileged as before. I'd like to try clearing the cache, but since TWRP still reports no OS found (3.1.1-0 does this, just like -2) I don't really want to write into a system the recovery can't see. Besides, the existence of the su binary doesn't seem like something a cache clear will fix.
Advice?
Scratch that request. Things seem to be turning around - su works in terminal emulator, lets me ls privileged directories like /data. Root Explorer is working again. The only thing that isn't is AdAway, which can't write the hosts file. Otherwise the system seems to be rooted and working OK.
I'm still nervous that TWRP can't see that there's an OS on the phone, and I haven't seen any other reports of this.
It looks like Magisk can't mount /system read-write. Adaway won't install, and neither will Busybox. Titanium Backup also reports problems. I tried installing Busybox and the installation failed when it tried to remount system /rw.
Will look for solutions to this problem and report back here.
I've found many solutions to this problem, like installing busybox (Stericson Busybox apparently doesn't work in OOS 4.1.6, tried two others. Problem is, busybox will only install into a partition on /system, which requires that /system be read/write.
When I have issues with mounting system or anything like that, I go mount system myself in TWRP and it usually starts working after I reboot....I don't know why, it just works for me....if I see that error, that's the first place I go, everytime...
JMB2K said:
When I have issues with mounting system or anything like that, I go mount system myself in TWRP and it usually starts working after I reboot....I don't know why, it just works for me....if I see that error, that's the first place I go, everytime...
Click to expand...
Click to collapse
That won't work either. When I go to the Mount page in TWRP I can't get the checkbox next to /system to check. It just stays empty.
mobilityguy said:
That won't work either. When I go to the Mount page in TWRP I can't get the checkbox next to /system to check. It just stays empty.
Click to expand...
Click to collapse
I seem to remember having that problem once before.... Can't recall what I did, I think it involved something with the terminal... I'm not at my desk right now, I'll look into it shortly and see if I can remember
Problem solved. The more I looked at the symptoms, the more I realized that the OTA I took after unrooting with SuperSU corrupted the system partition somehow. The first time I tried applying the OTA with the stock recovery it failed, but I was able to reboot and apply 4.1.6. That's when the trouble began - I was unable to reapply SuperSU. Fortunately I had done a nandroid backup between the upgrade and the attempt to re-root, and after the SuperSU script failed I was able to restore the backup (made and restored using TWRP 3.0.4-1) and continue working. It was either at that point or earlier, during the OTA itself, that /system was damaged - not badly enough to prevent the phone from working perfectly well, but enough to keep TWRP from mounting /system read/write. From that point on I was doomed. None of my other attempts to fix the problem had a chance as long as TWRP was restricted to mounting /system read-only. Then it got worse.
After a semi-failed attempt to install Magisk (rooted applications worked as long as they didn't try writing to /system) I restored my pre-root 4.1.6 backup one more time. After that, TWRP wouldn't mount /system at all, which prevented me from making any more nandroid backups.
It was time to act. I could keep using the phone unrooted, but the longer I went on the more work would be required to put things completely right. The risk would increase because I couldn't take any more snapshots of the phone to fall back to if I munged the device again. I also had a positive reason to fix things - during the two days the phone was rooted but couldn't access /system, Titanium Backup kicked in and did a full backup of all my software and settings.
With a damaged file system and full backups, there was no reason for halfway measures. I copied all my user data off the phone and used LloydSmallwood's unbrick tool to flash the phone back to its original OOS 3.5.4 state. That took care of rebuilding all file structures. As soon as I rebooted, OOS upgraded to 4.1.6 in one step, taking care of the system upgrade. Unlocked the bootloader, installed TWRP 3.1.1-0 (not 3.1.1-2, which has a serious bug for the 3T as someone posted above). I was able to mount and unmount /system from TWRP's mount screen, no problem. Ran Magisk 13.3 script without a problem, installed Titanium Backup, and tested an app restore. No problem. I'm now in the midst of copying all my stuff back onto the phone, after which I'll restore all missing apps and be back in business (I hope).
It's possible I could have done something tricky like reformatting /system and restoring the partition from my last good nandroid backup. But I always would have been concerned that problems would have popped up later, maybe during the Android O upgrade, when it would be way too late to recover my then-current setup. After seeing virtually every combination of working and non-working features, it just made sense to build from a clean system.
So thanks have been given to LloydSmallwood for his absolutely indispensable unbrick tool (this is the second time it has saved my phone). I should also thank my Galaxy S3, running the current build of LineageOS, which has gotten me through the two days it took to set my OnePlus straight. The Galaxy has performed better than a five year old phone running brand-new software should ever be expected to - if it supported LTE I could consider using it as a daily driver. This has been an education, and a reminder of how important it is to keep good backups at every step throughout an upgrade - and routinely during production use.
Thanks to all who gave advice in this thread.

Can not Extract Zip

I've posted before/then it worked (once)/I deleted etc.
I read in another post to try to install busybox, I can not from the Manager.
I thought I'd screwed up the system R/W in TWRP (this is LineageOS 16.x on a Galaxy S5) but it is R/W.
It's not a critical thing, but does bug me. It's taken a month of twiddling everyday to get the phone JUST where I want it and everything working JUST the way I want them to - except this.
I've been looking for a zip of 19.3 (this did work fine with 18.x) to install via TWRP, but can not find one - I'm assuming that there might have been an error installing 19.x through the manager.
As I'm going to put the whole enchilada on my wifes phone this weekend (I REALLY don't need that to backfire ...), I'd like to figure this out. I have NOT tried installing the zips from recovery, but copied to a PC they are intact and the zip is not damaged.
MANY THANKS!

Categories

Resources