yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] Mickey03:
I can't use Busybox Magisk module in my device custom ROM, Resurrection Remix 5.8.5 Android 7.1.2. It works fine on my stock HiOS 2.2 ROM, Android 7.0

It is installed properly but doesn't appear in magisk manager modules section.

Please help me! I can't use some modules that require busybox.
[Android Software/Hacking General [Developers Only]] amg314:
What module?
[Android Software/Hacking General [Developers Only]] Mickey03:
Busybox Magisk module 1.31
[Android Software/Hacking General [Developers Only]] amg314:
https://xdaforums.com/showpost.php?p=80338519&postcount=2484
[Android Software/Hacking General [Developers Only]] osm0sis:
Also install log. More than likely you've got SuperSU leftovers somewhere like all others who have had this issue.
[Android Software/Hacking General [Developers Only]] BrahmaGandhi:
hi, sir [MENTION=4544860]osm0sis[/MENTION]

i just flashed busybox module v1.31.1 in magisk, rebooted and i found two busybox installed in,,

1) in /system/xbin/busybox (349 files) which is yours right?

2) in /sbin/.magisk/busybox (313 files) <-- what is it? is it magisk inbuilt? are both ok being installed together?

thanks a lot!

*havoc Q, magisk canary 20*
[Android Software/Hacking General [Developers Only]] amg314:
/sbin/.magisk is a mirror of real /system partition))
[Android Software/Hacking General [Developers Only]] BrahmaGandhi:
ok so is it safe to delete? and use only the 1.31.1 one? thanks
[Android Software/Hacking General [Developers Only]] jcmm11:
No. Leave both alone. The one in /sbin/.magisk/ is magisk's internal busybox which it needs for various functions.

The mirrors of the various partitions are in /sbin/.magisk/mirror/
[Android Software/Hacking General [Developers Only]] amg314:
Do you really can, looking in the mirror, remove your image?
[Android Software/Hacking General [Developers Only]] Keule-Tm:
Sure. Use a periscope.
[Android Software/Hacking General [Developers Only]] BrahmaGandhi:
well noted. thanks man

---------- Post added at 04:49 ---------- Previous post was at 04:38 ----------

i meant to delete the busybox folder

as he said https://xdaforums.com/showpost.php?p=81037117&postcount=2562

system partition mirror actually is located in sbin/.magisk/mirror
[Android Software/Hacking General [Developers Only]] amg314:
If you need remove busybox, delete installed BB module thru Magisk Manager.

If you need to find out BB location, use

which busybox

command in Android terminal
[Android Software/Hacking General [Developers Only]] cmonty14:
Hi,

I have a question related to "Busybox Installer (all devices)".

In the postings for this packages it is written that this is for Android NDK builds.

How do I know if my device has an image with Android NDK build?

My device is: OnePlus 5T

OxygenOS 9.0.9

Build-Number ONEPLUS A5010_43_191008

THX
[Android Software/Hacking General [Developers Only]] osm0sis:
No it is written in the readme and documentation that it's built with the Android NDK. It's for all devices and ROMs.

The repo naming saying "Busybox for Android NDK" should be read more like "Busybox for Android - NDK" where the NDK is there to point out one of the main differences between mine and other developers' busybox builds, namely it having been built with the NDK.

Nobody's ever been hung up on that before. :silly:
[Android Software/Hacking General [Developers Only]] ahhl:
i tried to adb sideload fla**** but it just aborted.

i am on lolipop.

any advice?
[Android Software/Hacking General [Developers Only]] osm0sis:
"It just aborted." Log? Explain what you were doing with more detail?
[Android Software/Hacking General [Developers Only]] ahhl:
the error was

failed to verify whole-file signature

signature verification failed

installation aborted
[Android Software/Hacking General [Developers Only]] osm0sis:
What recovery were you trying to sideload it into? All my zips are signed with testkeys so should pass verification on TWRP. Maybe you had a bad download.
[Android Software/Hacking General [Developers Only]] ahhl:
oh..

i am not using twrp as twrp doest work on my asus zenfone6. already tested various recommended twrp on the net.

i am on stock lolipop recovery
[Android Software/Hacking General [Developers Only]] osm0sis:
And the fruits of my labors! :p

ADB Screenshot v2.0 is up in the OP!

- Switch to using fb2png (maintained by PhilZ) to make screenshot work for most if not all devices!

Thanks [MENTION=4675598]shoey63[/MENTION] for pointing me at this. In the end I couldn't use adb_screenshoot (a desktop binary, part of the fb2png source) since it wouldn't work correctly on Win32 even though I got it to compile, but I modified shoey's original idea of pushing/executing the ARM binary and that works perfectly, so ADB Screenshot is a handy front-end for fb2png now. :D

In other news:

All versions (Win32, ARM, Linux) of my Android Image Kitchen have been updated!

AnyKernel2 has also been updated!

Edit

: I also created scripts for a Unified ext4+f2fs kernel ramdisk where init launches a script to check the filesystem type and loads the correct fstab on-the-fly. Pretty good fun. ;) http://xdaforums.com/showpost.php?p=53191173&postcount=9923

And Unified ext4+f2fs ROM install zips: http://xdaforums.com/showpost.php?p=53312320&postcount=10192 :cool:
[Android Software/Hacking General [Developers Only]] z31s1g:
Outstanding work, once again.

I'll integrate this to the theme (should be possible the same way as done with Aroma FM I guess). Installing new images from within the recovery. Love. It. [emoji1]
[Android Software/Hacking General [Developers Only]] :
Nice work [MENTION=4544860]osm0sis[/MENTION]. I am currently trying to include "show_progress" in my script, but it seems it doesnt want to play nice lol. Progress bar goes full immediately until script is complete. Annoying really.
[Android Software/Hacking General [Developers Only]] osm0sis:
I can help, what have you got? :)
[Android Software/Hacking General [Developers Only]] osm0sis:
What's up with that crazy number? Weird way to do that. :p

Here's how I do it from a shell update-binary:

show_progress() { echo "progress $1 $2" > $OUTFD; }
set_progress() { echo "set_progress $1" > $OUTFD; }

You'd have to mod that slightly (like you've already done) like ui_print in that Chainfire thread but it should work.

The max was found (through trial and error) to be 1.34, so you can either set that over a period of seconds, like "show_progress 1.34 5" or set the max with "show_progress 1.34 0" then move it manually, "set_progress 0.2" up to 1.34. :)
[Android Software/Hacking General [Developers Only]] :
Lol, that number is only temporary. Prior to it being read my goal is to calculate a particular value and change that temporary value to another specified value using sed.

So this way I can let the script determine the amount of time it will take without me needing to manually determine it myself and "hard coding the value".

The problem though, is that I have gone as far as hard coding the value and the result tends to be the same.

The only thing I haven't tried is using it at the beginning of the script but to be honest I would think it isn't required given the design and usage of the script and all of it's methods being called.
[Android Software/Hacking General [Developers Only]] osm0sis:
Hmm okay, for your method, now that I've read it again and think I understand it, I think you need to use "show_progress 700777007 0" to set the max then set_progress instead of show? :good:

Also, cool idea, but instead of messing with sed wouldn't it be easier to just "show_progress `wc -w $0` 0" ?
[Android Software/Hacking General [Developers Only]] :
Not necessarily.

What I am doing is hard coding the show progress function with that crazy number. This case being, 700777007.

Then, when my script is ran, it will use the SED_CHANGE_WORD function to change that crazy number to a completely different value based on a specific mathematical calculation so this way it will give a more pure and accurate progress bar during it's usage. This is all done before the script even reads out the show_progress function so it doesn't execute that crazy temporary number.

---------- Post added at 04:51 PM ---------- Previous post was at 04:45 PM ----------

The problem is that the progress bar always goes to full immediately. No matter what I set the value to be. Even if I comment out the other methods and just hard code the value lol. Strange to see it act in this behavior. My only conclusion is that I am running this function towards the bottom of the script and even though it's being ran long before the script is even finished the mere fact that it's at the bottom may be the culprit in an awkward reasoning way. So I will be trying it at the top of the script and see what the result will be. Trying to avoid using set_progress. Way too much for that lol.

---------- Post added at 05:13 PM ---------- Previous post was at 04:51 PM ----------

Hmmm, didn't think of that one. Will definitely try it out. Will do so more like this though:

show_progress 1.34 `wc -w $0`

Thanks for the idea.
[Android Software/Hacking General [Developers Only]] anagramgenius:
is there any way to odex in pc?
[Android Software/Hacking General [Developers Only]] osm0sis:
Nope that's not how it works.

"show_progress 1.34 5" will fill the bar (1.34) in 5 seconds. 1.34 is the smallest max you can use and actually fill the bar.

"show_progress 1.34 0" will initialize the bar with a max of 1.34. Then "set_progress 0.2" (where 0.2 is some portion of 1.34 - the max) will move the bar to that position.

You should try to make the max your big crazy number by using it instead of 1.34 in show then move it with x/7007770077 by using x in set. If that doesn't work then try dividing 1.34 by your big crazy number and advance it by the resulting decimal points.

There are a number of apk kitchens/tools that can if you pull all the framework files from the device.
[Android Software/Hacking General [Developers Only]] :
[MENTION=4544860]osm0sis[/MENTION], I'm not using 5 - that would be crazy lol. I just took your idea and did as follows in my script - it actually worked, just need to make a slight modification.

VALUE=$(wc -l "/tmp/MyMind" | sed 's/^\([0-9]*\).*$/\1/')

show_progress 1.34 $VALUE;

I used sed for the variable 'VALUE' because I am wanting only the value and not the text which is displayed afterwards.

The current usage above shows a value for like 70 roughly when actually applied - going off the top of my head right now.

Nevertheless, the progress bar works now. I just need to use a more appropriate command for determining a more proficient value than what I mentioned above.
[Android Software/Hacking General [Developers Only]] anagramgenius:
any plans of making tool to odex in pc? i placed an apk in /system/xbin/ and odexed it. how to odex in batch? i wanna odex the entire /system/app/. my framework files are all odexed.
[Android Software/Hacking General [Developers Only]] :
[MENTION=4544860]osm0sis[/MENTION], have you considered looking at the twrp source to see how TeamWin is going about calculating the progress time when say, restoring your /system for example?

I'm gonna do that now and see about adapting it to my script lol. An idea anyways :).
[Android Software/Hacking General [Developers Only]] osm0sis:
Cool. You're still missing my point though.. What you're using $VALUE for is the number of seconds the bar takes to fill. You probably don't want it to take 700777007 seconds, or even 70, because recovery will actually slow down the flashing process to meet that time.

You need to know the total words and the current word, then "show_progress $words 0" and "set_progress $curword"

OR

"show_progress 1.34 0" then something like "set_progress $(awk -v words=$total -v curword=$current 'BEGIN { print 1.34 / words * curword }')";

Nope. There are several batch based ones for PC already, like I said. Have a Google. :)

If you want to just odex a random apk you added, that's what my on-device script you quoted is for.
[Android Software/Hacking General [Developers Only]] :
Very nice. I understood what you were saying before. But now that you laid it out with the above examples it definitely has been made more clearer. Bravo bro. Now, I just need to determine the value for 'curword' given the '-v' option prior too.
[Android Software/Hacking General [Developers Only]] osm0sis:
Noticed I missed the assignment and edited my above. Glad to help. It's fun abusing the way things work in Android eh? :D

Really cool idea for having a real-time progress. Nice work. :good:

Edit: [MENTION=5537766]Modding.MyMind[/MENTION] I did some testing today with my updated Flashify, and it looks like show_progress timing differs in CWM and TWRP. CWM is more like seconds and will hold up completion, where TWRP is like deciseconds and doesn't. :confused: :p
[Android Software/Hacking General [Developers Only]] :
Totally agree with ya haha. Thanks for the assistance man. Been very helpful.
[Android Software/Hacking General [Developers Only]] osm0sis:
Updated Flashify Script zip in the OP!

- Add radio/modem image support.

- Add support for weird partition naming on grouper/tilapia (thanks Nvidia...), only because it's a Nexus and in AOSP.

- Fix up output when no matching partition is found.

- Fix potentially non-alphabetical order of filenames from ls command.

New script changes and details here: http://xdaforums.com/showpost.php?p=53543397&postcount=242

[MENTION=2719389]z31s1g[/MENTION] should be adding this to his beautiful and feature-rich TWRP Holofied themes soon as well, so keep an eye out for that in a device forum near you! :D

Please remember to thank the first post of this thread if you find any of my tools/scripts useful, helpful or interesting! :good:
[Android Software/Hacking General [Developers Only]] osm0sis:
Well pretty clearly their stock recovery doesn't accept testkeys and is likely locked down to their private OEM key, so if there is no option to disable verification you're out of luck with sideloading anything.
[Android Software/Hacking General [Developers Only]] jcmm11:
If you're successfully rooted with Magisk you can just flash it via Magisk Manager. Go to the "Modules" tab then hit the big + at the bottom and select the zip.

You can also get either Franco Kernel Manager https://play.google.com/store/apps/details?id=com.franco.kernel or Ex Kernel Manager https://play.google.com/store/apps/details?id=flar2.exkernelmanager

Both of them have, among their other functions, the ability to flash zips
[Android Software/Hacking General [Developers Only]] tapa_t:
adb connect localhost keeps asking for authorization

Hi there,

I need help using your magisk module "ADB & Fastboot for Android NDK"

First of all, thank you for providing such a useful tool.

I am trying to connect to the adb server on localhost so that I can mount encrypted folders at runtime and make them visible to other applications.

Using a terminal emulator, I can connect to localhost and mount folders ok. The problem is that, every time I type

adb connect localhost:5555

authorization window pops up, despite previously checking "Always allow from this computer" when authorizing.

I also made sure that /sdcard/adbkey.pub was generated and the content of adbkey.pub also exists in /data/misc/adb/adb_keys. Every time I connect to localhost and authorize the connection, it adds another line of an identical key at the end of the list of keys in adb_keys. So, the key from adbkey.pub is being recorded yet it still asks for authorization every time. I don't understand why it won't stop asking for authorization. How can I get rid of the authorization dialog and just connect by issuing the command?
[Android Software/Hacking General [Developers Only]] osm0sis:
Are you running it from a root prompt? Maybe it can't access the file. Also, that's more ROM-side stuff accepting the key..
[Android Software/Hacking General [Developers Only]] tapa_t:
Thank you, osm0sis.

Yes, I am running it from root prompt (#) in a terminal emulator.

I don't exactly know how this authorization works (as in which key is being passed from who to who and when, what are compared and how, etc.), but I thought your adb binary running locally should be automatically authorized by adb server running locally and listening to localhost:5555, as the adb client is generating /sdcard/adbkey.pub and the adb server is (or isn't it?) writing the key in adbkey.pub to /data/misc/adb/adb_keys. Am I missing some point? Are you saying that even after the adb server has the adbkey.pub, the ROM (the OS?) still has to approve the authorization?

I also adb connect to the same phone (Sony Xperia F5321, stock 8.0, Magisk, rooted, Xposed) from a Windows 10 machine via USB and Wi-Fi without seeing the authorization dialog after the first time. I am wondering what is making it difficult for the phone to recognize itself alone - Is the server looking at a wrong key? Is the key not matching the client (the phone itself? or the client running on it?)? The only difference I could find so far is that the keys in /data/misc/adb/adb_keys: the keys from adb on the Windows machine end with "EAAQA=" while the keys from the local machine end with "EAAQA= root@F5321". I tried deleting " root@F5321" from one of the lines but it made no difference.

I'd appreciate any hint as to what might be causing this and where to look into.

Thanks again,
[Android Software/Hacking General [Developers Only]] osm0sis:
Honestly not sure, all I can tell you is adbd (the server) is part of the ROM, so I'm not sure why it wouldn't work as with other clients.

Did you try running `stop adbd; start adbd;` first to make sure it's also running as root?

Edit: Searching the thread, here's what our resident adb hacking guru [MENTION=4939386]Surge1223[/MENTION] suggested back in the day for localhost adb: https://xdaforums.com/showthread.php?p=68334459#post68334459
[Android Software/Hacking General [Developers Only]] dgunn:
By chance you don't have a widevine script for OnePlus 6 10.0.1 do you???? Would really like my L1 back after rooting
[Android Software/Hacking General [Developers Only]] osm0sis:
Remove your quote of all that **** please. It's very bad form to quote the entire OPs of a thread.

No way that I know of, it's tied directly to the actual bootloader lockstate somewhere.
[Android Software/Hacking General [Developers Only]] dgunn:
I did after I realized what had happened. Thank you
[Android Software/Hacking General [Developers Only]] Surge1223:
There's quite a bit behind this, it depends on the env in root shell, uid or the process that executed "adb shell" or "adb connect" etc, also depends the order of which dirs it scans to find the keys, I don't quite remember the order anymore but back when I made this I prioritized having it search /sdcard instead of /data/misc because the idea was to gain uid 2000 (shell) perms without using a pc or having root

I don't know why the pop-up is such a big deal, I usually don't get the pop up at all (and I adb on device as my only source or root)

If it's bothersome enough, set the persist adb listening port to tcp 5555 on boot and connect to the virtual emulator on 5554 instead of to localhost
[Android Software/Hacking General [Developers Only]] tapa_t:
Yes. I have always been doing:

F5321: / $ su
F5321: / # setprop service.adb.tcp.port 5555
F5321: / # adb kill-server
F5321: / # adb tcpip 5555
F5321: / # stop adbd
F5321: / # start adbd
F5321: / # adb connect localhost:5555

And it always asks for authorization as the first time.

---------- Post added at 07:03 PM ---------- Previous post was at 06:11 PM ----------

Thank you, Surge.

Sorry for a dumb question, but what is "it" that is scanning for "the keys"? Which keys?

Are you saying something is searching for adb_keys in /sdcard instead of /data/misc?

If so, should I copy /data/misc/adb/adb_keys to /sdcard? I will give that a shot.

If you don't get the pop up, I can understand that it's not a big deal. I DO get the pop up and want to get rid of it.

One of the app I use draw over other apps and prevent me from tapping "OK" on the auth dialog. I have to disable the app, authorize adb, then enable the app back. I eventually want to script all steps from adb connecting to mounting encrypted volume for easy one click and obviously not being able to click "OK" gets in the way.

What is this virtual emulator on 5554? Is it always there when adb is listening to port 5555? I have seen "emulator-5554" when I try connecting to localhost and wondered what it is. I have seen both at the same time:

F5321: / # adb connect localhost:5555
F5321: / # adb devices
localhost:5555 unauthorized
emulator-5554 unauthorized

My observations are:

"emulator-5554" always asks for authorization even with the key copied in /data/misc/adb/adb_keys, just like localhost.

adb shows only one authorization dialog. If I get emulator-5554, that's the only one that gets authorized, effectively preventing me from authorizing localhost.

I still have no idea where emulator-5554 came from, but I took a wild guess and uninstalled an app called "WiFI ADB" that I had on my phone. I have not seen emulator-5554 ever since.

If connecting to emulator-5554 does exactly the same as connecting to localhost, I don't mind using either one (if emulator-5554 ever come back). However, emulator-5554 still asks for authorization on my machine, therefore won't solve my problem.
[Android Software/Hacking General [Developers Only]] Surge1223:
Yeah connecting to emulator is the same, I changed some code to make emulator available because localhost gets blocked by default on some devices. At the time I was exploring virtual qemu ideas.

Same code as before, just modify with the below where appropriate.

adb kill-server
HOME=/data
adb devices
adb connect emulator-5554
adb -s emulator-5554 shell

Yeah check /sdcard/.android add keys as desired

Some background info

Because

void adb_set_tcp_name(const char* hostname) {
__adb_server_name = hostname;
}

int _adb_connect(const std::string& service, std::string* error) {

...skipped obvs defines and initializations of vars

if (__adb_server_name) {

fd = network_connect(__adb_server_name, __adb_server_port, SOCK_STREAM, 0, &reason);

if (fd == -1) {
*error = android::base::StringPrintf("can't connect to %s:%d: %s", __adb_server_name, __adb_server_port, reason.c_str());

return -2;
}
} else {
fd = network_loopback_client(__adb_server_port, SOCK_STREAM, &reason);

if (fd == -1) {
*error = android::base::StringPrintf("cannot connect to daemon: %s", reason.c_str());
return -2;
}
}
...buncha other crap
}

we want it to connect, which requires a hostname, and be signed by keys authorizing it
[Android Software/Hacking General [Developers Only]] nemanja066:
Osmosis FlashAfterUpdate script doesn't work on Lineage 16, but other scripts in /system/addon.d working good, so it's probably not a ROM issue.

I did all as instructed, (permmisions etc...), zip file i copied to data/flashafterupdate folder.

It looks like the script was running fine but the flash process of zip file failed because I can see flashafterupdate folder was created on sdcard as well as disable folder.

I also created a verbose empty file, but nothing was displayed on the screen.

Thanks.
[Android Software/Hacking General [Developers Only]] osm0sis:
1) Is your device A/B? The current version of FlashAfterUpdate is an addon.d-v1 script, so addon.d-v2 will skip it. A/B OTAs are a totally different ballgame, but I'm working on a possible solution.

2) If your ROM doesn't request decryption of /sdcard or /data during OTA then neither of those locations would work. Some don't mount /data at all. You'll either have to find a location that works (/cache or /persist maybe if either are a dedicated partition?), or reboot manually to recovery and flash each OTA to make sure things are decrypted.