[Android Software/Hacking General [Developers Only]] osm0sis:
Addon.d Scripts

999-flashafterupdate.sh addon.d+addon.d-v2 script (many devices) - attached

For ROMs that don't have "Flash After Update" support built into their delta/update process. During an upgrade, this script will flash zips from an sdcard directory, with several options (listed in the script header) for displayed output, after all other addon.d backup/restore actions have completed. This can be used to flash SuperSU and then an AnyKernel2/3 kernel on LineageOS, for example. Only zips that specifically support addon.d-v2 can be supported on A/B devices. Partition img flashing is also supported. See this how to for usage instructions with A/B devices. Unzip once downloaded and place in /system/addon.d/ with rwxr-xr-x (755) permissions.

98-twrp_ab.sh addon.d-v2 script (many devices) - attached

Allows you to keep TWRP installed in a boot partition through A/B OTAs with Magisk installed by copying the TWRP ramdisk from the current slot to the updated one, before Magisk's addon.d-v2 script patches it. Requires a current Magisk installation since we need the tools and Magisk's the only way to ensure a working addon.d-v2 environment across ROMs at the moment. Unzip once downloaded and place in /system/addon.d/ with rwxr-xr-x (755) permissions.

97-dumpimages.sh addon.d+addon.d-v2 script (many devices) - attached

For ROMs with boot.img, etc. inside an OTA payload.bin or otherwise inaccessible, it dumps the updated chosen partitions before further modifications (TWRP, Magisk, etc.), saving it to /sdcard/Download/boot.img, etc., or to/from other customizable locations at the top of the script. Unzip once downloaded and place in /system/addon.d/ with rwxr-xr-x (755) permissions.

00-omnirootfix.sh addon.d-v2 scipt (many devices) - attached

OmniROM appears to include 69-gapps.sh automatically in its /system/addon.d directory despite not shipping with any GApps; when not rooted this doesn't appear to present a problem, but really this is only because the script doesn't have enough permissions to run how it's supposed to since Omni's sepolicy doesn't let addon.d-v2 work correctly. Once Magisk is installed, providing more privileges to the addon.d-v2 update_engine, Omni's 69-gapps.sh would remove important system files during an A/B OTA when no GApps were installed, so this script will simply prevent that for those wanting to run Omni minimally and with root. Remove the .txt extension once downloaded and place in /system/addon.d/ with rwxr-xr-x (755) permissions.

00-resizesystem.sh addon.d script (many devices) - attached

One common solution for aging devices is to resize the /system partition so that it can hold newer, larger ROMs and, of course, GApps packages. On devices where the /system partition has been resized to hold larger GApps packages, but the ROM in use has system.dat format zips with no resizing functionality, the extra space would get lost in a ROM delta flash, breaking things when GApps attempted to restore. This script will resize the system partition to its maximum before the GApps restore occurs on EMMC-based devices with standard partition naming. Remove the .txt extension once downloaded and place in /system/addon.d/ with rwxr-xr-x (755) permissions.

10-extract-lineage-kernel.sh addon.d script (many devices) - attached

Nowadays with systemless root and other boot.img mods out there, it's good to have a backup of your ROM's unmodified boot.img handy in case you want to do a clean flash of your boot partition. Since LineageOS moved their update zips to a /data/data subdirectory that made this harder to get to, I automated the procedure as an addon.d script so that the newest gets extracted on each update. The output directory may be changed by editing the script. Remove the .txt extension once downloaded and place in /system/addon.d/ with rwxr-xr-x (755) permissions.

999-customkernel.sh addon.d script (many devices) - attached

Addon.d is awesome at restoring your GApps, root app, and other things after a ROM Delta, update, or dirty flash, but of course this can leave a lot of stuff out that you'd also have to re-flash (see below for a personal addon.d script you can modify to cover anything else you want to save). This script aims to help remedy the issue for custom kernel users on EMMC-based devices with standard partition naming by dumping the current kernel as part of the addon.d backup process, and then restoring it after the ROM has flashed its included kernel. Remove the .txt extension once downloaded and place in /system/addon.d/ with rwxr-xr-x (755) permissions. This is deprecated by my FlashAfterUpdate addon.d script, above.

Utility Scripts

magisk-ci_installer.sh (many devices) - link

Allows easily installing the Continuous Integration (CI) GitHub Actions builds of Magisk for those testing bleeding edge commits pre-release or Pull Requests. Can be run using root from a file explorer app like FX from your Download directory with the full Artifact zip from GitHub.

gen_pif_custom.sh (many devices) - link

Generates a custom.pif.json from device dump build.prop files for use with my PlayIntegrityFork (or optionally in pif.json format for chiteroman's PlayIntegrityFix) Zygisk module. May be run on-device from a file explorer app like FX from your Download directory, from a command prompt, or on a desktop Linux shell.

autopif.sh (many devices) - link

To undercut the bizarre PlayIntegrityNEXT "fork" that removed all PIF commit history/authorship I automated its core feature: download the latest Xiaomi.eu PI injection APK, unpack it to get the latest spoof values and output a pif.json. Except my version is completely run on-device! The pif.json is in chiteroman's PIF format, but may then be migrated to my custom.pif.json format (though I recommend finding your own custom fingerprint to spoof since it'll last longer). May be run on-device from a file explorer app like FX from your Download directory, or from a command prompt.

logohack.sh (GN) - link

Galaxy Nexus bootloader image replacement hack script. Inspired by bitdomo's brilliant imgdata tool and replicating the functionality of Ezekeel's abandoned, broken paid Logo Me app, this script improves upon the app version by working on all Galaxy Nexus bootloaders and on-the-fly, to allow replacement of the Google logo and lock images within the sbl partition. Remove the .txt extension once downloaded and place in /system/bin/ or /su/bin/ with rwxr-xr-x (755) permissions. It can then be run from the Terminal.

settingsdump.sh (deprecated) (many devices) - attached

In comparing vm settings from various kernels and ROMs to see what's out there, I wrote this script to generate a list of the values of all the relevant sysfs files and directories. Now expanded to cover cpu and governor as well. Remove the .txt extension once downloaded. To run it, assuming you just put it in /sdcard/, open Terminal Emulator and type: "sh /sdcard/settingsdump.sh" (without quotes). It will output the file to /sdcard/r*-output.txt where * is the revision of the kernel you're running. This makes it easier to compare what's changed between different nightlies, for example.

flash_image (many devices) - attached

MTD devices require a little extra finesse when flashing partitions from the command prompt and multiple commands, versus MMC devices, for which we can just use the dd command both ways. I wrote this little script to simplify the process for myself in my MX Box tinkering. It parses /proc/mtd so you only need to enter the partition name. It requires _n0p_'s excellent MTD-Utils compiled for Android, and uses grep and cut from busybox. Remove the .txt extension once downloaded and place in /system/xbin/ with rwxr-xr-x (755) permissions. It can then be run from the Terminal.

getprio (all devices) - attached

Android doesn't allow you to check the priority (or "niceness") of a process with the getpriority command as you would with normal Linux, and busybox doesn't provide this functionality either, so I wrote this reasonably simple script to allow you to check the niceness of a process. Some kernels have been experimenting with increasing the priority of com.android.systemui for smoothness, so this command can be used for testing different levels and whether the renice command set it correctly. Remove the .txt extension once downloaded and place in /system/xbin/ with rwxr-xr-x (755) permissions. It can then be run from Terminal with either the pid (default), class or a class name search string. Uses pidof and pgrep from busybox.

Boot Scripts

000killchromezygote service.d script (N7 '13) - link

A workaround for the slowdowns on my Nexus 7 2013 with the latest Lineage Unofficial builds, since for unknown reasons Chrome behaves differently on some older devices and spawns ongoing zombie chrome_zygote processes which essentially eventually behave as a memory leak by consuming all the device memory.

950iosettings + 875mntsettings + 925vmsettings + 975experimental init.d scripts (all devices) [with Franco's Dev Team] - links

Also available bundled in an installer. The scheduler tunables have already gained a bit of attention/adoption on various devices and kernels, but this is the init.d script I wrote to set the new custom scheduler tunables values as "default" by an independent loop, sleeping in the background and detecting each time the scheduler is changed. There is no effect on idle drain or deep sleep. The settings included are the complete work of the "Franco's Dev Team" (or "Team Franco") tuning collective, of which I was a member. We strove to perfect the scheduler, vm and various other settings for the smoothest and fastest experience available. The collective was: malaroth, osm0sis, joaquinf, The Gingerbread Man, pkgnex, Khrushy, shreddintyres. If you are a developer and would like to include these tunables/scripts in your kernel or ROM please provide credit. A lot of time and effort has gone into this project and that's all we ask. Lollipop(+) updated versions now also available through the continued excellent work of pkgnex.

gappsintegrator init.d script (many devices) - link

ROM GApps Auto-Integration of /data/app GApps into /system, complete with libs (unlike Titanium Backup), for Jelly Bean through Marshmallow. It should process things early enough in the boot that afterwards Dalvik will immediately do the cleanup ("Android is upgrading..."), much like following an OTA. An initial GApps installation is one requirement and there are some important notes for support of Lollipop and above. Intended for ROMs with a busybox installation. Can also remove libs from and zipalign the integrated APKs if those binaries are present in the ROM.

lmkwhitelist init.d script (all devices) - link

Users running ROMs or kernels with extremely aggressive custom lowmemorykiller (lmk) driver settings may notice their launcher redrawing frequently. Some kernels/ROMs also include an exclusion for this by making stock (or the included) launcher unkillable, however that still leaves all the 3rd party launchers out there that people use. I wrote this init.d script with a community created list of the most common launchers to make whichever one is installed unkillable. This also has instructions for how to set up init.d scripts. If your launcher isn't included in the list, you can modifiy it by adding the application class name (from the Play Store URL) to the list within quotes, separated by spaces. Also part of the 975experimental Franco's Dev Team init.d script, linked above.

dalvik2cache init.d script (all devices) - link

Bind mounts the dalvik-cache directory to the cache partition. Useful on devices where the cache is sizable and unlikely to be used for OTAs (custom ROM, etc.), and the data partition is not. Every little bit counts!

Other

Play Integrity Fork Zygisk Module (many devices) [with chiteroman] - link

After having numerous issues working to improve the original Play Integrity Fix repo, I decided to fork it myself to provide some stability, make it more futureproof and develop more methodically. It is a Zygisk module which spoofs a different device's Build fields and system properties to pass "ctsProfileMatch" (SafetyNet) and "MEETS_DEVICE_INTEGRITY" (Play Integrity) verdicts.

BootUnlocker app (many devices) [with segv11] - link

With a number of users researching and contributing the bootloader lockbit and tamperbit offsets in threads around xda and to the development thread for seg11's excellent BootUnlocker app, I have begun making beta builds with these new devices added. With hopes of adding any/all that can be, it now supports all the older Nexus devices, OnePlus devices and several others. We are accepting Pull Requests and collaborators for further device/design updates. Check my original revival post for more details.

G-Box Midnight MX2 g18ref ROM, recovery and kernel osmods (MX Box) [with BenniBenassi & relol] - link

I bought one of these unbranded Android TV boxes and was immediately determined to tweak it as much as possible following my work on the Galaxy Nexus. Flashing the official Matricom stock ROM over the generic included one I also discovered the recovery didn't have any A/V output to my old CRT TV. I set out to dump the kernel and recovery images, fix the recovery images and tweak the kernel defaults for the most performance.

Holo Stock Notification Icons for Notification Toggle (many devices) - link

This was likely my first post ever on xda. It is a "Notificon" pack for j4velin's fantastic Notification Toggle App, bringing a seamless stock look to this indespensibly useful app. Also a great way to get back to Settings easily from the notification shade since Android 4.2, and add shutdown/reboot menu functionality to stock/vanilla ROMs.

My GN Kernel Settings + 900colorsettings init.d script (GN) - link

I was being asked a fair amount for my kernel settings over in the GN f.K thread where I helped out, so I posted them up. I also put up an init.d script for setting color values on boot, which can drastically change the outcome on older panels, and at least makes custom values seamless. Instructions for how to set up init.d scripts are included.

Galaxy Nexus Baseband Collection: maguro - i9250 / M420 / SC-04D Radios (GN) [with josteink] - link

Original thread author josteink moved on to other devices and asked me to take over the thread. Lots of great information on the GN radios, posted alphabetically by region and chronologically by the build string date I found embedded in the images. Huge respect and massive thanks to josteink for seeing the need for a baseband thread almost as soon as the Galaxy Nexus was launched, way back in December 2011, and maintaining it diligently.

TK GApps (many devices) [with TKruzze] - link

After helping TKruzze with some of the concept and script work for his famous Paranoid Android Google Apps packages (PA GApps 2.0), we decided to collaborate again for his return to XDA after a much-needed hiatus, with me doing the thread setup and management with DevDB, and a Q&A section so things don't get overwhelming for those trying to follow along. The main thread remains locked and can be subscribed-to for those wanting notification only when there's a new GApps release, and the Q&A functioned as the main discussion thread where people can help each other. Much of the script is the same from PA GApps but TKruzze has added some impressive new features, made many fixes and revamped a large portion of the documentation. I also continued as an adviser and submitted script when needed.

Nexus Louder Audio Improvement Patch (GN, N4, N5, N7 '12, N7 '13) [with Misledz] - link

One of my earliest forays into EDIFY scripting, I wrote the flashable zip install/revert scheme for this great volume boost mod by Misledz. The scripts check to see if the mod is already installed and if so recommends you flash the version-specific revert that goes with it. More on that in the Intelligent EDIFY thread. During install the script also backs up the ROM files it replaces so that you don't need to reflash your whole ROM if something goes wrong, just use the revert to restore the backups. I eventually rewrote this completely in shell script with a Universal install/revert, that detects which files to backup and leaves a list for itself to revert. I also wrote automation batch scripts for Misledz as the "Louder Build Farm" to simplify his work for all the versions of the mod he maintains for various devices, linked in the knowledge base below. GN/Dev thread linked; Other links can be found there.

Payload-Dumper-Go for Android Magisk Module (many devices) [with ssssut] - link

payload-dumper-go arm/arm64 compile and wrapper for use extracting from payload.bin on-device.

Git for Android Magisk Module (many devices) [with Termux] - link

Hacked arm64 git commands for use on booted Android.

Google Experience XML Magisk Module (many devices) [with Google] - link

Hacked Google Nexus/Pixel/Android One sysconfig feature xml entries for use on non-Google devices.

Digital Wellbeing Add-on Magisk Module (many devices) [with Google & Open GApps] - link

Digital Wellbeing for Android 12L and 13 GApps that don't properly support it (like MindTheGapps).

Model Mod Magisk Module (many devices) - link

Experiment to append _SN to the existing device model to get CTS passing again after the September 2021 server-side SafetyNet changes, (superceded by kdrag0n's excellent Universal SafetyNet Fix module).

Xposed Framework Installer Zip (many devices) [with rovo89 & Tungstwenty] - link

When JB4.3 broke all previous root methods I made this simple frontend script to install rovo89's brilliant Xposed Framework for modding ROMs until they could release a new version themselves. Xposed Framework files and the install.sh used are the work of rovo89 and Tungstwenty; I have only created a recovery flashable zip and shell script to function as an alternative frontend for the framework installation process. Then updated to mimic the APK installation and allow devices with /system write protection like HTC's S-ON to install the framework. (Deprecated as of Xposed 2.5).

BBCode for my xda Signature (n/a) - link

Last and definitely least. A number of people have asked me about the formatting of my signature, so here are some simple BBCode tricks and workarounds I thought others might like too. Keep in mind that my signature can be significantly larger because of my RC status.

Enjoy!

Questions, comments and feedback welcome.

Credits & Thanks: All authors of any included binaries and libraries for their amazing work. Anyone who's helped me with these projects along the way.

Disclaimer: Naturally, you take all the responsibility for what happens to your device when you start messing around with things.