[Android Software/Hacking General [Developers Only]] BlassGO:
ADDONS/PLUGINS for Dynamic Installer

SUPPORT: TELEGRAM CHANNEL - TELEGRAM GROUP

ABOUT THIS:​

These are some addons that dont included by default in the Dynamic Installer cuz they arent necessary in generic installations / mods but they could be useful

ALL ADDONS:​

-----------------------------------

ImageMagick (Best Tool to manipulate images)​

View attachment 5341731

Unzip the downloaded Addon

Add magick and magick_ files in ur META-INF/addons of the Dynamic Installer

Then to import it add this in the first lines (Recommended) of your updater-script or customize.sh

#Look carefully, "a dot" "space" "File to import"
. "$addons/magick"

Enjoy ur new command "magick"

DOWNLOAD

-----------------------------------

ffmpeg (Best Tool to manipulate all multimedia content vídeos/audio/....)

Unzip the downloaded Addon

Add ffmpeg and ffmpeg_ files in ur META-INF/addons of the Dynamic Installer

Then to import it add this in the first lines (Recommended) of your updater-script or customize.sh

#Look carefully, "a dot" "space" "File to import"
. "$addons/ffmpeg"

Enjoy ur new command "ffmpeg"

DOWNLOAD

-----------------------------------

Omc Decoder ( JAR to decode Samsung .XMLs)

View attachment 5341741

For JARs that have been converted to .DEX there is a native run_jar action (It only works when the device is booted or in some devices from custom Recovery when the setdefault apex_mount is enabled in the updater-script).

Download omc-decoder.jar

Add omc-decoder.jar in ur META-INF/addons

Then to run it use this example line ur updater-script or customize.sh

run_jar "$addons/omc-decoder.jar" -d -i "cscfeature.xml" -o "decoded-cscfeature.xml"

#Btw you can use this format line too
run_jar_addon "omc-decoder.jar" -d -i "cscfeature.xml" -o "decoded-cscfeature.xml"

DOWNLOAD

-----------------------------------

DX (JAR to convert JAVA CODE / JARs into .DEX for Android)

For JARs that have been converted to .DEX there is a native run_jar action (It only works when the device is booted or in some devices from custom Recovery when the setdefault apex_mount is enabled in the updater-script).

Download dx.jar

Add dx.jar in ur META-INF/addons

Then to run it use this example line ur updater-script or customize.sh

run_jar "$addons/dx.jar" --dex --output=result.dex "UNDEXED JAR FILE"

#Btw you can use this format line too
run_jar_addon "dx.jar" --dex --output=result.dex "UNDEXED JAR FILE"

DOWNLOAD

-----------------------------------

boot_patch (Allows unpacking and packing the boot.img of most Android devices)

View attachment 5533123

Unzip the downloaded Addon

Add boot_patch.sh and boot_patch files in ur META-INF/addons of the Dynamic Installer

Then to import it add this in the first lines (Recommended) of your updater-script or customize.sh

#Look carefully, "a dot" "space" "File to import"
. "$addons/boot_patch.sh"

DOWNLOAD

USAGE:

GENERAL NOTE: All these functions support processing an additional compression in the kernel or ramdisk, for example, you can include a ramdisk that additionally compressed as .XZ and these functions will have no problem to decompressing/processing it (Supports: gzip zopfli xz lzma bzip2 lz4 lz4_legacy lz4_lg).

unpack_boot "IMG/Partition to extract" "Output folder" <1>

You can unpack an existing IMG or you can use directly the partition that containing it.

NOTE: The third argument is optional, if you add "1" it will not unpack the ramdisk (Useful if you are not going to edit any internal contents of the ramdisk)

#Unpack some existing IMG
unpack_boot "$TMP/boot.img" "$TMP/first_boot"

#Unpack from some Partition
unpack_boot $(find_block boot) "$TMP/second_boot"

#Unpack without unpacking the Ramdisk
unpack_boot $(find_block boot) "$TMP/second_boot" 1

repack_boot "Folder to build" "Output File/Partition" <recovery>

Rebuild the IMG unpacked by unpack_boot, the result can be saved in any path or you can send it to the partition directly (automatically repack_boot will evaluate what to do)

NOTE: The third argument is optional, if you add "recovery" it will use AVB1 signing (only if needed) for recovery images.

#Repack some unpacked IMG
repack_boot "$TMP/first_boot" "$TMP/result.img"

#Repack and send it to some Partition
repack_boot "$TMP/second_boot" $(find_block boot)

#Repack some unpacked Recovery image
repack_boot "$TMP/second_boot" $(find_block recovery) recovery

Additionally you can know if in the process the resulting IMG lost Magisk, if it is the case, the repack_boot will return the error code "2", so:

repack_boot "$TMP/first_boot" $(find_block boot)
result=$?

if [ $result == 0]; then
ui_print "No error and Magisk ensured"
elif [ $result == 1]; then
ui_print "Some fatal problem! and no changes were made"
elif [ $result == 2]; then
ui_print "No error but Magisk is not present"
fi

update_ramdisk "New ramdisk" "IMG/Partition to edit"

You can automatically update the ramdisk of an existing IMG or you can use directly the partition that containing it.

NOTE: The update_ramdisk will return the direct results of the repack_boot (You can save the error code to know if the IMG lost Magisk)

#Update the Ramdisk in some existing IMG
update_ramdisk "$TMP/new_ramdisk.cpio" "$TMP/boot.img"

#Update the Ramdisk in some Partition
update_ramdisk "$TMP/new_ramdisk.cpio" $(find_block boot)

update_kernel "New kernel" "IMG/Partition to edit"

You can automatically update the kernel of an existing IMG or you can use directly the partition that containing it.

NOTE: The update_kernel will return the direct results of the repack_boot (You can save the error code to know if the IMG lost Magisk)

#Update the Kernel in some existing IMG
update_kernel "$TMP/new_kernel" "$TMP/boot.img"

#Update the Ramdisk in some Partition
update_kernel "$TMP/new_kernel" $(find_block boot)

patch_cmdline "New prop" "New prop" "..."

You can patch multiple properties (props) of the cmdline of an IMG unpacked by unpack_boot, the only condition is to be in that path ( cd "path")

NOTE: The patch_cmdline automatically replaces or adds props (If you patch the same prop twice, it wont repeat)

cd "$TMP/first_boot"
patch_cmdline androidboot.selinux=permissive

remove_cmdline "prop to remove" "prop to remove" "..."

You can remove multiple properties (props) of the cmdline of an IMG unpacked by unpack_boot, the only condition is to be in that path ( cd "path")

cd "$TMP/first_boot"
remove_cmdline skip_override

flash_image "IMG to install" "Partition/Output file"

It is the default IMG installer of the boot_patch plugin utilities, it can automatically evaluate what to do in different cases

flash_image "$TMP/boot.img" $(find_block boot)

-----------------------------------

No More for the moment

CREDITS TO:​

Me @BlassGO (Developer of Dynamic Installer)

fei-ke (Developer of Omc Decoder)

ayaromenok (Developer of Static ImageMagick)

Khang-NT (Developer of Static ffmpeg)

@topjohnwu (For his amazing tools / methods for editing boot.img for Magisk)

@osm0sis (For giving more enhance the edition of boot.img with new methods in his AnyKernel project)