yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] ale5000:
[MENTION=4487388]jcmm11[/MENTION]

I now undestand but there is a point that I miss about this line:

$BOOTMODE || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true

Shell doesn't really understand true/false as text so "$BOOTMODE" will always evaluate to true, but it would work doing this:

[ $BOOTMODE == false ] && ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true

Am I miss something or is there an error?
[Android Software/Hacking General [Developers Only]] jcmm11:
Are you sure about that ?

bullhead:/ $
bullhead:/ $ var1=true
bullhead:/ $ var2=false
bullhead:/ $ $var1&&echo yes||echo no
yes
bullhead:/ $ $var2&&echo yes||echo no
no
bullhead:/ $

true and false are built-in shell constants. They have to be all lower case. Neither True nor TRUE would work the same way.
[Android Software/Hacking General [Developers Only]] ale5000:
I was wrong but there is one thing that can be improved, it set BOOTMODE=true even when it is already true.

It can be fixed by this:

$BOOTMODE || (ps 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true)
[Android Software/Hacking General [Developers Only]] jcmm11:
Couple of points here. First, if you look at the 2nd line I think you'll see it already starts with the || test.

Second, as I said in the original explanation, I don't think the second line gets you anything since toybox will throw an error on ps -A and TWRP won't have zygote. So I'd just drop the second line completely.

But it's also not my code ? (and I may have missed something myself)
[Android Software/Hacking General [Developers Only]] ale5000:
I don't know if it is needed but you can see that by running this:

$BOOTMODE || echo '1' && echo '2'

2 is always shown with both true/false.
[Android Software/Hacking General [Developers Only]] jcmm11:
If you're going to include both tests then && has to come first. If only one test you can just use ||

That's just how it works
[Android Software/Hacking General [Developers Only]] ale5000:
Generally yes, but not in this case where && apply (if I undestand the original idea) only to second clause.

The line

$BOOTMODE || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true;

in [MENTION=4544860]osm0sis[/MENTION] post is conceptually wrong despite doesn't causing any problem.
[Android Software/Hacking General [Developers Only]] jcmm11:
$BOOTMODE || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true;

Right. In this case it's fine because of intermediate clauses. Conceptually it's also fine. Let's break it down.

Test BOOTMODE

If it's true we're done. Nothing more to do.

If it's false we run ps again, this time telling it to give us all the running processes. (First time we didn't use -A so it's a restricted listing. This still assumes no toybox, but I've beat that horse enough)

We, once again, pass the output to grep filtering for zygote and removing grep. If we still have output after that (return code of 0 from the last grep) that means we found a running zygote instance and we set BOOTMODE to true.

Conceptually this is fine. If the first check didn't find zygote we check again against the full process list. I don't see a conceptual problem here.
[Android Software/Hacking General [Developers Only]] ale5000:
IF BOOTMODE is already true it doesn't check again but it still set BOOTMODE=true.

It doesn't make any difference but it set it to true again despite being senseless.

Try and see the text displayed:

BOOTMODE=true
$BOOTMODE || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && echo 'true again'
[Android Software/Hacking General [Developers Only]] jcmm11:
Yeah you're right. This would be better.

if [ $BOOTMODE ]
then
ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true
fi
[Android Software/Hacking General [Developers Only]] osm0sis:
The $BOOTMODE stuff is directly [MENTION=4470081]topjohnwu[/MENTION]'s script work guys, I assume he did it that way for a reason.

ps | grep zygote | grep -v grep >/dev/null && BOOTMODE=true || BOOTMODE=false;
$BOOTMODE || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true;

That reads fine to me.. basically if it's getting set to false from the first ps failing to list a zygote entry via grep, it tries again with ps -A and if that fails it remains false.

In Magisk there is no /su
[Android Software/Hacking General [Developers Only]] jcmm11:
The biggest problem with that is that on a booted system ps -A will be executing the toybox version of ps, and that will throw an error "bad pid '-A'". Try it yourself. So that line is totally redundant.
[Android Software/Hacking General [Developers Only]] osm0sis:
Redundant when it's toybox, sure, but it won't always be toybox. It still might be toolbox or even busybox depending on the ROM.
[Android Software/Hacking General [Developers Only]] 6hexanexz:
Thanks for everything :highfive: love
[Android Software/Hacking General [Developers Only]] jcmm11:
Actually I did make a mistake. It's still toolbox for ps not toybox. And you're correct that it may work at some point or in some circumstances (although currently even ROMs that include busybox usually have /system/bin ahead of it in the PATH. Although maybe Magisk changes that when it's installed?) Anyway it also doesn't hurt anything to have it there. As I said at one point, conceptually it's fine.
[Android Software/Hacking General [Developers Only]] osm0sis:
Looks like I should have waited a day!

New nano dropped, and I'm rereleasing Flashlt v2.9 - it's only been a day - with a new rebootit.sh script since I was getting annoyed today at having to go command-line or go into bin to use my busybox binary directly on stock ROM. :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-Flashlt.Installer.v2.9-signed.zip:

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

- fix flashіt --restore

- add BINDSBIN SuperSU support to installer and flashіt --restore/--uninstall commands

- add rebootit.sh wrapper to allow easy reboot after a flash; accepted arguments: recovery, bootloader, download or shutdown

UPDATE-nano.Terminal.Editor.v2.8.7-signed.zip:

- update to latest nano official source

- hide output from resize command in booted wrapper
[Android Software/Hacking General [Developers Only]] KenNashua:
Busybox "Module will be updated at next reboot"

Magisk 13.3, Busybox for Android NDK 1.27.2 from manager repo, Moto PE (clark), Android 6.0

I've installed said module from within Magisk Manager, but after each reboot it still says "Module will be updated at next reboot". I don't see any evidence of it in the magisk logs.

Since it doesn't seem to install, it's also not possible to hit the trashcan icon to remove it.

Ideas?
[Android Software/Hacking General [Developers Only]] osm0sis:
Rare race condition reported already. Should be resolved in the next Magisk stable I think.

Flash the zip in recovery, then manually delete the /magisk/busybox-ndk/update file after you reboot to Android.
[Android Software/Hacking General [Developers Only]] robcore:
Chris! I found out two things today!

1) No wonder you're so polite, you bloody easterner :'D lol Alberta over here but I promise I'm not *too redneck

2) I found an issue in your busybox installer that (for some) leaves dangling symlinks to TWRP's busybox in /sbin.

Number 1, I have no solutions for ;)

2, however, could be solved by simply changing:

$target/busybox ln -sf busybox $applet;

to

$target/busybox ln -sf $target/busybox $applet;

Now, granted this will reference the whole path in the symlink (ie. /system/xbin/$applet), but I don't think it should be a problem.

If you want to keep the locality of the symlink (just "busybox"), another option would be to include a self-destructing init.d script

that removes dangling symlinks in the folder like so:

find -L $target/ -type l -exec rm -i {} +

The downside to this method is that it relies on the user having init.d support, and probably means more hoops to jump through for

magisk users (I live in the stone age so no clue what that entails). I tested the first method, and everything is working fine though.

So...yeah! That said, it's a friday night, so ignore this and go spend some time on your chesterfield! Or screeching ceremony, or

whatever you crazy folks do on a Friday night :)
[Android Software/Hacking General [Developers Only]] KenNashua:
Much thanks! Up and running!
[Android Software/Hacking General [Developers Only]] osm0sis:
Haha I feel like Canada is polite, Eastern Canada is like sassy-polite. :p

I'm not sure how these dangling symlinks get created, and why only for some? The installer cd's to the $target directory beforehand so the busybox that the command references should always be the one in the current directory, not the one in the $PATH, and that's on top of it always using the included busybox to create the symlinks so the outcome should always be the same... :confused:

What happens if you change it to ./busybox $applet; does that work on the devices in question and keep the symlinks local?
[Android Software/Hacking General [Developers Only]] robcore:
I will try today! Haven't looked at the source in a while but it could be due to something in twrp's env variables.

Half-related, and probably device/version specific, but for symlinking in my modified stock stuff I've been using the init binary's built-in because it's brilliant and creates local links wherever you bloody tell it to.
[Android Software/Hacking General [Developers Only]] wdthompson:
Good day

I just found your scripts,, you've been busy

Alas , nano does not work for me,, {unbound key : ^J] ,, there is no enter

adb ver 1.0.31 ,, 4.4.2 on a cheap spreadtrum phone ,, SC7715 cpu

interestingly, when I run it in the command line of mc, it doesn't work,

but when I return to mc, it is full screen,, not the ususal which is the size of a cell phone screen

So, not a total waste at all!!! I moved mc's terminfo to terminfo.mc so mc is

using your terminfo, still xterm, when it starts it is still the small screen

I just tested, exited adb , restarted, mc, small screen, nano, no ^J, ^x, mc large screen

Very curious

BTW this is not installed by zip, I yanked the bits out of the zip and manually installed

I kind of prefer adb,, just like dos of yesteryear

And an hour later,, shift enter seems to work OK, you might update the readme
[Android Software/Hacking General [Developers Only]] GCalzo:
It worked perfectly also on Moto G2, stock ROM MM, Open GApps, Magisk v13.3!

Before reading your post I had to restore a TWRP backup to "solve", so I have directly flashed the v1.27.2 from TWRP without first try again the install from Magisk Manager and so I didn't had to delete the /magisk/busybox-ndk/update file! :good:
[Android Software/Hacking General [Developers Only]] dirtyreturn:
[MENTION=4544860]osm0sis[/MENTION] - for the adb and fastboot installer -- woulf that allow for adb shell commands to run on nougat?

I ask because i am unsure of how to do something on ubuntu ...

adb shell would be used to get god mode functional for island.
[Android Software/Hacking General [Developers Only]] osm0sis:
It does what it says it does.. it adds the adb utility back to the ROM so that you can use adb to connect to another device via Terminal Emulator.
[Android Software/Hacking General [Developers Only]] jfhall2113:
[MENTION=4544860]osm0sis[/MENTION], what is the UI for this is there one? When zip was downloaded and installed one did not appear found that strange thought I would ask. Thanks again for all your work man great job!!
[Android Software/Hacking General [Developers Only]] jcmm11:
First of all what is 'this'? He has a whole bunch of zips available. That being said there probably is no UI, most (all?) of these really don't need one. So anyway which zip are you referring to and what would you use the UI for? There's probably another way to do whatever it is.
[Android Software/Hacking General [Developers Only]] jfhall2113:
Sorry I'm fairly new still to all of this in speaking in reference to the initial BusyBox zip. Most of them have a ui to run your scripts and stuff like the ones you can download from play store. Just trying to learn how his works.
[Android Software/Hacking General [Developers Only]] marcdw:
A couple of Play Store installers might include built in termimal access but that's rare. A UI is not needed. If you want to run scripts and whatnot just install a terminal emulator like TTerm.

LG G3 D851, PAC-MAN LP ROM, MultiROM, Tapatalk 4.9.5
[Android Software/Hacking General [Developers Only]] jfhall2113:
Ok that makes sense lol. I'm not sure why that didn't occur to me thank you!!
[Android Software/Hacking General [Developers Only]] Paschfire:
[MENTION=4544860]osm0sis[/MENTION]

When using the Adreno_gpu_driver_systemless installer.zip/Magisk module, once booted within Magisk manager the Safety-Net status check returns "the response is invalid" when pressed, if Adreno_systemless_installer module is disabled or deleted the Safety-Net status check works again after rebooting the device.

Nexus 5, Magisk v14(1400) official beta , 7.1.2-N.

ROM and other current setup information within signature below, or my profile page.

Magisk Log attached.

Let me know if you need anything else in helping solve this issue.

Thanks.
[Android Software/Hacking General [Developers Only]] fhem:
[MENTION=4544860]osm0sis[/MENTION] Just a question---not a request. Do you plan on updating your Busybox installer for SuperSU-SR3 compatibility?? If not I will be switching to Magisk for Oreo :good::good:. Thanks for your continued support and hard work.
[Android Software/Hacking General [Developers Only]] jcmm11:
He already did
[Android Software/Hacking General [Developers Only]] fhem:
hmmmmmm. I thought he did also but it not install on 6P w/ stock O. I wasn't sure. I thought he was waiting to see what chaninfire did.:confused::confused:

Oh well I know he was also talking about a work around.

Thanks
[Android Software/Hacking General [Developers Only]] jcmm11:
It should. If you install Supersu 2.82-SR3 on Oreo it should default to sbin mode.

Osm0sis' busybox should install to /sbin/supersu/xbin/ - but will only be accessible in root mode.

If it doesn't install correctly pretty sure he'd appreciate a log from the install attempt
[Android Software/Hacking General [Developers Only]] DualJoe:
What is the purpose/advantage of compiling against NDK if you don't use jni interface (java<>native bridge)? Wouldn't it be much easier to compile busybox statically against glibc/kernel directly (baremetal) like busybox.net doing it?
[Android Software/Hacking General [Developers Only]] osm0sis:
Why Java<>native bridge for something with no Java? Busybox is all written in C.

Basically, certain things just work better with the NDK due to the included headers, like with `ls -al` the uid/gid names display and changing are handled correctly.
[Android Software/Hacking General [Developers Only]] DualJoe:
That's why i asked in the first place. But its clear now. Thx.

What about selinux support (ls -Z)? Looks like only toybox supports it.
[Android Software/Hacking General [Developers Only]] fhem:
Boy do I feel dumb again!!!! I missed the ------ "only accessible in root mode" part of the discussion and I follow this thread !!!!!! Don't ever get old guys it is humbling :D
[Android Software/Hacking General [Developers Only]] jcmm11:
You can, of course, access it outside of root but you'll have to specify the full path.

And I agree with you about the don't get old part. I tell people that all the time.
[Android Software/Hacking General [Developers Only]] osm0sis:
One can link the SELinux libs during compile to enable it, I've got diffs of the required config differences in the thread here, but they make the static binaries so dramatically larger that I don't bother, since for devices that support SELinux toybox does of course support it. :)
[Android Software/Hacking General [Developers Only]] osm0sis:
Yes. You're not mounting /su anywhere. Make sure you're using the latest functions from my Complete Shell Script Zip thread (since those look outdated), then read the notes in the 2nd post there about how to add /su mounting ability. Please post any follow-up questions there as it's the more appropriate thread.
[Android Software/Hacking General [Developers Only]] jcmm11:
Replying here for the moment. If you move the thread I'll follow if necessary.

As Osm0sis said you're not actually mounting su. You [forgot/didn't realize] that you need to mount the su.img file (located in /data) to get at the actual su contents.

Another thing to consider - if you're planning on using this script in Oreo then things have changed. No more /su or su.img.

See the 2.82-SR3 thread starting from the release notice for SR2 for more info on this. Follow up as Osm0sis requested.

Probably the most relevant post of that thread (for this) (Chainfire replying to me):

Oh yeah I did misunderstand. In TWRP those indeed do not exist, and you would currently use /data/adb/su, if /data/su.img isn't available.

There isn't a completely reliable way, as /data may not even be available from TWRP, and if file-based encryption is used, /data may be there but /data/adb may be encrypted.

Assuming /data is decrypted though, since v2.82 SR2 there's a supersu_is_here file. If you don't want to hardcode /data/adb/su (I'd certainly advise making it a variable in any case), you could use that to locate the base folder:
[Android Software/Hacking General [Developers Only]] jack allen:
Sorry to quote whole post but im looking for the aik installer mobile for twrp but im not entirely sure where it is as it keeps going onto different pages. Again sorry for the whole quote

---------- Post added at 10:49 PM ---------- Previous post was at 10:46 PM ----------

Deleted sorry posted on wrong thread sorry
[Android Software/Hacking General [Developers Only]] Fif_:
I'd love to see a recent BusyBox with full SELinux support. Where do you get the SELinux libs? They don't seem to be in the NDK.
[Android Software/Hacking General [Developers Only]] osm0sis:
They have to be built separately. It would be a fair bit of work to incorporate them into my build scripts (and they're not necessary for my projects), but I know [MENTION=4939386]Surge1223[/MENTION] and [MENTION=1867561]TOOJ[/MENTION]ohnwu have done some work to make compiling them easier, and their work can be found on their GitHubs.
[Android Software/Hacking General [Developers Only]] osm0sis:
They have to be built separately. It would be a fair bit of work to incorporate them into my build scripts (and they're not necessary for my projects and they dramatically increase the binary size so I don't plan on it), but I know [MENTION=4939386]Surge1223[/MENTION] and [MENTION=4470081]topjohnwu[/MENTION] have done some work to make compiling them easier, and their work can be found on their GitHubs.
[Android Software/Hacking General [Developers Only]] Captain_Throwback:
This would be really helpful for TWRP so it can be migrated to an independent (AOSP) build tree. I've been trying to get busybox to build with AOSP source using [MENTION=4470081]topjohnwu[/MENTION]'s work but with SELinux enabled, it's giving me trouble. I just don't understand enough about the makefiles and what's involved to get it working properly. Guess I'll just have to keep at it blindly, lol :rolleyes:. TWRP doesn't actually need static binaries, so if you know how to add them dynamically, that would be extremely helpful for me.
[Android Software/Hacking General [Developers Only]] osm0sis:
Unfortunately I don't know, I've never tried.

Here's all I know: https://xdaforums.com/showthread.php?p=66160631#post66160631

[MENTION=5423715]YashdSaraf[/MENTION]'s build scripts might provide some hints even though they're for uClibc: https://github.com/yashdsaraf
[Android Software/Hacking General [Developers Only]] Fif_:
Thanks for the info.

I'm using the SELinux-enabled BusyBox that comes with OmniROM, but it's a little dated (1.22.1 bionic) and lacks some applets.

Alternately, you can compile a static BusyBox under Linux. It works but some things are broken (DNS resolving, uid mapping).
[Android Software/Hacking General [Developers Only]] osm0sis:
Can't reproduce that here with my Nexus 5 (Lineage, Magisk Beta, etc.). Reinstall Magisk?
[Android Software/Hacking General [Developers Only]] Paschfire:
I've since tried reinstalling Magisk Beta, Adreno module, including reflashed ROM.. etc but the issue still persists as previously outlined.

For now I've just returned to flashing the Adreno_gpu_driver archive directly using Twrp.

This was the first time I'd ever tried using the Adreno_gpu_systemless Magisk module out of curiosity, as I normally just flash the driver archive as stated above.

I only use 2 other modules, BusyBox for Android NDK -1.27.2 and ARISE compatibility v4.0... AIK-Mobile(helper script)-v2.9 is also present.

Either way thanks for getting back to me on this, much appreciated. :highfive:
[Android Software/Hacking General [Developers Only]] osm0sis:
https://github.com/osm0sis/Android-Image-Kitchen/blob/AIK-mobile/module.prop#L9

https://github.com/Magisk-Modules-Repo/nano-Installer/blob/master/module.prop#L9

They work for me on the latest betas.
[Android Software/Hacking General [Developers Only]] osm0sis:
I know. They work as-is.
[Android Software/Hacking General [Developers Only]] Tecalote:
Hello [MENTION=4544860]osmOsis'[/MENTION] I have just one question: I s there a difference between Busybox for Android NDK, which is downloadable with Magisk Manager - and UPDATE-Busybox.Installer.v1.27.2-ALL-signed.zip?

They have different md5

I used the one downloaded from Magisk Manager and flashed it on one phone with TWRP and on the other directly with Magisk Manager.

Working perfectly, thanks :)
[Android Software/Hacking General [Developers Only]] osm0sis:
Magisk Manager downloads from GitHub then packages and signs zips itself on-device, whereas my uploads here were zipped and signed manually on my PC.

If you checksum each file from the zip you'll find they match, but the zip itself will differ just from that packaging tools+date difference.
[Android Software/Hacking General [Developers Only]] gFknQ:
Is there a way to get notifications when you update any of your developments. I know magisk will tell me to update, but all the others? A few of your projects have brought joy to my life AND saved my ass on more than one occasion BRILLIANCE!
[Android Software/Hacking General [Developers Only]] osm0sis:
Subscribe to this thread, subscribe to the AIK thread and follow them both on the xda DevDB. Presumably the DevDB does notify when I update the DevDB page, and being subscribed you'll see all the update posts.

Please hit thanks on my AnyKernel2 thread OP as well if you've ever enjoyed a kernel packaged with it, since while I get a lot of mentions for devs crediting me for using it, it still isn't in my top thanked posts, and I find that kinda crazy. :p:)
[Android Software/Hacking General [Developers Only]] Achi Shukuteki:
I have a hammerhead and tried applying the fix. Since May, the camera and flashlight hasn't worked. After switching the actual hardware (camera module), still no dice. Then I noticed one of my apps was using the camera library in Photos when I downloaded from the app.

I suspected it might be a library issue. So I venture where the lib folders are stored. When I get to libcamera2ndk.so it gives a notification that it is corrupted.

I have tried clean flashing different roms before the suspicion - LoS, DarkRom, Tesla - same thing. I'm running PN 7.1.2 and stock kernel.

Ive redownloaded the Camera fix to no avail.

Whaddya think?
[Android Software/Hacking General [Developers Only]] osm0sis:
The "fix" is literally just a re-signed APK downgrade and clearing the current Camera app's data. It doesn't touch libraries at all. It continues to work fine for me on the latest Lineage 14.1 + Open GApps Stock package, so unfortunately I think it must be hardware if it isn't working for you with the exact same setup.