yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] Trundler:
My apologies. Meant to include it in my original reply but I just forgot.

- Copying zip to temp directory
- Installing Busybox_for_Android_NDK-1.30.1.zip
Archive: /data/user/0/com.WZ1m1tRyuNME5sfT/cache/install.zip
inflating: install.sh
inflating: module.prop

mount: can't read '/etc/fstab': No such file or directory
Busybox Installer Script
by osm0sis @ xda-developers

Mounting...
mount: can't read '/etc/fstab': No such file or directory
mount: can't read '/etc/fstab': No such file or directory

Extracting files...
Archive: /data/user/0/com.WZ1m1tRyuNME5sfT/cache/install.zip
creating: META-INF/
creating: META-INF/com/
creating: META-INF/com/google/
creating: META-INF/com/google/android/
inflating: META-INF/com/google/android/update-binary
inflating: META-INF/com/google/android/updater-script
inflating: README.md
inflating: busybox-arm
inflating: busybox-arm64
inflating: busybox-mips
inflating: busybox-mips64
inflating: busybox-x86
inflating: busybox-x86_64
inflating: install.sh
inflating: module.prop

Installing...
Using architecture: arm64
umount: can't unmount /dev/tmp/su: No such file or directory
Using path: /dev/tmp/su/xbin

Cleaning...

Creating symlinks...

Unmounting...
umount: can't unmount /system: Device or resource busy
umount: can't unmount /data: Device or resource busy
umount: can't unmount /cache: Device or resource busy

Done!

I'm assuming this is some kind of difference in Android filesystems between Android versions but I don't really know enough to fix it myself. FYI this is Android 8.0.0.
[Android Software/Hacking General [Developers Only]] osm0sis:
Nope, you just didn't properly clean your device when you switched from SuperSU to Magisk. Delete su.img from /data and /cache and it should be fine to flash after.
[Android Software/Hacking General [Developers Only]] ogisha:
I tried FlashFire before and it did not work.

Thank you.

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

Nice catch.

I guess the last command will create all necessary links, but will it remove the old ones and remove any leftovers?

Thank you very much.
[Android Software/Hacking General [Developers Only]] osm0sis:
No, but /system/xbin shouldn't have much in it before busybox, and my builds only really gain applets, never lose them, so it should be fine. :good:
[Android Software/Hacking General [Developers Only]] ogisha:
I tried and it worked.

Thank you.
[Android Software/Hacking General [Developers Only]] D412:
This is probably a dumb question, I am out of my depth, but re: the busybox magisk module. Is there anything I can do to get Tasker to recognize it? When I use BusyBox from the play store, I can use Tasker's run shell action kill -9 `pgrep <packagename>` to kill foreground apps with no problem but with the Magisk module it's resulting in an error. Tried a BusyBox checker and it says it's working fine, so I assume I'm missing something?
[Android Software/Hacking General [Developers Only]] osm0sis:
busybox is available in all shells (root and user) because of how Magisk works, so that's gotta be some issue with how Tasker invokes the shell, maybe with a weird broken $PATH or something.
[Android Software/Hacking General [Developers Only]] jcmm11:
First of all both kill and pgrep are found natively in Android - you don't need busybox to get those commands. And since the way you appear to be using them here is pretty basic there shouldn't be any functional difference between the busybox and toybox (native Android) versions.

Next - what, exactly, is the error. And what, exactly are the full contents of the Tasker task.

And, just to confirm things, what's the output of the following commands:

type pgrep

type kill

ls -l $(which pgrep)

ls -l $(which kill)
[Android Software/Hacking General [Developers Only]] D412:
Thanks for the reply

The problem is that with BusyBox from the playstore installed, the identical task runs fine. Executes as expected, kills the app. Uninstall it, I get an error. Installed Magisk Module, I get an error. The task is super simple, attached to a nav gesture

1) App Info (returns %app_package variable)

2) Run shell kill -9 `pgrep %app_package`

I also tried it with an actual package name instead of a variable, but same problem, here is the result with the returned variable

The error is:

21.24.27/Variables doreplresult: |kill -9 `pgrep %app_package`| -> |kill -9 `pgrep net.dinglisch.android.taskerm`|
21.24.27/Variables doreplresult: |kill -9 `pgrep %app_package`| -> |kill -9 `pgrep net.dinglisch.android.taskerm`|
21.24.27/E Run Shell: ->
21.24.27/E Run Shell: ->
21.24.27/E Run Shell: ->
21.24.27/Shell runBackground kill -9 `pgrep net.dinglisch.android.taskerm` root: true timeout: -1
21.24.27/Shell start process-thread ID 437
21.24.27/E add wait type Shell1 time 2147483647
21.24.27/E add wait type Shell1 done
21.24.27/E add wait task
21.24.28/E Error: 1

type pgrep --- pgrep is a tracked alias for /system/bin/pgrep

type kill --- kill is a shell builtin

ls -l $(which pgrep) --- lrwxrwxrwx 1 root root 6 2019-07-21 20:43 /system/bin/pgrep -> toybox

ls -l $(which kill) --- lrwxrwxrwx 1 root root 6 2019-07-21 20:43 /system/bin/kill -> toybox

Appreciate any help
[Android Software/Hacking General [Developers Only]] ianmacd:
A tangential question about coding style: Why do you terminate every line with a superfluous semi-colon? This is unimportant, but I haven't seen this particular idiosyncrasy before, so I'm curious.
[Android Software/Hacking General [Developers Only]] DiamondJohn:
for me, I find that If you get everything else in the line correct, then it is superfluous, however, if you do make a typo (which happens often) it highlights the mistake quicker as opposed to continuing to the net line waiting for more input. Also, adding the semi-colon to the end enables multiple lines on the same line. frivolous example

cd ~/android; ls -l; cd ~/;
[Android Software/Hacking General [Developers Only]] guest4711:
It's a hommage to Pascal (and Modula2) where a statement is terminated by a semicolon.
[Android Software/Hacking General [Developers Only]] ianmacd:
Fair enough. To my mind, a typo wouldn't be any harder to spot if it incurred an unintended line continuation; and such a convenience wouldn't, in any case, compensate for the stylistic penalty that the semi-colon imposes. But tastes differ, so let's leave it at that.

Of course. We all use it as a command separator; it's just the use as a line terminator that I was querying.
[Android Software/Hacking General [Developers Only]] osm0sis:
I adopted it since I ran into problems where newlines weren't always carried over in a copy/paste into adb shell or Terminal Emulator or wherever, but if I terminated with ; (which many coding languages enforce, though shell does not) then things always copy/pasted in a working format. :)
[Android Software/Hacking General [Developers Only]] alecxs:
it is historical C ++ style
[Android Software/Hacking General [Developers Only]] ianmacd:
Thanks for answering. I was curious whether you might have learned shell after a language that enforced semi-colons as line terminators, such as C or Java.

Someone (jokingly, I think) suggested you might have been an old Modula-2 programmer, but I would have put money on that not being the case. I think only me, Niklaus Wirth and one other bloke I once knew were ever Modula-2 programmers. :)
[Android Software/Hacking General [Developers Only]] ianmacd:
From reading the code, it's not clear to me why you create and mount an ext4 image at all. Is this just for AnyKernel? I have no familiarity with that, hence the question. Because a normal updater script is simply going to do its work on the root file-system that you just remounted r/w. I don't really see why you go to the trouble of creating the ext4 image, because nothing obviously writes to it, although I suppose most updater scripts will use /tmp as a scratchpad.

Anyway, if you could clarify, I'd be grateful.
[Android Software/Hacking General [Developers Only]] osm0sis:
Well there's the memory vs. disk space debate I mentioned, but beyond that you can't unpack a ramdisk in booted Android under /data or anywhere except tmpfs or an ext4 .img or it gets wildly corrupted on the repack, so that's how it started.

When / was tmpfs from a ramdisk that was fine, but now with it being system-as-root you'd run into issues with modifying the system partition and there being space to do so if you didn't then mount something on top to give you space to work.

/tmp itself is important for a lot of flashable zips which have it hardcoded to unzip themselves there and that's where all zip flashing takes place in recovery.
[Android Software/Hacking General [Developers Only]] LonelyDay:
Hi all, anyone know how to edit default.prop on LineageOS 16.0? Because on boot.img -> ramdisk, there is no default.prop file.
[Android Software/Hacking General [Developers Only]] nussbaum:
/default.prop is a link to /system/etc/prop.default here, mind the exchanged name parts. And then there is a different one in /vendor/default.prop
[Android Software/Hacking General [Developers Only]] LonelyDay:
And this possible to change ro.debuggable=0, ro.secure=1, and ro.build.selinux=0?

My apps banking detect my rom is rooted, but not using supersu/magisk, rootbear says my device is dangerous props and selinux flag experiemntal its fail.
[Android Software/Hacking General [Developers Only]] DiamondJohn:
Sorry if the following question is OT, but it appears to be thread which can stray...

I am trying to find a shell command or system file that reports/saves the times the device is switched on and off? I can get the battery drain from multiple places (eg dumpsys batterystats;), but all the ones I have found thus far, show a time line in respect to only while the phone is on. For example, if I charge the phone to 100%, leave it on for 1hr then turn the phone off for 8hrs, then turn it on for 1hr, the details imply that the phone was on constantly for 2hrs. No reference that I can see logs that it was off for an 8hr window:confused:. Have I missed something or is there somewhere else where it is stored?
[Android Software/Hacking General [Developers Only]] amg314:
Try 3C ToolBox Battery Manager. It include History Monitor. https://www.3c71.com/android/?q=node/585
[Android Software/Hacking General [Developers Only]] DragonFire1024:
Highly recommend the full pro version of this app. With that said, the battery stats will only function properly if the power profile is configured right, inside the framework, if it even is at all.
[Android Software/Hacking General [Developers Only]] DiamondJohn:
My rom itself has the actual detail as part of the battery details. I was specifically looking for the shell command / or a cat of a system file to retrieve the values for when the device is off or on.
[Android Software/Hacking General [Developers Only]] DragonFire1024:
Might look over the recovery and system logs at boot. Amazon tablets display similar if not the exact info in those logs. Problem is that's OEM specific details.
[Android Software/Hacking General [Developers Only]] amg314:
Make search *battery* starting at / directory.

Look at files like batterystats-daily.xml and so on.

https://xdaforums.com/crossdevice-d...esetting-phone-usage-statistics-data-t3264715
[Android Software/Hacking General [Developers Only]] DiamondJohn:
I'll take another look.

On a side note, to reset your battery statistics you can use

dumpsys batterystats --reset;

I have seen that thread, and the way they propose is really dodgy.
[Android Software/Hacking General [Developers Only]] osm0sis:
Only thing that came to mind for me was the `uptime` command. Doesn't tell you anything about when it was powered off though.
[Android Software/Hacking General [Developers Only]] Keule-Tm:
Maybe something like a service catching a shutdown command? Or a script like "alias shutdown=X; if $0=shutdown; do <write timestamp to file> && X -h now; done". (This wouldn't work as it is, obviously)

Just brainstorming, no clear ideas in mind.
[Android Software/Hacking General [Developers Only]] DiamondJohn:
Yes that could be used to catch the last time it powered up, but I would be missing when it was powered down or how log it was powered down for, or as can be sen in the image below, if it was powered down multiple times.

I dont want to add anything.

It is obviously stored somewhere within android, as most custom ROMs I run, have a battery history that displays the info. So, at the very least it is available from Java. see below image. I also did a very brief look for the source, but it was getting very convoluted quickly, for me .:eek:

I am basically trying to duplicate the graph below, but using data sourced directly from shell commands which would be commonly available across multiple phones without requiring installing or running anything extra. Or even from BusyBox as a worse case.

For example, LOS ROMs do not have this visual history graph built into the ROM; the below is from Havoc-OS. I do a similar thing for a doze history graph, sourcing data from a "dumpsys deviceidle" and then using HTML to create a visual representation see: https://xdaforums.com/showpost.php?p=79135309&postcount=74 It would be great to add the battery drain graph to it as well. Although since the idle history is only since the last boot, its actually already there :rolleyes:. But combining the two graphs is more of a long term plan, right now it would be to simply duplicate the following.
[Android Software/Hacking General [Developers Only]] Keule-Tm:
Interesting idea.

But

is not correct. I'm running LOS 14.1, and I get that chart when I e.g. touch the battery QS tile (and in settings).
[Android Software/Hacking General [Developers Only]] DiamondJohn:
Sorry, I am running LOS Pie, ie the latest not an older 14.1 version. Features change between android revisions and over time. ie their next Pie build may just include the feature.
[Android Software/Hacking General [Developers Only]] Keule-Tm:
Right, as far as generalizations go, we're both wrong ?
[Android Software/Hacking General [Developers Only]] osm0sis:
I love you 30,000 too, xda. :D
[Android Software/Hacking General [Developers Only]] shoey63:
+1
[Android Software/Hacking General [Developers Only]] usama20E:
Twrp script module for A/B devices!

If you have backup ramdisk! can't you patch it to install twrp?!

Maybe you can

---------- Post added at 06:42 PM ---------- Previous post was at 06:42 PM ----------

Twrp script module for A/B devices!

If you have backup ramdisk! can't you patch it to install twrp?!

Maybe you can
[Android Software/Hacking General [Developers Only]] methuselah:
Well very few of you like left on XDA. The guys who really helps ?...Congrats
[Android Software/Hacking General [Developers Only]] david72262:
Congratulations ?
[Android Software/Hacking General [Developers Only]] mrrocketdog:
[MENTION=1143630]osmosis[/MENTION] , thank you and congratulations!! woo hoo :)

err on the side of kindness
[Android Software/Hacking General [Developers Only]] Lughnasadh:
Thanks for the updates and congrats on the upcoming nuptials :)
[Android Software/Hacking General [Developers Only]] Wolfcity:
Thanks and all the best for you and your future [MENTION=1143630]osmosis[/MENTION]. Congratulations!
[Android Software/Hacking General [Developers Only]] osm0sis:
[MENTION=1143630]osmosis[/MENTION] must be loving this. :laugh:
[Android Software/Hacking General [Developers Only]] jcmm11:
That's your long lost twin, right? ?

I'll add my congratulations as well. I assume you'll have a computer and be working and posting on the honeymoon? ? <Ducks and runs for cover, very, very, fast>
[Android Software/Hacking General [Developers Only]] Mervingio:
Congratulations!!!!!! Now where is the food and Vodka?? :svetius:
[Android Software/Hacking General [Developers Only]] FriendlyNeighborhoodShane:
Congratulations [MENTION=4544860]osm0sis[/MENTION] :)
[Android Software/Hacking General [Developers Only]] m0han:
ditto, [MENTION=4544860]osm0sis[/MENTION]. wish you well!
[Android Software/Hacking General [Developers Only]] Paschfire:
Thanks and congratulations [MENTION=4544860]osm0sis[/MENTION] ! I wish you both all the best. :laugh:
[Android Software/Hacking General [Developers Only]] nextheart:
Many congratulations.. Enjoy... Have fun...
[Android Software/Hacking General [Developers Only]] madbat99:
[MENTION=4544860]osm0sis[/MENTION]

Wish I could do more

Have a glass of wine at the reception on me
[Android Software/Hacking General [Developers Only]] osm0sis:
Thank you so much for the donation! :)

Cheers, I definitely will! :highfive:
[Android Software/Hacking General [Developers Only]] madbat99:
Try to enjoy the evening, mine seemed to go by in a flash. My bride had a blast, it's HER day after all. LoL
[Android Software/Hacking General [Developers Only]] ako673de:
Busybox module doesn't seem to install anymore

I have an op3t (still) on oreo, rooted with magisk, Versions are up to date.

Some months ago I noticed that the magisk busybox module is no longer getting updated, when I update. It kept stuck at v1.29.3. It didn't bother me too much since then.

Yesterday I wanted to address the issue and uninstalled the module, in order to install the current one right after (hopefully tricking it to "update" that way). Instead I never manged to install it ever after. There is no /su folder on my phone, /system/xbin contains nothing bb related, and there's also no trace to bb anywhere else, although your installer always tells me that everything "went fine". I didn't even manage to install any other busybox from the PlayStore.

Still one bb seems to exist, in /sbin/. magisk/busybox, but that isn't yours, right? And it's not useable in system, right?

I just checked that /system/xbin is writable by root, but now I'm out of ideas...
[Android Software/Hacking General [Developers Only]] amg314:
Following terminal command show your current BB status:

*----------------------------------------------------------------------------*

$ which busybox

/system/xbin/busybox

(on my device BB lay in right place)

*----------------------------------------------------------------------------*

$ busybox

BusyBox v1.30.1-osm0sis (2019-02-28 18:48:08 AST) 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 --show SCRIPT

or: busybox --install [-s] [DIR]

or: function [arguments]...

BusyBox is a multi-call binary that combines many common Unix

utilities into a single executable.

.................

(I have actual BB version installed)

*----------------------------------------------------------------------------*

Try uninstall BB using MManager first, then install fresh version.
[Android Software/Hacking General [Developers Only]] osm0sis:
Also, install log.
[Android Software/Hacking General [Developers Only]] ako673de:
"which busybox" result is 1 (error)

"busybox" result is 127 (not found)

uninstall from magisk is the reason for exactly this behavior.

Re-install hasn't been possible ever after.

Busybox app by "meefik" (PlayStore) might give a valuable hint: says "mount system r/w". Then works.

But magisk bb module simply does not install.

Says install, runs smoothly, everything fine, reboot, nothing there. Reproducible.

---------- Post added at 09:52 PM ---------- Previous post was at 09:50 PM ----------

Tried twrp install, too, by the way. No success.
[Android Software/Hacking General [Developers Only]] jcmm11:
And we still need the install log
[Android Software/Hacking General [Developers Only]] osm0sis:
Where did you get the zip and what Magisk version are you flashing it on? Provide an install log and a Magisk log following the reboot after installation or we can't help you any further.

I uninstalled, rebooted, then installing the latest from the modules repo via Magisk Manager, which worked completely fine for me, by the way:

- Copying zip to temp directory
- Installing Busybox_for_Android_NDK-1.30.1(13020).zip
- Current boot slot: _a
- Device is system-as-root
Archive: /data/user/0/com.DTVP5V.Nn1dtYvZr/cache/flash/install.zip
inflating: install.sh
inflating: module.prop

Busybox Installer Script
by osm0sis @ xda-developers

Mounting...
mount: can't read '/etc/fstab': No such file or directory
mount: can't read '/etc/fstab': No such file or directory
mount: can't read '/etc/fstab': No such file or directory

Extracting files...
Archive: /data/user/0/com.DTVP5V.Nn1dtYvZr/cache/flash/install.zip
creating: META-INF/
creating: META-INF/com/
creating: META-INF/com/google/
creating: META-INF/com/google/android/
inflating: META-INF/com/google/android/update-binary
inflating: META-INF/com/google/android/updater-script
inflating: README.md
inflating: busybox-arm
inflating: busybox-arm64
inflating: busybox-mips
inflating: busybox-mips64
inflating: busybox-x86
inflating: busybox-x86_64
inflating: install.sh
inflating: module.prop

Installing...
Using architecture: arm64
Using path: /data/adb/modules_update/busybox-ndk/system/xbin

Cleaning...

Creating symlinks...

Unmounting...
umount: can't unmount /system: Invalid argument
umount: can't unmount /data: Device or resource busy
umount: can't unmount /cache: Invalid argument

Done!

All totally normal. Similar from recovery, and same using the zip from this thread versus the one Magisk Manager downloaded. And busybox working normally from the command line after the subsequent reboot with all tests.

You may have something broken with your Magisk installation, possibly a conflicting module. I'd suggest deleting /data/adb/modules and starting fresh perhaps. Maybe even deleting everything from /data/adb and reflashing the lastest Magisk Canary.
[Android Software/Hacking General [Developers Only]] ako673de:
I already checked the magisk log. Nothing there from the module installation process. Can you tell me where to find the one you're referring to?
[Android Software/Hacking General [Developers Only]] jcmm11:
After installing in Magisk click the save icon then look in downloads. There's an option in TWRP to save the log as well, but since there's no currently functioning TWRP for my phone I haven't fired it up in a while and forget exactly where it is.
[Android Software/Hacking General [Developers Only]] ako673de:
Ah! Stupid me did do this before but had no look into it, because I thought there isn't likely too much new info there, while no errors are shown in the magisk "flashing" screen. But obviously that's wrong.

Here you are:

- Copying zip to temp directory

- Installing Busybox_for_Android_NDK-1.30.1(13020).zip

Archive: /data/user/0/com.Povw.HKC.FbYQ8Qe/cache/flash/install.zip

inflating: install.sh

inflating: module.prop

mount: can't read '/etc/fstab': No such file or directory

Busybox Installer Script

by osm0sis @ xda-developers

mount: can't read '/etc/fstab': No such file or directory

mount: can't read '/etc/fstab': No such file or directory

Mounting...

Extracting files...

Archive: /data/user/0/com.Povw.HKC.FbYQ8Qe/cache/flash/install.zip

creating: META-INF/

creating: META-INF/com/

creating: META-INF/com/google/

creating: META-INF/com/google/android/

inflating: META-INF/com/google/android/update-binary

inflating: META-INF/com/google/android/updater-script

inflating: README.md

inflating: busybox-arm

inflating: busybox-arm64

inflating: busybox-mips

inflating: busybox-mips64

inflating: busybox-x86

inflating: busybox-x86_64

inflating: install.sh

inflating: module.prop

Installing...

Using architecture: arm64

umount: can't unmount /dev/tmp/su: No such file or directory

Using path: /dev/tmp/su/xbin

Cleaning...

Creating symlinks...

Unmounting...

umount: can't unmount /system: Device or resource busy

umount: can't unmount /data: Device or resource busy

umount: can't unmount /cache: Device or resource busy

Done!
[Android Software/Hacking General [Developers Only]] osm0sis:
"/dev/tmp/su/xbin" :rolleyes:

You clearly have a su.img on your device. Look in /data or /cache and clean up your messy device. :good: