yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] azrash:
I was updating my setup from CM 4.2.2 To 4.3 and in recovery, I have already wiped /system. Was going to fastboot flash bootloader and radio but I forgot that I got it locked!

Luckily I remembered your work here. Did a quick Google for osmosis boot unlock and adb pushed the zip file in recovery, flashed it, and all is well :)

Just sharing my experience, which is most likely the same with everyone else's.

Thanks again for your work!
[Android Software/Hacking General [Developers Only]] shoey63:
What a great set of tools!

Can't wait to try the nano file editor:thumbup:
[Android Software/Hacking General [Developers Only]] leolawliet:
Awesome tweaks :good: *subscribed*
[Android Software/Hacking General [Developers Only]] aerozolic:
Trying to get Nexus 5 back to stock but running the script gives me:

Verifying device...
Device: Unknown
Bootloader: Unknown

Unsupported device

Your system has not been changed.

Script will now exit...

E: Error in /data/media/0/cwm-Nexus.BootUnlocker.zip
(Status 1)
Installation aborted
[Android Software/Hacking General [Developers Only]] Dylanballardlgv20:
Love the nee magisk modules! Busybox works flawlessly
[Android Software/Hacking General [Developers Only]] osm0sis:
diff boot.log boot-new.log

6c6
< d--------- 2 root root 4096 /.backup
---
> drwxr-xr-x 2 root root 4096 /.backup
23c23
< -rwxr-x--- 1 root root 660 /init.magisk.rc
---
> -rwxr-x--- 1 root 2000 660 /init.magisk.rc
62c62
< ---------- 1 root root 27 /.backup/.rmlist
---
> -rw-r--r-- 1 root root 27 /.backup/.rmlist
27c27
< -rw-r--r-- 1 root root 25810 /.backup/init.rc
---
> -rwxr-x--- 1 root root 25810 /.backup/init.rc
127c127
< -rwxr-xr-x 1 root root 143048 /sbin/magisk
---
> -rwxr-x--- 1 root 2000 143048 /sbin/magisk

Yup. Got this. :good: :cool:

I'll fix up mkbootfs and send it [MENTION=3292224]franciscofranco[/MENTION]'s way so it should be good for the next FK release. :highfive:
[Android Software/Hacking General [Developers Only]] mkhcb:
You rock! Thanks dude!!!!
[Android Software/Hacking General [Developers Only]] osm0sis:
Done. ;)

Did the bringup to AOSP's master HEAD in anticipation of Android O as well. :good:

Edit: Doh, missed one. I'll force-push the fix into the commit tomorrow.
[Android Software/Hacking General [Developers Only]] osm0sis:
You can extract it and put it wherever you want (not on /sdcard) and set executable permissions. You only need to prefix your commands with /path/to/busybox
[Android Software/Hacking General [Developers Only]] osm0sis:
Not stupid, just kind of unnecessary. You don't need symlinks if you don't have it in the path. You'd need to use the full path to the symlink, so you might as well use the full path to the busybox binary and add the applet name.
[Android Software/Hacking General [Developers Only]] sobriquet506:
Hi, I had been using your Busybox for Android NDK v1.27.1 module for Magisk v13.3 successfully for several days.

Last night, all applications previously recognizing and relying on busybox began to throw up "busybox not installed" warnings. I have no idea what lead to this change, don't remember doing anything that would impact busybox.

The module is still active in Magisk, and rebooting to deactivate then reactivate the module seemed to register successfully in Magisk, but applications still can't find busybox,

Further, after uninstalling the module in Magisk, I cannot install busybox from other sources (i.e. Busybox Free app).

Any help you might be able to offer would be hugely appreciated!
[Android Software/Hacking General [Developers Only]] osm0sis:
No such issues here, and not a lot to go on from your post..
[Android Software/Hacking General [Developers Only]] guest4711:
The text oft the errormsg and some logs would be fine to try to help you...

Try BusyBox (Install BusyBox) - https://f-droid.org/app/ru.meefik.busybox - it shows you the installed busybox and (optional) tries to delete the old one and to install another one.
[Android Software/Hacking General [Developers Only]] sobriquet506:
Thanks for the suggestion, as I mentioned I have https://play.google.com/store/apps/details?id=stericson.busybox installed, and back when busybox was working, this would list the correct version of busybox osm0sis - 1.27.1.

Now it says "busybox not installed". (The module is still loaded in Magisk, I can load/unload in Magisk, but nothing outside of Magisk recognizes that busybox is installed)

This app https://play.google.com/store/apps/details?id=stericson.busybox now cannot install busybox (regardless of whether I have osm0sis busybox installed in Magisk). It tries, but finishes with "busybox not installed", and suggests I change the install path. None of the install paths will install.

---------- Post added at 10:03 PM ---------- Previous post was at 10:02 PM ----------

What additional information would you like?
[Android Software/Hacking General [Developers Only]] guest4711:
Are you shure? I just tried the following in terminal

1|u0_a183@:/ $ busybox
/system/bin/sh: busybox: not found
127|u0_a183@:/ $ su
root@:/ # busybox
BusyBox v1.27.1-osm0sis (2017-07-20 09:41:40 ADT) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2015.
Licensed under GPLv2. See source distribution for detailed
copyright notices.

Usage: busybox [function [arguments]...]
or: busybox --list[-full]
or: busybox --install [-s] [DIR]
or: function [arguments]...

....
root@:/ #
[Android Software/Hacking General [Developers Only]] sobriquet506:
Pretty sure. This picture is from 8/3/2017, showing busybox installed.

[IMG="Installed OK"]http://i.imgur.com/SvJn8wM.png[/IMG]

Here it is today. (again, I didn't change anything related to magisk or busybox)

[IMG="vanished"]http://i.imgur.com/enhTEd3.png[/IMG]

Here is the loaded module in Magisk, which hasn't changed or reported any issues

[IMG="Magisk"]http://i.imgur.com/Cg9LtVx.png[/IMG]

Here is what happens when I try to install busybox from another source

[IMG="Can't install"]http://i.imgur.com/jNjB9M9.png[/IMG]

None of the install paths suggested by the app will install successfully.
[Android Software/Hacking General [Developers Only]] osm0sis:
Holy **** use [hide][/hide] tags. Also please don't link to busybox apps or other installers in my thread.

Well for starters you didn't provide logs or anything.

This is pretty clearly a problem with your Magisk installation, considering nothing would spontaneously change with a module. Re-flash Magisk and follow-up in the Magisk help threads.
[Android Software/Hacking General [Developers Only]] osm0sis:
Alright, got this fixed and tested. AK2 zips using my mkbootfs (a minority) are now fully stackable over Magisk root once they update to my latest binary. :cowboy:
[Android Software/Hacking General [Developers Only]] osm0sis:
Weird that Root Explorer just uses whatever busybox is around.. but yes, this has been reported, it's because Magisk doesn't set default context of unlabeled files to system_file at boot time like SuperSU and instead relies on the installer to set the correct contexts at install time.. I'm working on the installer fixes but it'll be a few days.

For now you could `chcon -hR 'u:object_r:system_file:s0' /magisk/busybox-ndk` and repeat for any other modules of mine. Then reboot and all should be well.
[Android Software/Hacking General [Developers Only]] broomer68:
I seem to have the same problem, but I think the problem is somewhere in between. Busybox seems invisable when su is not granted. Some apps check for busybox without invoking root, and fail to detect it, and then just quit working instead of asking for root and/or just execute the command.

Verstuurd vanaf mijn SHIELD Tablet K1 met Tapatalk
[Android Software/Hacking General [Developers Only]] guest4711:
Yes, that could be true:

1|u0_a183@:/ $ busybox
/system/bin/sh: busybox: not found
127|u0_a183@:/ $ su
root@:/ # busybox
BusyBox v1.27.1-osm0sis (2017-07-20 09:41:40 ADT) multi-call binary...

But on one device I own (having selinux relaxed) it is visible all the time...
[Android Software/Hacking General [Developers Only]] jcmm11:
losetup -f

Note the number of the loop device that returns

losetup /dev/block/loop<number from above> magisk.img
mount /dev/block/loop<number from above> /mountpoint

That should do the trick. The mount command may need some additional options, but should work without them. You may want to mount ro, in which case that should be specified. loop option shouldn't be needed. Neither should the file type.

It would be a bit simpler if losetup worked exactly the same as in a regular Linux distro, but it's a little different.
[Android Software/Hacking General [Developers Only]] osm0sis:
This is a different issue from his whole Magisk installation going screwy.

As for the su prompt thing, I had assumed that Magisk didn't give access when not root on purpose due to MagiskHide, but it must be related to the unlabeled context issue as well. Go ahead and run that command I posted yesterday.

Edit: Fixed version up on the Magisk Module Repo a couple days back, in case nobody noticed. :p

Thread update will be forthcoming. :good:
[Android Software/Hacking General [Developers Only]] jcmm11:
Any chance of a nano update to accommodate SBIN mode from the latest supersu? The file structure to handle that appears to be set as opposed to busybox for which a long-term solution still needs to be found.

I actually went to modify it myself but decided would be simpler to just install it manually. The Magisk code in there is making things slightly confusing (eg I can't find where you set the etc and bin variables for an su install. I'm certain I can figure it out, not sure if it's worth my effort. Although I think the Magisk and su installs are conflated and it's just some names that are confusing. It wasn't a very long look)
[Android Software/Hacking General [Developers Only]] martyfender:
This is concerning your busybox installer:

Will this work properly with the new SR2-SuperSU-v2.82, SBIN mode?

Thanks
[Android Software/Hacking General [Developers Only]] osm0sis:
Haha nonono, that'll take some work. It becoming closer in root method to phh's Superuser/Magisk (Core mode) but ditching su.img and xbin and the custom path, putting it all on /data and adding file_contexts will require a lot of my work to be rewritten.. It's only enabled by default on Android O, and it's only in SuperSU SR2 (basically Beta 2), so I'm going to wait a bit and see if he changes anything else before he goes stable with it.

I am currently testing it out on my OP5, so rest assured it's on my to-do list, but I'm not in any hurry.
[Android Software/Hacking General [Developers Only]] osm0sis:
Take 2 on the completed Magisk support. Should be good now, already up on the Module Repo since yesterday. :)

Also, the oft-delayed Flashlt update with Pixel support! :p

As for SBIN SuperSU, I looked into it last evening and there are some definite limiting factors, so I won't support it for now. Maybe after SR3 if it adds back the ability to have things systemlessly added to the PATH without having them be in /sbin itself.

I work on these projects in my limited time off, so if you like the progress I'm making, or enjoy anything else I've done on xda, please do hit the donate link from my profile. Thanks for your support!

UPDATE-Flashlt.Installer.v2.8-signed.zip:

- update installer to latest versions of set_perm, set_perm_recursive and file_getprop from my Complete Shell Zip Documentation

- fix support for paths/filenames with spaces

- improve trimming functionality, now avoiding mistaken removal of some trailing signatures

- update busybox binary (1.27.1) with the latest patches and fixes from my repo

- update Magisk support for full online installs in Magisk Manager

- fix flashіt --restore with Magisk

- fix flashіt --restore on devices with broken mount command by using busybox instead

- fix flashіt --restore and --uninstall /su and /magisk detection on more restrictive SELinux devices

- add support for /system/system device installation

- add a/b slot device detection to main script and automatically use the active slot if not specified with e.g. --slot _a or --slot _b via commandline

- add a/b slot device detection to recovery script zip and automatically use the active slot

UPDATE-adb.Installer.v1.0.36-signed.zip;

UPDATE-Adreno.Systemless.Installer-signed.zip;

UPDATE-Busybox.Installer.v1.27.1-ALL-signed.zip;

UPDATE-nano.Terminal.Editor.v2.8.6-signed.zip;

UPDATE-Nexus.Media.Installer-signed.zip:

- fix Magisk installations by setting file/directory contexts at install-time (wasn't necessary on SuperSU su.img)

- work around incorrect target detection on setups where user did not properly clean when switching from SuperSU to Magisk (i.e. leftover su.img)

[MENTION=2719389]z31s1g[/MENTION], the updated Flashlt recovery zip should be good for inclusion in your next theme revision. :good:
[Android Software/Hacking General [Developers Only]] Wolfcity:
[MENTION=4544860]osm0sis[/MENTION]:

Is it still possible to uninstall the new busybox installer with adding 'uninstall' to the zips name? Or what is the correct way to uninstall it? I tried changing the name but the module is still shown in magisk 13.3.
[Android Software/Hacking General [Developers Only]] Didgeridoohan:
That should work, I think. You can uninstall it in the Manager as well (easier)...
[Android Software/Hacking General [Developers Only]] osm0sis:
Yes, zip Uninstall functionality is untested in Magisk since the obvious way of doing it through Manager works fine. The zip will still work from TWRP as well.
[Android Software/Hacking General [Developers Only]] kanaan360:
Hey I was testing out the ADB installer script from magisk anyway fastboot works perfectly fine but I can't get ADB to see my watch where fastboot does

---------- Post added at 10:09 PM ---------- Previous post was at 10:04 PM ----------

NVM reinstalled the module all works now thanks for your work bud
[Android Software/Hacking General [Developers Only]] Shen Ron:
I just started having a problem with busybox. In magisk manager it is installed but it keeps asking to update even though I already updated the module and the same goes for the nano module as well, no matter how many times I reinstall them after some time has pass it starts asking to update again. Samsung Galaxy On5 debloated stock touchwiz, magisk 13.3, no xposed.
[Android Software/Hacking General [Developers Only]] Zackptg5:
[MENTION=4544860]osm0sis[/MENTION]

There's a magisk issue opened on git about this. See this post for the details and fix for it: https://xdaforums.com/showpost.php?p=73073713&postcount=16589
[Android Software/Hacking General [Developers Only]] osm0sis:
It's an edge case for sure since it doesn't happen to everyone, but yes, until it gets fixed on the Manager side of things, reinstall via recovery (just to make sure it got installed - it's unclear to me whether this is happening), boot, then delete /magisk/<mod-name>/update and refresh the module list in Manager.
[Android Software/Hacking General [Developers Only]] djb77:
[MENTION=4544860]osm0sis[/MENTION]

The busybox installer seems to break Safetynet on the latest Magisk 13.6 beta. Once I uninstall it, it passes again.

I'm not sure if its a magisk or busybox issue but i'll report it on both sides.
[Android Software/Hacking General [Developers Only]] guitardedhero:
In case the first suggestion did not mount your image, the typical image mounting command we use in Linux works with the very same results in Linux while in TWRP using its Terminal and File Manager features.

Assuming the Magisk image you wish to recover exists as /sdcard/magisk.img:

Boot to TWRP

Advanced > Terminal

mkdir /sdcard/output
mount -t ext4 -o loop /sdcard/magisk.img /sdcard/output
mkdir /sdcard/recovered

Advanced > File Manager

Navigate to /sdcard

Tap /output > Copy

Navigate to /sdcard

Tap /recovered > Tap the icon to lower right to paste

Swipe to complete the copy/paste operation

Once booted into Android, the contents of /sdcard/magisk.img can be found in /sdcard/recovered/output. :good:
[Android Software/Hacking General [Developers Only]] osm0sis:
Hmm considering my installer hasn't changed and it passed with 13.5, I'm guessing Magisk issue? I'll see if I can reproduce the issue on my (t)rusty old Galaxy Nexus tomorrow after work.
[Android Software/Hacking General [Developers Only]] Paschfire:
I've no issues here passing Magisk Safety-Net checks with v13.6 beta(1360) and BusyBox v1.27.1 installed.

Device information within signature below.
[Android Software/Hacking General [Developers Only]] djb77:
Cool, thanks :) 1.26.2 failed with 13.6 as well just to let you know.

13.5 seemed fine with 1.26.2 but failed with 1.27.1, just did some more testing
[Android Software/Hacking General [Developers Only]] osm0sis:
If you're using old installers I wouldn't expect it to work, no. Magisk support and Magisk Manager support in particular wasn't finished until the latest release.

Get your device so it passes again, then install from the Magisk Module Repo in Manager.
[Android Software/Hacking General [Developers Only]] DAusRon:
Hi [MENTION=4544860]osm0sis[/MENTION]

Just want to report that BusyBox 1.27.1 works with magisk 13.6 beta, safety net passes too. Using redmi note 4 with aex 4.5 official.
[Android Software/Hacking General [Developers Only]] velimirchek:
Don't know if correct thread and if even error, but with both 13.3 and 13.6 when I install your busybox module I cannot keep systemless hosts on :/.. It always turns off when existing magisk manager. Will post in magisk thread also.

What I am doing wrong. See pics and logs. When busybox is gone, systemless switch stays on :(

Thanks for all the work.
[Android Software/Hacking General [Developers Only]] velimirchek:
Scratch that uninstalled and installed magisk again and all fine now.. Don't know what happened. Sorry.
[Android Software/Hacking General [Developers Only]] vibrantliker:
After flashing your Busybox version, I have an icon in my status bar saying: "storage space running out" see icon. I checked and I have at least 650mb
[Android Software/Hacking General [Developers Only]] osm0sis:
And does uninstalling make it go away? Logs? Setup? Any type of investigation from you, the only person experiencing this? I really don't see the connection. Correlation != Causation.
[Android Software/Hacking General [Developers Only]] vibrantliker:
I'll get you some answers.
[Android Software/Hacking General [Developers Only]] osm0sis:
Thanks. Can't do this blind! :)
[Android Software/Hacking General [Developers Only]] vibrantliker:
I don't see it to uninstall it. Does it show up in app drawer?
[Android Software/Hacking General [Developers Only]] osm0sis:
.. It's not an app. Rename the zip to Busybox.Uninstaller-signed.zip and flash it again in recovery.

Read the OP blurbs and follow the links therein to be fully aware of what you're flashing and all the included features.
[Android Software/Hacking General [Developers Only]] DEVILOPS 007:
[MENTION=4544860]osm0sis[/MENTION] Btw, busybox has been updated to 1.27.2
[Android Software/Hacking General [Developers Only]] Jenanga:
Btw osm0sis knows that
[Android Software/Hacking General [Developers Only]] vibrantliker:
Is there a .zip or apk for it?
[Android Software/Hacking General [Developers Only]] osm0sis:
I've got a Chrome extension that checks daily for changes on the busybox and nano websites and shows me the diff, so yeah, no reminders necessary. :p

I just worked 4 12-hour days in a row, so we'll see how far I get this weekend on things. No point in doing 1.27.2 without proper BINDSBIN SuperSU support.
[Android Software/Hacking General [Developers Only]] osm0sis:
Here's a fun little trick to get a fully functional Pixel Launcher on a stock Nexus 5X with BINDSBIN SuperSU.

1) Sideload the latest available extracted Pixel Launcher from here: https://www.apkmirror.com/apk/google-inc/pixel-launcher/ - press Home and set it to default.

2) Copy the .apk and oat directory from /data/app/com.google.android.apps.nexuslauncher-1 to /sbin/supersu/app/GoogleHome (make this directory first) renaming things from base.* (.apk and .odex) to GoogleHome.*, then fix the ownership and permissions to match system: `chown -R root:root /sbin/supersu/app; chmod -R 755 /sbin/supersu/app; chmod 644 /sbin/supersu/app/GoogleHome/GoogleHome.apk /sbin/supersu/app/GoogleHome/oat/arm64/GoogleHome.odex`

3) Create a su.d script to do the magic: `echo 'mount -o bind /sbin/supersu/app/GoogleHome /system/app/GoogleHome;' > /sbin/supersu/su.d/000pixellauncher; chmod 755 /sbin/supersu/su.d/000pixellauncher`

Reboot and voila. Pixel Launcher replaces Google Now Launcher in the live system parition via bind mount. :cowboy:

Of course Magisk could handle this pretty easily as well, but I'm not going to start distributing Google app APKs in Magisk modules.

Also, to follow up on the idea of having the renamed busybox zip functionality work to uninstall when flashed in Magisk Manager, this isn't possible because Manager renames the zip to only install.zip when it copies it to a temp directory for processing. Just use Magisk Manager itself to uninstall, being the more obvious choice of method. ;)
[Android Software/Hacking General [Developers Only]] osm0sis:
Ugh, triple post. Worth it? :p

I work on these projects in my limited time off, so if you like the progress I'm making, or enjoy anything else I've done on xda, please do hit the donate link from my profile. Thanks for your support!

UPDATE-adb.Installer.v1.0.36-signed.zip;

UPDATE-Adreno.Systemless.Installer-signed.zip;

UPDATE-nano.Terminal.Editor.v2.8.6-signed.zip;

UPDATE-Nexus.Media.Installer-signed.zip:

- add BINDSBIN SuperSU support

UPDATE-Busybox.Installer.v1.27.2-ALL-signed.zip:

- update to latest busybox stable official source

- add BINDSBIN SuperSU support

See the related commits here: https://github.com/osm0sis/android-busybox-ndk

Edit

: To the 6 users who downloaded the Nexus Media and Adreno zips so far, I've reuploaded them; I had a broken test version of the su.d script in there instead of the final, working one. All is well now. :)
[Android Software/Hacking General [Developers Only]] ale5000:
Hi,

I know shell scripts a bit but I find difficult to understand what these lines do.

Can you please explain them?
[Android Software/Hacking General [Developers Only]] jcmm11:
Ultimately what they do is look to see if the zygote process is running. If yes set BOOTMODE to true. If no set it to false.

ps is the 'process status' command. It returns a list of running processes with information about them, for purposes here only the name is relevant.

Sidenote: the busybox version of ps (which is what runs within TWRP) is more full featured than the toybox version. One example - toybox version won't accept the '-A' parameter. I think the only thing it does accept is a pid.

For more information on ps check Google. Try 'ps command Linux' or 'ps man page'. For now just know it returns a list of processes, by default ones which belong to the user running the command.

So the output from ps is passed to grep which checks the output for 'zygote' (which is the "master" process when you boot), this output is then passed to fgrep again to remove any lines with 'grep' in them.

Next the return code from the grep is checked. If return code is 0 (&& test) set BOOTMODE to true. If not 0 (|| test) set to false.

The second line starts by testing the value of BOOTMODE. If it's false it runs the 'ps -A' command, tests further for zygote, sets to true if found.

As noted above this second line won't really do anything because 'ps -A' will throw an error in a booted system since toybox will reject it. But what I described is the intent.

Hope this helps. If you have a specific question about part of this then ask.
[Android Software/Hacking General [Developers Only]] Random04:
Hey!

Was just wondering if it is possible to get the BusyBox Installer Script (Magisk) to install Busybox to su/xbin or su/bin instead of system/xbin.