With this you can make Automatic Installers (.ZIP flash files) for All Android devices without limitations (Supports an installation from Recovery or can be used to create a Magisk module)
By default the installer mounts the partitions as RW (Read/Write) and creates its own environment (Busybox + Bash) to work even if your installation environment is not the most suitable
Although the name "Dynamic Installer" can be confusing, the installer is not exclusive for devices with Dynamic Partitions, it supports devices with old and new partitions.
Default Variables:
Updater-Script configs
Pre-introduction to Addons
Pre-introduction to Actions
Test MODE
Magisk SPACE
REPLACE NATIVE FUNCTIONS
TMP2
BUGS:
CREDITS TO:
By default the installer mounts the partitions as RW (Read/Write) and creates its own environment (Busybox + Bash) to work even if your installation environment is not the most suitable
Although the name "Dynamic Installer" can be confusing, the installer is not exclusive for devices with Dynamic Partitions, it supports devices with old and new partitions.
Compatibility:- ARM/ARM64
- Fully shell script based (Open source)
- It can mount main partitions as RW (/system_root, /system, /system_ext, /vendor, /product, /odm)
- Supports /apex mounting (dalvikvm support included)
- Supports old and new partitions
- Support for a Dual installation (Recovery or Magisk)
- It has many useful actions that make it easy to mount partitions, edit/patch files or install ROMs
- It has many other special features for patching smali JARs/APKs, XML editing, running JARs directly and more.
- It has 4 types of execution (ZIP for Recovery or Magisk, Just load from Recovery Terminal or Termux)
- It runs with BASH instead of ASH, DASH
- Support for addons and more
Default Variables:
Bash:
$TMP: The value of this variable contains the temp directory (A directory that only exists during execution, you can use it to store temporary contents)
$BOOTMODE: This value will be "true" only if the device is already booted (or "false")
$chipname: The value of this variable can be "snapdragon/exynos/mediatek/kirin/unisoc" depending on the chipset of the device
$installzip: The value of this variable contains the path of your ZIP (that the user is installing)
$is64bit: The value of this variable will be "true" only if the device is 64-bit (or "false")
$API: The value of this variable contains the API number (of the Android version) of the device
$slot: Contains the Active Slot (_a or _b) if the device has A/B partitions (It can be refreshed with "getarch" )
$dynamic_partitions: The value of this variable will be "true" if the device has a Dynamic Partitions (or "false")
$virtual_partitions: The value of this variable will be "true" if the device has a Virtual Dynamic Partitions (or "false")
${n}: Allows creating new lines within a string ( Example: paragraph=" First line ${n} Second line ${n} Third line " )
$encrypted: It will be "true" only if the device has encrypted Internal Memory (or "false")
$di_version: The complete current version of Dynamic Installer
$main_version: The main version of the Dynamic Installer (Only include whole numbers or decimals, without the -b -b2 -b3 ... variant extensions)
Updater-Script configs
PATH: META-INF/com/google/android/updater-script
Here you will find some lines that start with "setdefault" (These conditions affect even if you make a Magisk module)
NOTE: The import will respect an alphabetical (a.sh, b.sh, c.sh, ...) or numerical (1.sh, 2.sh, 3.sh, ...) order
NOTE: When magisk_support is set to "off", it is understood that any references to magisk modules, such as $MODPATH, will not be available even if the ZIP is installed from the Magisk App.
Format = User ID : Group ID : Folder permissions : File permissions
Here you will find some lines that start with "setdefault" (These conditions affect even if you make a Magisk module)
- setdefault devices (code name/Model of supported devices or off)
Bash:
#By default
setdefault devices off
#For example to only supports Galaxy A51
#Check using one code name
setdefault devices "a51"
#Check using two code names
setdefault devices "a51:a51nsxx"
#Check Galaxy A51 but with Models
setdefault devices "SM-A515F:SM-A515FN"
#For example to only supports Pixel 4 XL and Pixel 2
setdefault devices "Pixel 2:Pixel 4 XL"
#Or a Mix
#For example to only supports Pixel 4 XL/Pixel 2 and Galaxy A51
setdefault devices "a51:a51nsxx:Pixel 2:Pixel 4 XL"
- setdefault apex_mount ( on or off)
Bash:
#By default
setdefault apex_mount off
#To allow /apex mount using /system/apex and /system_ext/apex
setdefault apex_mount on
- setdefault import_addons (on or off)
NOTE: The import will respect an alphabetical (a.sh, b.sh, c.sh, ...) or numerical (1.sh, 2.sh, 3.sh, ...) order
Bash:
#By default
setdefault import_addons off
#To import all META-INF/addons/*.sh
setdefault import_addons on
- setdefault magisk_support ( on / off / force)
- on = Automatically switch between updater-script (Device not booted) or customize.sh (Device already booted). Dual installation, two possible execution scripts.
- off = Never use the Magisk space, so the updater-script will always be used in any case of installation (Device already booted or not booted)
- force = Always use the Magisk space, so the customize.sh will always be used for any installation case (Device already booted or not booted)
NOTE: When magisk_support is set to "off", it is understood that any references to magisk modules, such as $MODPATH, will not be available even if the ZIP is installed from the Magisk App.
Bash:
#By default
setdefault magisk_support on
#To use updater-script instead of customize.sh
#(Device already Booted)
setdefault magisk_support off
#To use customize.sh instead of updater-script
#(Device NOT Booted - Recovery)
setdefault magisk_support force
- setdefault extraction_speed (default or custom value)
Bash:
#By default
setdefault extraction_speed default
#To use 5MB / s in the supported actions
#Use "M" for Megabytes
setdefault extraction_speed 5M
- setdefault ensure_root (on or off)
Bash:
#By default
setdefault ensure_root on
#To allow RO systems
setdefault ensure_root off
- setdefault permissions (0:0:0755:0644 or custom value)
Format = User ID : Group ID : Folder permissions : File permissions
Bash:
#By default
setdefault permissions "0:0:0755:0644"
#To use 0755 in Folders and 0777 in Files
setdefault permissions "0 : 0 : 0755 : 0777"
Pre-introduction to Addons
The contents inside META-INF/addons are extracted automatically in the installation, to refer to the path use $addons variable
Plugins here
Plugins here
Bash:
::If you have META-INF/addons/myfile.txt
#To print this file
#You don't need to extract it
fprint "$addons/myfile.txt"
Pre-introduction to Actions
Some of these actions support specific extensions as follows:
- _addon: If you add "_addon" to the end of each supported action it will take the files directly from "META-INF/addons" folder inside the zip
Bash:
#META-INF/addons/Example.txt
update_file_addon "Example.txt" /system/build.prop
- _zip: If you add "_zip" at the end of each supported action it will take the files directly from the ZIP, you can include paths with folders
Bash:
#To use "folder/Example.txt" file inside the ZIP
update_file_zip "folder/Example.txt" /system/build.prop
- If this extension isnt included in the action, it will work as an external command to the zip
Bash:
update_file "/sdcard/Example.txt" /system/build.prop
How does it work?- update-binary It is the script that creates the proper environment and executes the entire ZIP
- zbin contains all the necessary plugins
- updater-script It is the script that is executed only if the ZIP is installed from Recovery (or when the device is not booted in general)
- customize.sh It is the script that is executed only if the ZIP is installed from the Magisk App (or when the device is already booted in general)
Test MODE
The "Test Mode" allows you to test most actions of the Dynamic Installer using the Termux App for Android or some Custom Recovery Terminal (with this you can practice)
To use it, extract this folder:
Execution in Termux (ROOT):
Execution in Custom Recovery Terminal:
Now you can test some actions:
To use it, extract this folder:
- META-INF/zbin
- META-INF/addons/extra.zip
Execution in Termux (ROOT):
Bash:
#First method
su
cd /sdcard/zbin
. ./setup
#Second method
su
. /sdcard/zbin/setup /sdcard/zbin
Execution in Custom Recovery Terminal:
Bash:
#First method
cd /sdcard/zbin
. ./setup
#Second method
. /sdcard/zbin/setup /sdcard/zbin
Now you can test some actions:
Bash:
update_file_string "ro.product.system.model= TEST" /sdcard/build.prop
apktool --help
Magisk SPACE
NOTE: You can use all the additional functions of the Dynamic Installer during the installation by Magisk
SPACE: META-INF/com/google/android/magisk
In this space you can configure the script and the information of your Magisk module, but the format of the script is totally free, do not rely too much on the existing formats for magisk modules
The magisk modules use a "$MODPATH" variable which is where you must direct all the files to be applied
For example to just extract contents of your ZIP in "$MODPATH/system" (This will apply the changes to /system after reboot)
SPACE: META-INF/com/google/android/magisk
In this space you can configure the script and the information of your Magisk module, but the format of the script is totally free, do not rely too much on the existing formats for magisk modules
The magisk modules use a "$MODPATH" variable which is where you must direct all the files to be applied
For example to just extract contents of your ZIP in "$MODPATH/system" (This will apply the changes to /system after reboot)
Bash:
package_extract_dir "FolderInsideZIP" "$MODPATH/system"
REPLACE NATIVE FUNCTIONS
By default all the Native functions of the Dynamic Installer and some Native Variables are in Read/Only to prevent them from being altered by imported shell scripts, however there is a way to allow their substitution from your script: off_readonly
NOTE: off_readonly is interpreted during the installation of the ZIP, so it doesn't work from Test Mode
NOTE: off_readonly is interpreted during the installation of the ZIP, so it doesn't work from Test Mode
Bash:
#off_readonly "function name" "function name" "..."
off_readonly ui_print update_file
#Now you can use your custom functions
ui_print() {
echo My custom ui_print function
}
update_file() {
echo My custom update_file function
}
#For some Native Variables like $TMP
off_readonly TMP TMPDIR
#New values
TMP="My custom value"
TMPDIR="My custom value"
TMP2
This variable ($TMP2) is generated by using start_tmp function and ends with end_tmp, the value contains a new temporary path that disappears after installation
Multiple spaces can be generated and finished the same number of times in different periods
Multiple spaces can be generated and finished the same number of times in different periods
Bash:
start_tmp
Space1="$TMP2"
start_tmp
Space2="$TMP2"
start_tmp
Space3="$TMP2"
#U need to finish ALL dynamic spaces
#end_tmp will be remove the created temp directory based on the order of creation
end_tmp
end_tmp
end_tmp
BUGS:
- The functions to decompile/compile APKs use an experimental apktool build that CANNOT process images, so dont try to process a full complex APKs! Only smali editions
CREDITS TO:
- Me @BlassGO ( Creator of Dynamic Installer)
- @osm0sis ( Traditional installer functionalities in shell code)
- @topjohnwu ( Some very cool functions in shell code)
- @munjeni for superrepack and superunpack (Best tools to manipulate SUPER images)
- @lebigmac cuz I used his project systemrw as a base to made my super_rw function for Dynamic Installer
MORE EXPLANATIONS
AND DOWNLOADS
IN THE NEXT POSTS
AND DOWNLOADS
IN THE NEXT POSTS
Last edited: