yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] CapoFantasma97:
Hi, I used TWRP A/B Retention Script for the first time during an OTA update (installed update, installed script, installed Magisk in inactive slot after OTA update, then rebooted).

I have noticed that the retention script still shows up in the magisk modules list, with an update button prompt. Is this normal behavior? Should I do something about it?

Edit: nevermind, I rechecked the GitHub page and it's indeed fine

It will then show in the Magisk app's installed modules list but with a fake update always pending to allow downloading future actual updates and/or flashing as needed.​
[Android Software/Hacking General [Developers Only]] osm0sis:
Yeah, thought that would be a fun way to abuse the new Magisk module update mechanism for things to be run-as-needed like TWRP A/B Retention 🤠
[Android Software/Hacking General [Developers Only]] HippoMan:
I'm glad to see this is working!

It seems to be a reincarnation of the same (or at least similar) A/B Retention mechanism that used to be present back in the Stone Age with Magisk 23.0 and earlier.

It's ironic that something this simple and useful can be considered as "abuse" in comparison to what we have to struggle with nowadays. :)
[Android Software/Hacking General [Developers Only]] GabriLed:
Hi, anyway I tried it and it works with the new APIs 32 (Android 12 / 12l)
[Android Software/Hacking General [Developers Only]] justDave:
I installed this addon and took the latest LineageOS OTA and I see that TWRP was retained, as advertised. Why would someone use the Magisk TWRP retention module, which has to be reflashed with each OTA, instead?

Also, I decided to create a Magisk module to install this, which seemed easier/safer than remounting system rw and moving the file manually. Why not offer that in the TWRP addon repo instead of, or as an alternative to, the current module?
[Android Software/Hacking General [Developers Only]] osm0sis:
By "installing" it with Magisk the script isn't actually in system, so if we ever get addon.d-v2 working in TWRP again (still works in the _9 trees I believe) that one wouldn't exist and TWRP would be lost after the update. Moving the files in with system rw is the correct way to ensure this is all working correctly, booted and in recovery.

TWRP A/B Retention module is more for stock ROMs who therefore don't have addon.d-v2 at all.
[Android Software/Hacking General [Developers Only]] justDave:
Would that only happen if I installed the update in TWRP or even if I installed a LineageOS OTA?

BTW, I also tried the 999-flashafterupdate script hoping it would reinstall the alternate kernel I was using. It didn't. Magisk and TWRP were retained but the kernel didn't get reinstalled. Now that I think about it, if the FlashAfterUpdate did happen after the 98-twrp and 99-magisk scripts wouldn't it have wiped the twrp and magisk? How are these supposed to work together? Would I get rid of the twrp and magisk scripts and just place all 3 of the files into the FlashAfterUpdate directory? Are they flashed alphabetically?
[Android Software/Hacking General [Developers Only]] osm0sis:
I wouldn't even trust adding an addon.d-v2 script with Magisk for booted custom ROM A/B OTAs since Magisk's overlayed mounts might not work as expected for the ROM's backuptool script reading and copying over the /system/addon.d directory.

Something changed with something since before my going on pat leave and FlashAfterUpdate addon.d-v2 support seems broken, not sure if for everybody, I haven't had time to look into it yet. Yeah, they're in the order of the files in the directory, which is alphanumeric sorting.

TWRP, Magisk and AnyKernel3 all coexist fine, but it basically has to be in that order. 🙃
[Android Software/Hacking General [Developers Only]] justDave:
I mostly did it because for some reason I seem to remember that mounting system rw will break safetynet or something. Is that just not true (was it ever true)?

Congratulations are in order then!

Interesting. I wasn't counting on AnyKernel3 preserving twrp and magisk (I just reflashed the kernel and confirm that it does). So that's how it all holds together. I guess I can use all 3 scripts and just use FlashAfterUpdate for the kernel. I'll have a closer look at the FlashAfterUpdate script and see if I can see what broke. Of course, if could just be because I installed the script (but not the FlashAfterUpdate directory) with magisk.
[Android Software/Hacking General [Developers Only]] osm0sis:
IIRC lifetime writes was a dm-verity thing, not SafetyNet, and Magisk handles dm-verity stuff so you shouldn't have to worry about that, especially not on an unlocked bootloader with a custom ROM, where to get GApps into it system was already mounted rw at least once since the ROM flash.

Thanks! She's cute, we'll keep her. 😛😘

AnyKernel3 has always been all about preserving things, hence "Any".

Yeah, the idea is 98-twrp handles TWRP first, since TWRP replaces the entire ramdisk so it must be first, then 99-magisk (from Magisk zip/apk flash via recovery) does its thing, and then 999-flashafterupdate v2 support in AK3 allows for any custom kernel zip placed in the FlashAfterUpdate directory to be flashed at that point and stack it all.

(That's why I did the numbers like that too, since TWRP must come before Magisk and FlashAfterUpdate must be the very last.)

Thanks for looking into things; things are still pretty busy over here!🤞
[Android Software/Hacking General [Developers Only]] Phantom Thief:
How can we get the latest twrp retention script? Would it work by downloading the zip from your repo?
[Android Software/Hacking General [Developers Only]] osm0sis:
It's attached in the thread post now, which is linked in the OP: https://xdaforums.com/t/tools-zips-...ices-platforms.2239421/page-102#post-77770683
[Android Software/Hacking General [Developers Only]] Just4quora7277:
Hey man, I tired to flash your ADB-NDK module using magisk 24.3 but it keeps failing saying

"-Copying into temp directory - followed by Unzip error".

If i try to flash from twrp it says it's an

"invalid zip format"

I'm dying to have this module, it would be very useful right about now. If you have any advice, or earlier releases I could try that would be awesome. Thank yoU!
[Android Software/Hacking General [Developers Only]] osm0sis:
Works for me. Download from the OP again?
[Android Software/Hacking General [Developers Only]] justDave:
It's also available via Fox's Magisk Module Manager if you're using that.
[Android Software/Hacking General [Developers Only]] DiamondJohn:
Have you validated your download using something like 7ZIP?

can anyone give him an MD5?
[Android Software/Hacking General [Developers Only]] asripath:
ADB_&_Fastboot_for_Android_NDK-1.0.41(104107)

CRC32: a81fc3e1

MD5: de8fb37bdfbf818cd04ad67e0f3eb35b

SHA1: 3bd24a385aa77d99c640fe0365d6d596eaa5d6bb

SHA256: 2fbf54ec67af71f1838efb9b1a6ccd071c8d81399a3a928f23c50062309c51b8

SHA384: bfc5175413234fa333013250c8b1c695aa7c77c974de276bec6001602bf3e0403edb1ba3442a4e21239ff2679cda9c3d

SHA512: 4687c52e0f58f61bc7fc818b34ced7299379fb238daebca82eecf96a8c4dd645984ae1effca54bea2b9780e837fd87ef1ec5ddade98ea899f5f1eb0b8d4f7e66

Update

The above checksums seem to be for an older module version before Update module feature from within magisk module section was introduced, do refer to @osm0sis post for current checksums
[Android Software/Hacking General [Developers Only]] osm0sis:
One from the OP is

File: UPDATE-adb.Installer.v1.0.41-signed.zip

MD5: 0b:34:af:8f:44:23:48:ce:b3:43:dc:cf:7f:c4:62:1e

SHA1: 25:a8:3c:a4:3e:b9:44:93:bf:cb:bc:24:a9:66:36:05:d1:91:07:1e

SHA256: 7b:e4:d7:59:b5:54:b4:4b:8a:d7:ec:5a:6d:cb:12:f6:dc:d5:a8:b1:52:56:54:03:28:12:ae:e7:1f:3b:83:bd

And I confirmed it installs perfectly in Magisk:

- Copying zip to temp directory
- Installing UPDATE-adb.Installer.v1.0.41-signed.zip
Archive: /data/user/0/v.obylzr.ox.jow/cache/flash/install.zip
inflating: customize.sh
Archive: /data/user/0/v.obylzr.ox.jow/cache/flash/install.zip
inflating: diffusion_config.sh
inflating: module.prop

ADB Installer Script
by osm0sis @ xda-developers

Mounting...

Extracting files...
Archive: /data/user/0/v.obylzr.ox.jow/cache/flash/install.zip
inflating: META-INF/com/google/android/updater-script
inflating: META-INF/com/google/android/update-binary
inflating: README.md
inflating: bin/adb
inflating: bin/adb.bin
inflating: bin/adb.bin-armeabi
inflating: bin/fastboot
inflating: bin/fastboot-armeabi
inflating: customize.sh
inflating: diffusion_config.sh
inflating: module.prop
inflating: META-INF/MANIFEST.MF
inflating: META-INF/CERT.SF
inflating: META-INF/CERT.RSA

Installing...

Installing adb to /data/adb/modules_update/adb-ndk/system/bin ...
Installing fastboot to /data/adb/modules_update/adb-ndk/system/bin ...

Unmounting...

Done!

So, again, odds are you've just got a bad download and need to get it again.
[Android Software/Hacking General [Developers Only]] DiamondJohn:
@Just4quora7277 just a heads up to trigger a notification. You have the check-sums above.
[Android Software/Hacking General [Developers Only]] asripath:
Reinstalled am on magisk canary 24312,

module from OP,

work's without any issue
[Android Software/Hacking General [Developers Only]] 0xCuter:
Hi @osm0sis,

I have this storage problem on my OP6 (https://xdaforums.com/t/help-internal-storage-not-accessible.4432181/) and a user suggested I should flash your "SdcardFixPermissions-singed" script... do you think it could fix the problem? Worst case could it break more stuff?

(also if you have any other suggestion on how to fix it feel free to let me know)
[Android Software/Hacking General [Developers Only]] osm0sis:
Yeah worth a try, I don't think it'll break anything more than it already is. Android 10+ is supposed to handle that at boot time itself though, IIRC.
[Android Software/Hacking General [Developers Only]] 0xCuter:
I can still access all my files and internal data from recovery though, so I would like to preserve this ability for a backup... Do you think I might lose this ability flashing the zip? (want to make sure before doing something stupid)
[Android Software/Hacking General [Developers Only]] osm0sis:
That should be fine.
[Android Software/Hacking General [Developers Only]] DiamondJohn:
Can you access the files using a root file manager?
[Android Software/Hacking General [Developers Only]] BillGoss:
I've installed your ADB installer zip as a Magisk module on my OnePlus 3T.

If I connect my OnePlus 8T using a USB cable while it's in bootloader mode, the 3T shows me the 8T is connected when I run fastboot devices.

However, when I do the same when the 8T is booted into the system, the 3T does not recognise the 8T - adb devices shows nothing. Also, the 8T doesn't ask me to give it permission to connect to the 3T.

Is there a trick to getting ADB to work over a USB cable between two running Android devices?
[Android Software/Hacking General [Developers Only]] osm0sis:
This was the method I found to choose the host device last time I checked it out: https://xdaforums.com/t/tools-zips-...ices-platforms.2239421/page-145#post-84015381
[Android Software/Hacking General [Developers Only]] BillGoss:
Thanks! I found, that for me, I just need to connect the phones and then reboot the device (not the host). The battery levels had no impact.

I did, however, work out that I needed to start the ADB server as root otherwise it can't write it's log to /dev/tmp. I used su -c adb start-server. The rest of the time I just used the normal user to run the ADB commands.
[Android Software/Hacking General [Developers Only]] osm0sis:
Good to know! I think historically people did similarly by doing `su; stop adbd; start adbd` when needed.
[Android Software/Hacking General [Developers Only]] BillGoss:
And just to explain why I'm doing this...

I use the same setup on our phones, but do all the development on mine.

Then I sync the other devices from mine using rsync over ssh.

This works fine when all devices are on the same WiFi network.

But now I have a need to sync the devices when they aren't in the same network. I don't want to do it over the internet so I chose to do it over a USB cable.

I've found out that I can run ssh over USB by using adb reverse REMOTE LOCAL and then ssh -p REMOTE 0.0.0.0. So now I can run rsync over USB thanks to ADB!

In fact, this is how I sync my phone to my PC. Rsync has replaced adbsync.exe.
[Android Software/Hacking General [Developers Only]] HippoMan:
I definitely want to do this.

How do you determine the values of REMOTE and LOCAL?

Also, do you happen to know a way to accomplish the same thing when the PC and Android device are not physically connected, and where the device is not using WiFi but simply a regular cell connection?

I think there might be a way to do this via termux and maybe some other software, but I'm not sure.
[Android Software/Hacking General [Developers Only]] BillGoss:
LOCAL is the port specified by ssh on the PC.

REMOTE is the port the device will use when invoking ssh. You can use the same value for both, but I've found that ADB will sometimes complain about binding because the port's already in use.

So I've chosen to arbitrarily use a different port for REMOTE on each device I run ADB on, so that the calling device doesn't complain about having the known host fingerprint bring different (as the hosts are all accessed as 0.0.0.0).

Here's an example adb reverse tcp:8021 tcp:8022.

To reset things back to normal use adb reverse --remove-all

I found out about this from https://askubuntu.com/questions/907...-into-a-laptop-running-ubuntu/1063958#1063958

I have no idea how you'd do this over another type of network. I've always considered networking a black art.

@osm0sis: let me know if you don't want this discussed here.
[Android Software/Hacking General [Developers Only]] osm0sis:
Nah this is all good stuff. Give'r. 🙂
[Android Software/Hacking General [Developers Only]] HippoMan:
I see. Thank you very much.

So, are you running an sshd inside of the device? Perhaps via termux? Or am I still misunderstanding something?
[Android Software/Hacking General [Developers Only]] BillGoss:
Correct. On the host phone I run both ADB and sshd.

And I use Termux on both phones.

I'd be happy to share the shell scripts I use.
[Android Software/Hacking General [Developers Only]] HippoMan:
Thank you! The scripts will be very helpful.

And based on @osm0sis's recent comment, it's probably OK with him for them to be posted here. But if you don't think so, private message is fine.
[Android Software/Hacking General [Developers Only]] BillGoss:
I've attached three scripts (and their rsync exclude files). Remove ".txt" from all the file names.

sshu: sets up (-u) the ADB reverse ports (different on each host) or removes (without option) the reversal.

rstp: syncs the master phone to another phone.

rssd: syncs the sdcard of a phone to a PC either over wifi, USB cable with the devices on the same WiFi network (-u), or USB cable when not on the same WiFi network (-m)

Notes:

These are NOT designed as general purpose tools. They reflect my personal requirements and set up. Feel free to change and/or modify them as you wish.

I'm happy to answer questions about why/what I've done.

I'm NOT providing support for them. Use them to learn and then do your own thing.

Note re attachments. I couldn't attach two of the scripts so they are in the zip file. I have no idea why I couldn't attach them as text files
[Android Software/Hacking General [Developers Only]] HippoMan:
Thank you very much! I understand that these are set up for your own personal requirements, but they still show very well how this can be accomplished, in general.
[Android Software/Hacking General [Developers Only]] uknods3:
Why do I keep camping back to this screen. I'm hacked trying u do it
[Android Software/Hacking General [Developers Only]] Grease_m0nkey:
Trying to figure out this:

~ $ ./camera
* daemon not running; starting now at tcp:5037
* daemon started successfully
disconnected everything
* daemon not running; starting now at tcp:5037
* daemon started successfully
adb: no devices/emulators found
Connection refused
adb: no devices/emulators found
adb: device 'emulator-5554' not found

USB debugging and Wireless debugging is turned on. But the developer for OP8_Camera answered another user that the server port had changed, but that was over a year ago now and no fix yet.

Any advice around this issue would be really nice.
[Android Software/Hacking General [Developers Only]] rahaaatul:
@osm0sis how to put your nano script in unpacked ROM? I don't have magisk, so I can't flash it but I have root. Can you tell me how to put it with file explorer property? Thank you.
[Android Software/Hacking General [Developers Only]] osm0sis:
Use the advanced zip options by renaming with system in the name to force a system install.
[Android Software/Hacking General [Developers Only]] rahaaatul:
Sorry, I didn't understand it. What advanced zip? Btw, I should tell you that I do not have custom recovery, It's a android tv rom, I edited the flash file and modified su in it, and flashed it. I was thinking I could do the same thing with your nano. Put it in the rom.
[Android Software/Hacking General [Developers Only]] osm0sis:
If you have su for root then you should be able to use a booted flashing app like Franco Kernel Manager or something.

Download the nano zip from the OP attachments and rename it to add "-system" to the filename. Then flash that in FKM or whatever and it'll install to system.

You could also just look in the zip, it's pretty easy to figure out where things go if you want/need to do it manually.
[Android Software/Hacking General [Developers Only]] rahaaatul:
I figured where to copy the files, but I'm confused about the permissions. Can you tell me what permission to give for terminfo files?

- I manually put bin, etc, and sbin files.

- Gave 0755 permission to nano, nano.bin in bin and sbin.

- 0644 for Terminfo files
[Android Software/Hacking General [Developers Only]] rahaaatul:
I did it! 😭

But is this supposed to look like this?
[Android Software/Hacking General [Developers Only]] Renate:
Are you referring to my adbsync.exe?

Why would you want to use anything else? :p
[Android Software/Hacking General [Developers Only]] osm0sis:
Nope, looks fine here.

Maybe your TERM isn't getting set correctly? The nano wrapper script in bin should find the terminfo files on etc. They should be 644 by the way. Works when the zip installs to system.
[Android Software/Hacking General [Developers Only]] BillGoss:
Ah, your adbsync.exe was so, so much better than trying to use adb push/pull.

I used it for a long time until I needed something similar to run on the phone.

Thanks for giving us a great tool.
[Android Software/Hacking General [Developers Only]] rahaaatul:
I meant 644 sorry, r-w-r-r permission. I typed the wrong number. I set permission with solid explorer.

Are you doing it natively? I installed nano in my tv and accessing it from phone via adb.
[Android Software/Hacking General [Developers Only]] osm0sis:
Yeah you probably need to experiment with different TERM values to find one that works over adb like you want. Look in the terminfo files for the different names to try. pcansi, screen and xterm are the most commonly used. When you find one that works you could edit it into my wrapper script.
[Android Software/Hacking General [Developers Only]] rahaaatul:
Thank you. I will try.

If you don't mind, can you tell me how did you make the wrapper file and what is making it work? I want to learn to do this myself. If you would point me in right direction, I'd really appreciate it. Thank you.
[Android Software/Hacking General [Developers Only]] osm0sis:
Just look at it in an editor, it's a shell script.
[Android Software/Hacking General [Developers Only]] richardmace:
Question regarding the twrp a-b retention script. Now direct install from magisk is not supported. Is the version in this thread the one to download?

Edit:- yes I guess it is!
[Android Software/Hacking General [Developers Only]] cantalat05:
Where is the flashabe zip for busybox ndk for android latest build.?????
[Android Software/Hacking General [Developers Only]] IronTechmonkey:
The first line in the post which you quoted states "New addition to the OP", and there is a busy box installer listed in the OPs of this thread in a section containing installable zips. Is that what you are looking for? If so, and even if not, please consider not shouting at people with all caps.
[Android Software/Hacking General [Developers Only]] cantalat05:
Ok, sorry but i just looking for magisk module like named; "busybox ndk for android zip".

but it linked url under "Busybox Installer (all devices) - attached" its so hard to find. because previous downloaded file from magisk manager > modules tab, named like "busybox 1.34 ndk for android zip" etc. i was not looking for "UPDATE-Busybox.Installer.v1.34.1-ALL-signed.zip" filename.

it was so hard to find. tons of text. not clear for me. also searched for the file in github about 2 hours. no releases tab etc. this made me mad.

thank you.
[Android Software/Hacking General [Developers Only]] IronTechmonkey:
Ahhhh... you suffered the problem of knowledge, which made it hard to find what you want. :D Seriously, I had no knowledge or expectations about file name so I stumbled my way to that section based only on your description. Anyhow I'm glad it seems to be what you needed.
[Android Software/Hacking General [Developers Only]] cantalat05:
Nope. it wasnt a knowledge problem. only update problem. i cant look to upgrades just for a while. So i have a zip file, i searched same filename pattern for latest version of busybox. Because titanum backup not recognise the root without busybox installed in lineage os 19.1.

So, i wish and my opinion, if a github profile exists, if github page that inccludes readme knowledge and how to compile from the scratch a busybox (terminal commands etc.)

it should has a releases tab and the flashable zip file should be there.

instead of that, the github redirects to forum. forum has tons of module and not clear.

the forum article should has seperator lines, and different colored links with "download" keyword.

Hope if i can explain what i mean. See you.
[Android Software/Hacking General [Developers Only]] Oswald Boelcke:
I'm not convinced if I correctly understand your issue. I'm using Fox's Magisk Module Manager to update my Magisk modules. Have you tried that?

GitHub - Fox2Code/FoxMagiskModuleManager: A module manager for Magisk because the official app dropped support for it

A module manager for Magisk because the official app dropped support for it - Fox2Code/FoxMagiskModuleManager

github.com

Androidacy Module Manager | F-Droid - Free and Open Source Android App Repository

Androidacy Module Manager is an easy to use Magisk/KernelSU module management ap

f-droid.org

Spoiler content hidden.
[Android Software/Hacking General [Developers Only]] cantalat05:
Woow, bingo. thanks so much. just wish an advice like this.

Best regards.

👏👏👏👏👍👍👍
[Android Software/Hacking General [Developers Only]] cantalat05:
Dear friend @Oswald Boelcke a little question; which one should i select;

1) builtin busybox (by zgfg)

2) Busybox for Android NDK (by osm0sis)

? i cant decide?
[Android Software/Hacking General [Developers Only]] Oswald Boelcke:
Unable to advise. My screenshot shows what I use.
[Android Software/Hacking General [Developers Only]] cantalat05:
Me too. thank you for all.

sincerely have a nice day.
[Android Software/Hacking General [Developers Only]] rodken:
In addition to the 2 aforementioned

-- {Mod edit}
[Android Software/Hacking General [Developers Only]] osm0sis:
Guys, come on.
[Android Software/Hacking General [Developers Only]] Oswald Boelcke:
@rodken Post edited. Do not promote other code in a developer's thread! This is cosidered as disrespect to the threadowner and as such a violation of rule no. 2.

Regards

Oswald Boelcke

Senior Moderator
[Android Software/Hacking General [Developers Only]] VivaErBetis:
[MENTION=4544860]osm0sis[/MENTION]

just tested your bootunlocker utility with a nexus 10 under lollipop (LRX21P) and works as expected.

BTW: there is no new option related to bootloader unlocking in it's development options.