├── .gitattributes ├── .gitignore ├── META-INF └── com │ └── google │ └── android │ ├── update-binary │ └── updater-script ├── README.md ├── common ├── aml-patches-remove.sh ├── aml-patches-wipe.sh ├── aml-patches.sh ├── post-fs-data.sh ├── service.sh ├── system.prop ├── unity-audmodlib │ ├── audmodlib-post-fs-data.sh │ ├── audmodlibmodule.prop │ └── modid.sh ├── unity-customrules1.sh ├── unity-files-wipe.sh └── unity-uservariables.sh ├── config.sh ├── custom └── placeholder ├── data └── placeholder ├── module.prop └── system ├── addon.d ├── audmodlib.sh └── modid.sh └── app └── AppName └── AppName.apk /.gitattributes: -------------------------------------------------------------------------------- 1 | # Declare files that will always have LF line endings on checkout. 2 | *.sh text eol=lf 3 | *.prop text eol=lf 4 | *.md text eol=lf 5 | META-INF/** text eol=lf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear in the root of a volume 35 | .DocumentRevisions-V100 36 | .fseventsd 37 | .Spotlight-V100 38 | .TemporaryItems 39 | .Trashes 40 | .VolumeIcon.icns 41 | 42 | # Directories potentially created on remote AFP share 43 | .AppleDB 44 | .AppleDesktop 45 | Network Trash Folder 46 | Temporary Items 47 | .apdisk 48 | -------------------------------------------------------------------------------- /META-INF/com/google/android/update-binary: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | ########################################################################################## 3 | # 4 | # Unity Installer 5 | # by ahrion & zackptg5 6 | # 7 | ########################################################################################## 8 | 9 | ########################################################################################## 10 | # PREP WORK 11 | ########################################################################################## 12 | 13 | # DETECT WHETHER IN BOOT MODE 14 | ps | grep zygote | grep -v grep >/dev/null && BOOTMODE=true || BOOTMODE=false 15 | $BOOTMODE || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true 16 | 17 | # TEMP INSTALLER PATH 18 | TMPDIR=/dev/tmp 19 | INSTALLER=$TMPDIR/install 20 | 21 | # DEFAULT PERMISSIONS 22 | umask 022 23 | 24 | # INITIAL CLEANUP 25 | rm -rf $TMPDIR 2>/dev/null 26 | mkdir -p $INSTALLER 27 | 28 | ZIP=$3 29 | # GET INSTALL/UNINSTALL ACTION FROM ZIP NAME 30 | case $(basename $ZIP) in 31 | *uninstall*|*Uninstall*|*UNINSTALL*) INSTALL=false;; 32 | *) INSTALL=true;; 33 | esac 34 | 35 | # GET OUTFD 36 | OUTFD=$2 37 | readlink /proc/$$/fd/$OUTFD 2>/dev/null | grep /tmp >/dev/null 38 | if [ "$?" -eq "0" ]; then 39 | OUTFD=0 40 | for FD in `ls /proc/$$/fd`; do 41 | readlink /proc/$$/fd/$FD 2>/dev/null | grep pipe >/dev/null 42 | if [ "$?" -eq "0" ]; then 43 | ps | grep " 3 $FD " | grep -v grep >/dev/null 44 | if [ "$?" -eq "0" ]; then 45 | OUTFD=$FD 46 | break 47 | fi 48 | fi 49 | done 50 | fi 51 | 52 | ########################################################################################## 53 | # FUNCTIONS 54 | ########################################################################################## 55 | 56 | ui_print() { 57 | $BOOTMODE && echo "$1" || echo -e "ui_print $1\nui_print" >> /proc/self/fd/$OUTFD 58 | } 59 | 60 | resolve_link() { 61 | RESOLVED="$1" 62 | while RESOLVE=`readlink $RESOLVED`; do 63 | RESOLVED=$RESOLVE 64 | done 65 | echo $RESOLVED 66 | } 67 | 68 | is_mounted() { 69 | TARGET="`resolve_link $1`" 70 | cat /proc/mounts | grep " $TARGET " >/dev/null 71 | return $? 72 | } 73 | 74 | find_boot_image() { 75 | BOOTIMAGE= 76 | if [ ! -z $SLOT ]; then 77 | BOOTIMAGE=`find /dev/block -iname boot$SLOT | head -n 1` 2>/dev/null 78 | fi 79 | if [ -z "$BOOTIMAGE" ]; then 80 | # The slot info is incorrect... 81 | SLOT= 82 | for BLOCK in boot_a kern-a android_boot kernel boot lnx bootimg; do 83 | BOOTIMAGE=`find /dev/block -iname $BLOCK | head -n 1` 2>/dev/null 84 | [ ! -z $BOOTIMAGE ] && break 85 | done 86 | fi 87 | # Recovery fallback 88 | if [ -z "$BOOTIMAGE" ]; then 89 | for FSTAB in /etc/*fstab*; do 90 | BOOTIMAGE=`grep -v '#' $FSTAB | grep -E '/boot[^a-zA-Z]' | grep -oE '/dev/[a-zA-Z0-9_./-]*'` 91 | [ ! -z $BOOTIMAGE ] && break 92 | done 93 | fi 94 | [ ! -z "$BOOTIMAGE" ] && BOOTIMAGE=`resolve_link $BOOTIMAGE` 95 | } 96 | 97 | 98 | find_dtbo_image() { 99 | DTBOIMAGE=`find /dev/block -iname dtbo$SLOT | head -n 1` 2>/dev/null 100 | [ ! -z $DTBOIMAGE ] && DTBOIMAGE=`resolve_link $DTBOIMAGE` 101 | } 102 | 103 | mount_partitions_system() { 104 | # Check A/B slot 105 | SLOT=`getprop ro.boot.slot_suffix` 106 | if [ -z $SLOT ]; then 107 | SLOT=_`getprop ro.boot.slot` 108 | [ $SLOT = "_" ] && SLOT= 109 | fi 110 | # Check the boot image to make sure the slot actually make sense 111 | find_boot_image 112 | find_dtbo_image 113 | [ -z $SLOT ] || ui_print "- A/B partition detected, current slot: $SLOT" 114 | ui_print "- Mounting /system, /vendor" 115 | REALSYS=/system 116 | is_mounted /system || [ -f /system/build.prop ] || mount -o rw /system 2>/dev/null 117 | if ! is_mounted /system && ! [ -f /system/build.prop ]; then 118 | SYSTEMBLOCK=`find /dev/block -iname system$SLOT | head -n 1` 119 | mount -t ext4 -o rw $SYSTEMBLOCK /system 120 | REALSYS=$SYSTEMBLOCK 121 | fi 122 | is_mounted /system || [ -f /system/build.prop ] || abort "! Cannot mount /system" 123 | cat /proc/mounts | grep -E '/dev/root|/system_root' >/dev/null && SKIP_INITRAMFS=true || SKIP_INITRAMFS=false 124 | if [ -f /system/init.rc ]; then 125 | SKIP_INITRAMFS=true 126 | mkdir /system_root 2>/dev/null 127 | mount --move /system /system_root 128 | mount -o bind /system_root/system /system 129 | ROOT=/system_root 130 | REALSYS=/system_root/system 131 | fi 132 | $SKIP_INITRAMFS && ui_print "- Device skip_initramfs detected" 133 | if [ -L /system/vendor ]; then 134 | # Seperate /vendor partition 135 | VEN=/vendor 136 | is_mounted /vendor || mount -o rw /vendor 2>/dev/null 137 | if ! is_mounted /vendor; then 138 | VENDORBLOCK=`find /dev/block -iname vendor$SLOT | head -n 1` 139 | mount -t ext4 -o rw $VENDORBLOCK /vendor 140 | fi 141 | is_mounted /vendor || abort "! Cannot mount /vendor" 142 | else 143 | VEN=/system/vendor 144 | fi 145 | } 146 | 147 | grep_prop() { 148 | REGEX="s/^$1=//p" 149 | shift 150 | FILES=$@ 151 | [ -z "$FILES" ] && FILES='/system/build.prop' 152 | sed -n "$REGEX" $FILES 2>/dev/null | head -n 1 153 | } 154 | 155 | api_level_arch_detect_mod() { 156 | API=`grep_prop ro.build.version.sdk` 157 | ABI=`grep_prop ro.product.cpu.abi | cut -c-3` 158 | ABI2=`grep_prop ro.product.cpu.abi2 | cut -c-3` 159 | ABILONG=`grep_prop ro.product.cpu.abi` 160 | MIUIVER=`grep_prop ro.miui.ui.version.name` 161 | ARCH=arm 162 | DRVARCH=NEON 163 | IS64BIT=false 164 | if [ "$ABI" = "x86" ]; then ARCH=x86; DRVARCH=X86; fi; 165 | if [ "$ABI2" = "x86" ]; then ARCH=x86; DRVARCH=X86; fi; 166 | if [ "$ABILONG" = "arm64-v8a" ]; then ARCH=arm64; IS64BIT=true; fi; 167 | if [ "$ABILONG" = "x86_64" ]; then ARCH=x64; IS64BIT=true; DRVARCH=X86; fi; 168 | } 169 | 170 | set_perm() { 171 | chown $2:$3 $1 || exit 1 172 | chmod $4 $1 || exit 1 173 | [ -z $5 ] && chcon 'u:object_r:system_file:s0' $1 || chcon $5 $1 174 | } 175 | 176 | set_perm_recursive() { 177 | find $1 -type d 2>/dev/null | while read dir; do 178 | set_perm $dir $2 $3 $4 $6 179 | done 180 | find $1 -type f -o -type l 2>/dev/null | while read file; do 181 | set_perm $file $2 $3 $5 $6 182 | done 183 | } 184 | 185 | mktouch() { 186 | mkdir -p ${1%/*} 2>/dev/null 187 | [ -z $2 ] && touch $1 || echo $2 > $1 188 | chmod 644 $1 189 | } 190 | 191 | unmount_partitions() { 192 | test "$supersuimg" -o -d /su && umount /su 193 | umount -l /system_root 2>/dev/null 194 | umount -l /system 2>/dev/null 195 | umount -l /vendor 2>/dev/null 196 | } 197 | 198 | abort() { 199 | ui_print "$1" 200 | unmount_partitions 201 | exit 1 202 | } 203 | 204 | supersuimg_mount() { 205 | supersuimg=$(ls /cache/su.img /data/su.img 2>/dev/null) 206 | if [ "$supersuimg" ]; then 207 | if ! is_mounted /su; then 208 | ui_print " Mounting /su..." 209 | test ! -e /su && mkdir /su 210 | mount -t ext4 -o rw,noatime $supersuimg /su 2>/dev/null 211 | for i in 0 1 2 3 4 5 6 7; do 212 | is_mounted /su && break 213 | loop=/dev/block/loop$i 214 | mknod $loop b 7 $i 215 | losetup $loop $supersuimg 216 | mount -t ext4 -o loop $loop /su 2>/dev/null 217 | done 218 | fi 219 | fi 220 | } 221 | 222 | require_new_magisk() { 223 | ui_print "*******************************" 224 | ui_print " Please install Magisk v15.0+! " 225 | ui_print "*******************************" 226 | exit 1 227 | } 228 | 229 | require_new_api() { 230 | ui_print "***********************************" 231 | ui_print "! Your system API of $API isn't" 232 | if [ "$1" == "minimum" ]; then 233 | ui_print "! higher than the $1 API of $MINAPI" 234 | ui_print "! Please upgrade to a newer version" 235 | ui_print "! of android with at least API $MINAPI" 236 | else 237 | ui_print "! lower than the $1 API of $MAXAPI" 238 | ui_print "! Please downgrade to an older version" 239 | ui_print "! of android with at most API $MAXAPI" 240 | fi 241 | ui_print "***********************************" 242 | exit 1 243 | } 244 | 245 | action_complete() { 246 | if ! $MAGISK; then 247 | ui_print " Unmounting partitions..." 248 | unmount_partitions 249 | fi 250 | ui_print " " 251 | if $INSTALL; then ui_print " --------- INSTALLATION SUCCESSFUL ---------"; else ui_print " --------- RESTORATION SUCCESSFUL ---------"; fi 252 | ui_print " " 253 | if $AUDMODLIB; then TMP="AML/Unity"; else TMP="Unity"; fi 254 | if $INSTALL; then ui_print " $TMP Installer by ahrion & zackptg5 @ XDA"; else ui_print " $TMP Uninstaller by ahrion & zackptg5 @ XDA"; fi 255 | } 256 | 257 | device_check() { 258 | if [ "$(grep_prop ro.product.device)" == "$1" ] || [ "$(grep_prop ro.build.product)" == "$1" ]; then 259 | return 0 260 | else 261 | return 1 262 | fi 263 | } 264 | 265 | sys_wipe_ch() { 266 | TPARTMOD=false 267 | cat $INFO | { 268 | while read LINE; do 269 | test "$1" == "$(eval echo $LINE)" && { TPARTMOD=true; sed -i "/$1/d" $INFO; } 270 | done 271 | if ! $TPARTMOD && [ -f "$1" ] && [ ! -f "$1.bak" ]; then 272 | mv -f "$1" "$1.bak" 273 | echo "$1.bak" >> $INFO 274 | else 275 | rm -f "$1" 276 | fi 277 | } 278 | } 279 | 280 | sys_wipefol_ch() { 281 | if [ -d "$1" ] && [ ! -f "$1.tar" ]; then 282 | tar -cf "$1.tar" "$1" 283 | if [ ! -f $INFO ]; then echo "$1.tar" >> $INFO; else test ! "$(grep "$1.tar" $INFO)" && echo "$1.tar" >> $INFO; fi 284 | else 285 | rm -rf "$1" 286 | fi 287 | } 288 | 289 | wipe_ch() { 290 | case $1 in 291 | FOL*) if [ "$(echo "$1" | cut -c 4-9)" == "/data/" ]; then TYPE="foldata"; else TYPE="fol"; fi; FILE=$(echo "$1" | cut -c4-);; 292 | /data/*) TYPE="data"; FILE=$1;; 293 | APP*) TYPE="app"; FILE=$(echo "$1" | cut -c4-);; 294 | *) TYPE="file"; FILE=$1;; 295 | esac 296 | case $TYPE in 297 | "foldata") sys_wipefol_ch $FILE;; 298 | "fol") $MAGISK && mktouch $FILE/.replace || sys_wipefol_ch $FILE;; 299 | "data") sys_wipe_ch $FILE;; 300 | "app") if $OLDAPP; then 301 | if [ -f "/system/app/$FILE.apk" ]; then $WPAPP_PRFX $UNITY/system/app/$FILE.apk; else test -f "/system/app/$FILE/$FILE.apk" && $WPAPP_PRFX $UNITY/system/app/$FILE/$FILE.apk; fi 302 | else 303 | test -f "/system/priv-app/$FILE/$FILE.apk" && $WPAPP_PRFX $UNITY/system/priv-app/$FILE/$FILE.apk 304 | fi 305 | $OREONEW && { test -f $UNITY$VEN/app/$FILE/$FILE.apk && $WPAPP_PRFX $UNITY$VEN/app/$FILE/$FILE.apk; };; 306 | "file") $MAGISK && mktouch $FILE || sys_wipe_ch $FILE;; 307 | esac 308 | } 309 | 310 | cp_ch() { 311 | case $2 in 312 | $MOUNTPATH/audmodlib*) CP=$2;; 313 | */system/*|*/vendor/*) CP=$UNITY$2;; 314 | *) CP=$2;; 315 | esac 316 | mkdir -p "${CP%/*}" 317 | chmod 0755 "${CP%/*}" 318 | cp -af "$1" "$CP" 319 | if [ -z $3 ]; then chmod 0644 "$CP"; else chmod "$3" "$CP"; fi 320 | } 321 | 322 | cp_ch_bak() { 323 | if ! $MAGISK; then 324 | if [ -f "$2" ] && [ ! -f "$2.bak" ]; then 325 | cp -f "$2" "$2.bak" 326 | echo "$2.bak" >> $INFO 327 | fi 328 | test ! "$(grep "$2" $INFO)" && echo "$2" >> $INFO 329 | fi 330 | cp_ch $1 $2 $3 331 | } 332 | 333 | sys_rm_ch() { 334 | if [ -f "$1.bak" ]; then 335 | mv -f "$1.bak" "$1" 336 | elif [ -f "$1.tar" ]; then 337 | tar -xf "$1.tar" -C "${1%/*}" 338 | else 339 | rm -f "$1" 340 | fi 341 | if [ ! "$(ls -A "${1%/*}")" ]; then 342 | rm -rf ${1%/*} 343 | fi 344 | } 345 | 346 | patch_script() { 347 | sed -i "s||$MAGISK|" $1 348 | sed -i "s||$VEN|" $1 349 | sed -i "s||$LIBDIR|" $1 350 | sed -i "s||$(echo $CFGS)|" $1 351 | sed -i "s||$(echo $CFGSXML)|" $1 352 | sed -i "s||$(echo $POLS)|" $1 353 | sed -i "s||$(echo $POLSXML)|" $1 354 | sed -i "s||$(echo $MIXS)|" $1 355 | if $OLDAPP; then sed -i "s||system_app|" $1; else sed -i "s||priv_app|" $1; fi 356 | if $MAGISK; then 357 | sed -i "//d" $1 358 | sed -i "s||/system|" $1 359 | sed -i "s||#!/system/bin/sh|" $1 360 | sed -i "s||magiskpolicy|" $1 361 | if $AUDMODLIB; then sed -i "s||$AMLPATH|" $1; else sed -i "//d" $1; fi 362 | sed -i "s|$MOUNTPATH|/sbin/.core/img|g" $1 363 | else 364 | if [ ! -z $ROOT ]; then sed -i "s||$ROOT|" $1; else sed -i "//d" $1; fi 365 | sed -i "s||$REALSYS|" $1 366 | sed -i "s||$SHEBANG|" $1 367 | sed -i "s||$SEINJECT|" $1 368 | sed -i "//d" $1 369 | sed -i "s|$MOUNTPATH||g" $1 370 | fi 371 | } 372 | 373 | add_to_info() { 374 | test ! "$(grep "$1" $2)" && echo "$1" >> $2 375 | } 376 | 377 | custom_app_install() { 378 | if $OREONEW; then 379 | $CP_PRFX $INSTALLER/custom/$1/$1.apk $VEN/app/$1/$1.apk 380 | else 381 | if $OLDAPP; then $CP_PRFX $INSTALLER/custom/$1/$1.apk /system/app/$1.apk; else $CP_PRFX $INSTALLER/custom/$1/$1.apk /system/priv-app/$1/$1.apk; fi 382 | fi 383 | } 384 | 385 | info_uninstall() { 386 | if [ -f $1 ]; then 387 | test "$1" != "$AMLINFO" && ui_print " Removing/restoring files..." 388 | cat $1 | while read LINE; do 389 | sys_rm_ch $LINE 390 | done 391 | rm -f $1 392 | else 393 | if $MAGISK; then ui_print " Removing/restoring files..."; else test "$1" != "$AMLINFO" && abort " ! Mod not detected !"; fi 394 | fi 395 | } 396 | 397 | remove_aml() { 398 | ui_print " " 399 | ui_print " ! No more audmodlib modules detected !" 400 | ui_print " ! Removing Audio Modification Library !" 401 | if $MAGISK; then rm -rf $AMLPATH; rm -rf /sbin/.core/img/audmodlib; else rm -f /system/addon.d/audmodlib.sh; info_uninstall $AMLINFO; fi 402 | } 403 | 404 | ########################################################################################## 405 | # SETUP (UN)/INSTALL 406 | ########################################################################################## 407 | 408 | # UNZIP FILES 409 | ui_print " " 410 | ui_print "Unzipping files..." 411 | unzip -o "$ZIP" -d $INSTALLER 2>/dev/null 412 | 413 | [ ! -f $INSTALLER/config.sh ] && { ui_print "! Unable to extract zip file !"; exit 1; } 414 | 415 | test "$(grep_prop id $INSTALLER/module.prop)" == "AMLTemplate" && { ui_print "! AML Template is not a separate module !"; ui_print "! AML is already included in all modules that use it !"; ui_print "! This template is for devs only !"; exit 1; } 416 | 417 | # INSERT MODULE INFO INTO CONFIG.SH 418 | for TMP in version name author; do 419 | NEW=$(grep_prop $TMP $INSTALLER/module.prop) 420 | test "$TMP" == "author" && NEW="by ${NEW}" 421 | CHARS=$((${#NEW}-$(echo "$NEW" | tr -cd "©®™" | wc -m))) 422 | SPACES="" 423 | if [ $CHARS -le 41 ]; then 424 | for i in $(seq $(((41-$CHARS) / 2))); do 425 | SPACES="${SPACES} " 426 | done 427 | fi 428 | if [ $(((41-$CHARS) % 2)) == 1 ]; then sed -i "s/<$TMP>/$SPACES$NEW${SPACES} /" $INSTALLER/config.sh; else sed -i "s/<$TMP>/$SPACES$NEW$SPACES/" $INSTALLER/config.sh; fi 429 | done 430 | 431 | . $INSTALLER/config.sh 432 | 433 | # PRINT MOD NAME 434 | print_modname 435 | 436 | # MOUNT DATA AND CACHE 437 | ui_print "- Mounting /data, /cache" 438 | is_mounted /data || mount /data || is_mounted /cache || mount /cache || { ui_print "! Unable to mount partitions"; exit 1; } 439 | 440 | pre_install() { 441 | # USE VENDOR IF OREO OR NEWER 442 | if [ $API -ge 26 ]; then LIBPATCH="\\\/vendor"; LIBDIR=$VEN ;OREONEW=true; else LIBPATCH="\\\/system"; LIBDIR=/system; OREONEW=false; fi 443 | 444 | # REMOVE COMMENTS FROM USER INPUT FILES AND ADD PROPER VARIABLES 445 | for TMP in $INSTALLER/common/unity-files-wipe.sh $INSTALLER/common/aml-patches.sh $INSTALLER/common/aml-patches-remove.sh $INSTALLER/common/aml-patches-wipe.sh $INSTALLER/common/unity-uservariables.sh $INSTALLER/common/unity-customrules $INSTALLER/common/post-fs-data.sh $INSTALLER/common/service.sh $INSTALLER/common/*.prop; do 446 | if [ "$TMP" == "$INSTALLER/common/unity-customrules" ]; then 447 | NUM=1; while true; do 448 | if [ -f $TMP$NUM.sh ]; then 449 | sed -i "s|\$LIBPATCH|$LIBPATCH|g" $TMP$NUM.sh 450 | NUM=$((NUM+1)) 451 | else 452 | NUMOFCUSTRULES=$(($NUM-1)); break; 453 | fi 454 | done 455 | else 456 | if [ -f $TMP ]; then 457 | sed -i "s|\$LIBPATCH|$LIBPATCH|g" $TMP 458 | else 459 | ui_print " !$TMP missing!"; ui_print " !Copy it back to above and try again!"; exit 1; 460 | fi 461 | fi 462 | done 463 | 464 | # UNIVERSAL VARIABLES 465 | CP_NBPRFX="cp_ch" 466 | CP_PRFX="cp_ch_bak" 467 | WP_PRFX="wipe_ch" 468 | SYS=/system 469 | 470 | # IMPORT USER VARIABLES 471 | source $INSTALLER/common/unity-uservariables.sh 472 | 473 | # SET MODID, MODPATH, AMLPATH, and AUDMODLIB variables 474 | test -z $MODID && MODID=`grep_prop id $INSTALLER/module.prop` 475 | MODPATH=$MOUNTPATH/$MODID 476 | AMLPATH=$MOUNTPATH/audmodlib 477 | if [ -z $AUDMODLIB ]; then AUDMODLIB=false; else AUDMODLIB=true; fi 478 | 479 | # MAKE MODID SERVICE AND POST-FS-DATA SCRIPTS 480 | cp -f $INSTALLER/common/unity-audmodlib/modid.sh $INSTALLER/common/unity-audmodlib/$MODID-post-fs-data.sh 481 | mv -f $INSTALLER/common/unity-audmodlib/modid.sh $INSTALLER/common/unity-audmodlib/$MODID-service.sh 482 | 483 | # INSERT MODID AND CUSTOM USER SCRIPT INTO MOD SCRIPT 484 | sed -i -e "s//$MODID/" -e "/# CUSTOM USER SCRIPT/ r $INSTALLER/common/post-fs-data.sh" -e '/# CUSTOM USER SCRIPT/d' $INSTALLER/common/unity-audmodlib/$MODID-post-fs-data.sh 485 | sed -i -e "s//$MODID/" -e "/# CUSTOM USER SCRIPT/ r $INSTALLER/common/service.sh" -e '/# CUSTOM USER SCRIPT/d' $INSTALLER/common/unity-audmodlib/$MODID-service.sh 486 | } 487 | 488 | common_install() { 489 | # FILE LOCATIONS 490 | CFGS="${CFGS} $(find -L /system -type f -name "*audio_effects*.conf")" 491 | CFGSXML="${CFGSXML} $(find -L /system -type f -name "*audio_effects*.xml")" 492 | POLS="${POLS} $(find -L /system -type f -name "*audio*policy*.conf")" 493 | POLSXML="${POLSXML} $(find -L /system -type f -name "*audio_policy*.xml")" 494 | MIXS="${MIXS} $(find -L /system -type f -name "*mixer_paths*.xml")" 495 | } 496 | 497 | magisk_install() { 498 | VEN=/system/vendor 499 | # PREP FILES & VARIABLES 500 | pre_install 501 | MAGISK=true 502 | UNITY="$MODPATH" 503 | WPAPP_PRFX="mktouch" 504 | AMLSCRIPT="$AMLPATH/post-fs-data.sh" 505 | if $BOOTMODE; then 506 | INFO="/sbin/.core/img/$MODID/$MODID-files" 507 | MOD_VER="/sbin/.core/img/$MODID/module.prop" 508 | AML_VER="/sbin/.core/img/audmodlib/module.prop" 509 | PROPFILE="/sbin/.core/img/$MODID/system.prop" 510 | CONFPROPS="/sbin/.core/img/$MODID/$MODID-conflictingprops.txt" 511 | else 512 | INFO="$MODPATH/$MODID-files" 513 | MOD_VER="$MODPATH/module.prop" 514 | AML_VER="$AMLPATH/module.prop" 515 | PROPFILE="$MODPATH/system.prop" 516 | CONFPROPS="$MODPATH/$MODID-conflictingprops.txt" 517 | fi 518 | common_install 519 | } 520 | 521 | system_install() { 522 | # MOUNT PARTITIONS 523 | mount_partitions_system 524 | ui_print "- System install detected" 525 | # DETECT VERSION AND ARCHITECTURE 526 | api_level_arch_detect_mod 527 | # PREP FILES & VARIABLES 528 | pre_install 529 | # DETERMINE SYSTEM BOOT SCRIPT TYPE 530 | supersuimg_mount 531 | SHEBANG="#!/system/bin/sh" 532 | SH=/system/etc/init.d 533 | SEINJECT=/sbin/sepolicy-inject 534 | ROOTTYPE="other root or rootless" 535 | if [ "$supersuimg" ] || [ -d /su ]; then 536 | SHEBANG="#!/su/bin/sush" 537 | SH=/su/su.d 538 | SEINJECT=/su/bin/supolicy 539 | ROOTTYPE="systemless SuperSU" 540 | elif [ -e "$(find /data /cache -name supersu_is_here | head -n1)" ]; then 541 | SHEBANG="#!/su/bin/sush" 542 | SH=$(dirname `find /data /cache -name supersu_is_here | head -n1`)/su.d 543 | SEINJECT=$(dirname `find /data /cache -name supersu_is_here | head -n1`)/bin/supolicy 544 | ROOTTYPE="bindsbin SuperSU" 545 | elif [ -d /system/su ] || [ -f /system/xbin/daemonsu ] || [ -f /system/xbin/sugote ]; then 546 | SH=/system/su.d 547 | SEINJECT=/system/xbin/supolicy 548 | ROOTTYPE="system SuperSU" 549 | elif [ -f /system/xbin/su ]; then 550 | if [ "$(grep "SuperSU" /system/xbin/su)" ]; then 551 | SH=/system/su.d 552 | SEINJECT=/system/xbin/supolicy 553 | ROOTTYPE="system SuperSU" 554 | else 555 | ROOTTYPE="LineageOS SU" 556 | fi 557 | fi 558 | # SYSTEM ONLY VARIABLES 559 | MAGISK=false 560 | UNITY="" 561 | WPAPP_PRFX="sys_wipe_ch" 562 | AMLPATH="" 563 | PROPFILE="$SH/$MODID-props" 564 | AMLSCRIPT="$SH/audmodlib-post-fs-data" 565 | MOD_VER="/system/etc/$MODID-module.prop" 566 | AML_VER="/system/etc/audmodlib-module.prop" 567 | if [ -d /system/addon.d ]; then 568 | INFO=/system/addon.d/$MODID-files 569 | AMLINFO=/system/addon.d/audmodlib-files 570 | else 571 | INFO=/system/etc/$MODID-files 572 | AMLINFO=/system/etc/audmodlib-files 573 | fi 574 | CONFPROPS="$(dirname `readlink -f $ZIP`)/$MODID-conflictingprops.txt" 575 | common_install 576 | } 577 | 578 | # UNITY PROP INSTALL 579 | unity_prop_copy() { 580 | sed -i "/#/d" $1 581 | if $MAGISK; then 582 | REGEX="s/(.*)=(.*)/\1/" 583 | sed -i -e "s/setprop //g" -e "s/ /=/g" $1 584 | if $BOOTMODE; then SH="/sbin/.core/img $MOUNTPATH"; else SH=$MOUNTPATH; fi 585 | FILE=system.prop 586 | else 587 | REGEX="s/setprop (.*) (.*)/\1/" 588 | FILE="*props" 589 | fi 590 | if [ "$(cat $1)" ]; then 591 | test ! -f $PROPFILE && if $MAGISK; then mktouch $PROPFILE; else mktouch $PROPFILE "$SHEBANG"; fi 592 | for TMP in $(find $SH -type f -name $FILE); do 593 | cat $1 | while read PROP; do 594 | TPROP=$(echo $PROP | sed -r "$REGEX") 595 | PRESENT=false 596 | cat $TMP | { 597 | while read OLDPROP; do 598 | TOLDPROP=$(echo $OLDPROP | sed -r "$REGEX") 599 | test "$TPROP" == "$TOLDPROP" && PRESENT=true 600 | done 601 | if ! $PRESENT; then 602 | test ! "$(grep "$PROP" $PROPFILE)" && echo "$PROP" >> $PROPFILE 603 | elif [ "$TMP" != "$PROPFILE" ]; then 604 | test "$(grep "^$PROP" $PROPFILE)" && sed -i "/$PROP/d" $PROPFILE 605 | test ! "$(grep "#$PROP" $PROPFILE)" && echo "#$PROP" >> $PROPFILE 606 | test ! -f $CONFPROPS && { mktouch $CONFPROPS; ui_print " "; ui_print " ! Conflicting props found !"; 607 | ui_print " ! Conflicting props will be commented out !"; ui_print " ! Check the conflicting props file at"; 608 | ui_print " ! $(echo $CONFPROPS | sed "s|$MODPATH|/sbin/.core/img/$MODID|") !"; ui_print " "; } 609 | echo "FOUND IN: $(echo $TMP | sed "s|$MOUNTPATH|/sbin/.core/img|")" >> $CONFPROPS 610 | echo "- PROP: $TPROP" >> $CONFPROPS 611 | fi 612 | } 613 | done 614 | done 615 | $MAGISK || chmod 0700 $PROPFILE 616 | fi 617 | } 618 | 619 | # AUDIO MODIFICATION LIBRARY 620 | aml_mod() { 621 | ### CREATE AUDIO MODIFICATION LIBRARY ### 622 | if $INSTALL; then ui_print " "; ui_print "- Installing Audio Modification Library -"; else ui_print " Removing $MODID from Audio Modification Library"; fi 623 | 624 | # CREATE FILE CONTAINING LIST OF ALL INSTALLED MOD FILES 625 | ! $MAGISK && [ ! -f $AMLINFO ] && mktouch $AMLINFO 626 | 627 | for FILE in ${CFGS} ${CFGSXML} ${POLS} ${POLSXML} ${MIXS}; do 628 | $MAGISK || { add_to_info $FILE $AMLINFO; add_to_info $FILE.bak $AMLINFO; } 629 | if [ ! -f $AMLPATH$FILE.bak ]; then 630 | if [ -f $FILE.bak ]; then $CP_NBPRFX $FILE.bak $AMLPATH$FILE.bak; else $CP_NBPRFX $FILE $AMLPATH$FILE.bak; fi 631 | fi 632 | test ! -f $AMLPATH$FILE && $CP_NBPRFX $FILE $AMLPATH$FILE 633 | done 634 | # Create vendor audio_effects.conf if missing 635 | if [ -f /system/etc/audio_effects.conf ] && [ ! -f $VEN/etc/audio_effects.conf ]; then 636 | $MAGISK || { add_to_info $VEN/etc/audio_effects.conf $AMLINFO; add_to_info $VEN/etc/audio_effects.conf.bak $AMLINFO; } 637 | if [ -f /system/etc/audio_effects.conf.bak ]; then $CP_NBPRFX /system/etc/audio_effects.conf.bak $AMLPATH$VEN/etc/audio_effects.conf.bak; else $CP_NBPRFX /system/etc/audio_effects.conf $AMLPATH$VEN/etc/audio_effects.conf.bak; fi 638 | $CP_NBPRFX /system/etc/audio_effects.conf $AMLPATH$VEN/etc/audio_effects.conf 639 | fi 640 | 641 | if $INSTALL && [ ! -f $AMLSCRIPT ]; then 642 | $CP_NBPRFX $INSTALLER/common/unity-audmodlib/audmodlib-post-fs-data.sh $AMLSCRIPT 0755 643 | patch_script $AMLSCRIPT 644 | fi 645 | if $MAGISK; then 646 | $BOOTMODE && [ -f /sbin/.core/img/audmodlib/post-fs-data.sh ] && $CP_NBPRFX /sbin/.core/img/audmodlib/post-fs-data.sh $AMLSCRIPT 0755 647 | $BOOTMODE && ! $INSTALL && { $CP_NBPRFX $INSTALLER/common/unity-audmodlib/audmodlibmodule.prop $AMLPATH/module.prop; mktouch /sbin/.core/img/audmodlib/update; mktouch $AMLPATH/auto_mount; } 648 | elif ! $MAGISK && $INSTALL; then 649 | add_to_info $AMLSCRIPT $AMLINFO 650 | fi 651 | 652 | if [ -f $AML_VER ]; then 653 | if $INSTALL && [ $(grep_prop versionCode $INSTALLER/common/unity-audmodlib/audmodlibmodule.prop) -gt $(grep_prop versionCode $AML_VER) ]; then 654 | ui_print " ! Old version of AML detected !" 655 | ui_print " Upgrading AML..." 656 | sed -i -e '/^# MOD PATCHES/,/^$/!d' -e '/^# MOD PATCHES/d' -e '/^$/d' $AMLSCRIPT 657 | sed -i "/^# MOD PATCHES/ r $AMLSCRIPT" $INSTALLER/common/unity-audmodlib/audmodlib-post-fs-data.sh 658 | patch_script $INSTALLER/common/unity-audmodlib/audmodlib-post-fs-data.sh 659 | $CP_NBPRFX $INSTALLER/common/unity-audmodlib/audmodlib-post-fs-data.sh $AMLSCRIPT 660 | fi 661 | fi 662 | ! $MAGISK && $INSTALL && { $CP_NBPRFX $INSTALLER/common/unity-audmodlib/audmodlibmodule.prop $AML_VER; add_to_info $AML_VER $AMLINFO; } 663 | 664 | $INSTALL && aml_mod_patch 665 | } 666 | 667 | # AML FILE PATCHER 668 | aml_mod_patch() { 669 | #### PATCHING FILES #### 670 | ui_print " " 671 | ui_print "- Patching necessary files -" 672 | 673 | # PATCH AUDMODLIB-SERVICES SCRIPT 674 | if $MAGISK; then 675 | sed -i "/^#$MODID/,/fi #$MODID/d" $AMLSCRIPT 676 | sed -i 's/^/ /' $INSTALLER/common/aml-patches-remove.sh 677 | sed -i -e "/^# MOD PATCHES/ a\ MODIDS=\"\${MODIDS} $MODID\"" -e "/^# MOD PATCHES/ r $INSTALLER/common/aml-patches-remove.sh" -e "/^# MOD PATCHES/ a\TEMP$MODID" $AMLSCRIPT 678 | sed -i -e "/TEMP$MODID/ a\fi #$MODID" -e "/TEMP$MODID/d" $AMLSCRIPT 679 | sed -i -e "/^# MOD PATCHES/ a\#$MODID" -e "/^# MOD PATCHES/ a\if [ ! -d \"/sbin/.core/img/$MODID\" ]; then" $AMLSCRIPT 680 | else 681 | sed -i "/^# MOD PATCHES/ a\#$MODID" $AMLSCRIPT 682 | fi 683 | 684 | # REMOVE LIBRARIES & EFFECTS 685 | ui_print " Removing library & effect lines..." 686 | source $INSTALLER/common/aml-patches-wipe.sh 687 | source $INSTALLER/common/aml-patches-remove.sh 688 | 689 | for FILE in /system/etc/audio_effects.conf $VEN/etc/audio_effects.conf; do 690 | if [ -f $FILE ] && [ ! "$(grep '^ *# *music_helper {' $AMLPATH$FILE)" ] && [ "$(grep '^ *music_helper {' $AMLPATH$FILE)" ]; then 691 | sed -i "/effects {/,/^}/ {/music_helper {/,/}/ s/^/#/g}" $AMLPATH$FILE 692 | fi 693 | done 694 | for FILE in /system/etc/audio_effects.xml $VEN/etc/audio_effects.xml; do 695 | if [ -f $FILE ] && [ ! "$(grep '^ *<\!--' $AMLPATH$FILE)" ] && [ "$(grep '^ *' $AMLPATH$FILE)" ]; then 696 | sed -i "/^ *$/,/<\/postprocess>/ {//,/<\/stream>/ s//<\!--/; s/<\/stream>/<\/stream>-->/}" $AMLPATH$FILE 697 | fi 698 | done 699 | 700 | source $INSTALLER/common/aml-patches.sh 701 | 702 | NUM=1; while [ $NUM -le $NUMOFCUSTRULES ]; do 703 | test "$(grep "TIMEOFEXEC=2" $INSTALLER/common/unity-customrules$NUM.sh)" && source $INSTALLER/common/unity-customrules$NUM.sh 704 | NUM=$((NUM+1)) 705 | done 706 | } 707 | 708 | # UNITY FILE/FOLDER COPY 709 | unity_mod_copy() { 710 | ui_print " " 711 | ui_print "- Copying files/folders -" 712 | 713 | # INSTALL SCRIPTS 714 | if $MAGISK; then 715 | ui_print " Installing scripts for MagiskSU..." 716 | # HANDLE REPLACE FOLDERS 717 | for TARGET in $REPLACE; do 718 | mktouch $MODPATH$TARGET/.replace 719 | $AUDMODLIB && mktouch $AMLPATH$TARGET/.replace 720 | done 721 | 722 | # AUTO MOUNT 723 | $AUTOMOUNT && mktouch $MODPATH/auto_mount 724 | $AUDMODLIB && mktouch $AMLPATH/auto_mount 725 | 726 | # REMOVE OLD AML FILES IF IN BOOTMODE 727 | $BOOTMODE && $AUDMODLIB && { rm -rf /sbin/.core/img/audmodlib; mkdir -p /sbin/.core/img/audmodlib; } 728 | 729 | # MODULE INFO 730 | $CP_NBPRFX $INSTALLER/module.prop $MODPATH/module.prop 731 | $AUDMODLIB && $CP_NBPRFX $INSTALLER/common/unity-audmodlib/audmodlibmodule.prop $AMLPATH/module.prop 732 | if $BOOTMODE; then 733 | # UPDATE INFO FOR MAGISK MANAGER 734 | mktouch /sbin/.core/img/$MODID/update 735 | $CP_NBPRFX $INSTALLER/module.prop /sbin/.core/img/$MODID/module.prop 736 | $AUDMODLIB && { mktouch /sbin/.core/img/audmodlib/update; $CP_NBPRFX $INSTALLER/common/unity-audmodlib/audmodlibmodule.prop /sbin/.core/img/audmodlib/module.prop; } 737 | fi 738 | 739 | #INSTALL POST-FS-DATA MODE SCRIPTS 740 | $POSTFSDATA && { $CP_NBPRFX $INSTALLER/common/unity-audmodlib/$MODID-post-fs-data.sh $MODPATH/post-fs-data.sh; patch_script $MODPATH/post-fs-data.sh; } 741 | 742 | # SERVICE MODE SCRIPTS 743 | $LATESTARTSERVICE && { $CP_NBPRFX $INSTALLER/common/unity-audmodlib/$MODID-service.sh $MODPATH/service.sh; patch_script $MODPATH/service.sh; } 744 | else 745 | ui_print " Installing scripts for $ROOTTYPE..." 746 | test "$ROOTTYPE" == "LineageOS SU" -o "$ROOTTYPE" == "other root or rootless" && { ui_print " "; ui_print " ! This root method has no boot script support !"; ui_print " ! You will need to add init.d support !"; ui_print " "; } 747 | 748 | # COPY MODULE.PROP FILE FOR VERSION CHECKING 749 | $CP_NBPRFX $INSTALLER/module.prop $MOD_VER 750 | add_to_info $MOD_VER $INFO 751 | 752 | # INSTALL POST-FS-DATA MODE SCRIPTS 753 | if $POSTFSDATA; then 754 | $CP_NBPRFX $INSTALLER/common/unity-audmodlib/$MODID-post-fs-data.sh $SH/$MODID-post-fs-data 0700 755 | add_to_info $SH/$MODID-post-fs-data $INFO 756 | patch_script $SH/$MODID-post-fs-data 757 | fi 758 | 759 | # INSTALL SERVICE MODE SCRIPTS 760 | if $LATESTARTSERVICE; then 761 | $CP_NBPRFX $INSTALLER/common/unity-audmodlib/$MODID-service.sh $SH/$MODID-service 0700 762 | add_to_info $SH/$MODID-service $INFO 763 | patch_script $SH/$MODID-service 764 | fi 765 | 766 | # INSTALL ROM BACKUP SCRIPT 767 | if [ -d /system/addon.d ]; then 768 | ui_print " Installing addon.d backup script..." 769 | # INSERT MODID INTO ADDON.D SCRIPT 770 | sed -i "s//$MODID/" $INSTALLER/system/addon.d/modid.sh 771 | $CP_NBPRFX $INSTALLER/system/addon.d/modid.sh /system/addon.d/$MODID.sh 0755 772 | $AUDMODLIB && $CP_NBPRFX $INSTALLER/system/addon.d/audmodlib.sh /system/addon.d/audmodlib.sh 0755 773 | else 774 | ui_print " ! Addon.d not detected. Backup script not installed..." 775 | fi 776 | fi 777 | 778 | # ADD BUILDPROPS 779 | test -s $INSTALLER/common/system.prop && { ui_print " Adding build.props..."; unity_prop_copy $INSTALLER/common/system.prop; } 780 | ! $MAGISK && [ -f "$SH/$MODID-props" ] && add_to_info $SH/$MODID-props $INFO 781 | 782 | # INSTALL APPS & LIBRARIES 783 | ui_print " Installing files for $ARCH SDK $API device..." 784 | 785 | # PROCESS FOLDERS AND FILES 786 | find -L $INSTALLER/system -type f -print > $INSTALLER/tfiles 787 | rm -f $INSTALLER/data/placeholder 788 | find $INSTALLER/data -type f -print >> $INSTALLER/tfiles 789 | sed -i -e '/addon.d/ d' -e 's/&/\\&/g' -e "s|$INSTALLER||g" $INSTALLER/tfiles 790 | $IS64BIT || sed -i '/lib64/ d' $INSTALLER/tfiles 791 | 792 | cat $INSTALLER/tfiles | while read LINE; do 793 | if $OREONEW; then 794 | case $LINE in 795 | /system/app/*|/system/lib*) LINE2=$(echo $LINE | sed "s|/system/|$VEN/|");; 796 | *) LINE2=$LINE;; 797 | esac 798 | else 799 | $OLDAPP && LINE2=$(echo $LINE | sed 's|/system/app/.*/|/system/app/|') || LINE2=$(echo $LINE | sed 's|/system/app/|/system/priv-app/|') 800 | fi 801 | $CP_PRFX $INSTALLER$LINE $LINE2 802 | done 803 | 804 | NUM=1; while [ $NUM -le $NUMOFCUSTRULES ]; do 805 | test "$(grep "TIMEOFEXEC=3" $INSTALLER/common/unity-customrules$NUM.sh)" && source $INSTALLER/common/unity-customrules$NUM.sh 806 | NUM=$((NUM+1)) 807 | done 808 | 809 | # COPY PROP FILE & CONF FILEmTO MAGISK_MERGE FOR BOOTMODE 810 | $BOOTMODE && { test -f $PROPFILE && $CP_NBPRFX $PROPFILE $MODPATH/system.prop; test -f $CONFPROPS && $CP_NBPRFX $CONFPROPS $MODPATH/$MODID-conflictingprops.txt; } 811 | 812 | # REMOVE INFO FILE IF NOT NEEDED 813 | $MAGISK && [ ! -s $INFO ] && rm -f $INFO 814 | } 815 | 816 | # UNITY UNINSTALLER 817 | unity_uninstall() { 818 | #### CLEANING UP #### 819 | ui_print " " 820 | ui_print "- Cleaning up previous installations -" 821 | 822 | # REMOVE FILES 823 | info_uninstall $INFO 824 | 825 | # RESTORE CONFIGS, LIBRARIES, & EFFECTS 826 | $AUDMODLIB && source $INSTALLER/common/aml-patches-remove.sh 827 | 828 | if $MAGISK; then 829 | rm -rf $MODPATH 830 | rm -rf /sbin/.core/img/$MODID 831 | $AUDMODLIB && if [ -f /sbin/.core/img/audmodlib/post-fs-data.sh ]; then sed -i "/^#$MODID/,/fi #$MODID/d" /sbin/.core/img/audmodlib/post-fs-data.sh; else sed -i "/^#$MODID/,/fi #$MODID/d" $AMLSCRIPT; fi 832 | # Use magisk_merge for aml during bootmode uninstall 833 | $AUDMODLIB && if $BOOTMODE; then aml_mod; else ui_print " Removing $MODID from Audio Modification Library"; fi 834 | # Remove AML if no modules are installed 835 | $AUDMODLIB && { if [ -f "/sbin/.core/img/audmodlib/post-fs-data.sh" ]; then 836 | test ! "$(sed -n '/^# MOD PATCHES/{n;p}' /sbin/.core/img/audmodlib/post-fs-data.sh)" && remove_aml 837 | else 838 | test ! "$(sed -n '/^# MOD PATCHES/{n;p}' $AMLSCRIPT)" && remove_aml 839 | fi; } 840 | else 841 | $AUDMODLIB && sed -i "/#$MODID/d" $AMLSCRIPT 842 | rm -f /system/addon.d/$MODID.sh 843 | # Remove AML if no modules are installed 844 | $AUDMODLIB && { test ! "$(sed -n '/^# MOD PATCHES/{n;p}' $AMLSCRIPT)" && remove_aml; } 845 | fi 846 | 847 | NUM=1; while [ $NUM -le $NUMOFCUSTRULES ]; do 848 | test "$(grep "TIMEOFEXEC=4" $INSTALLER/common/unity-customrules$NUM.sh)" && source $INSTALLER/common/unity-customrules$NUM.sh 849 | NUM=$((NUM+1)) 850 | done 851 | } 852 | 853 | # MAIN UNITY FUNCTION 854 | standard_procedure() { 855 | # CHECK FOR MIN & MAX API VERSION 856 | test -z $MINAPI || { test $API -ge $MINAPI || require_new_api 'minimum'; } 857 | test -z $MAXAPI || { test $API -le $MAXAPI || require_new_api 'maximum'; } 858 | 859 | # PREPARE (UN)INSTALL 860 | if [ -d /system/priv-app ]; then OLDAPP=false; else OLDAPP=true; fi 861 | 862 | # DON'T INSTALL IF INSTALLED AML VER IS NEWER THAN ONE IN ZIP 863 | if $AUDMODLIB && [ -f "$AML_VER" ]; then 864 | if [ $(grep_prop versionCode $AML_VER) -gt $(grep_prop versionCode $INSTALLER/common/unity-audmodlib/audmodlibmodule.prop) ]; then 865 | ui_print " " 866 | ui_print " ! Module contains older version of audmodlib !" 867 | ui_print " ! than is currently installed ! " 868 | abort " ! Upgrade this module to latest audmodlib !" 869 | elif [ $(grep_prop versionCode $AML_VER) -lt 9 ]; then 870 | ui_print " " 871 | ui_print " ! AML older than v2.3 detected !" 872 | ui_print " ! upgrade process only supported on v2.3+ ! " 873 | ui_print " ! Uninstall all aml modules first !" 874 | abort " ! Then install this module !" 875 | fi 876 | fi 877 | 878 | # DETERMINE IF MOD IS ALREADY INSTALLED. IF SAME VERSION IS INSTALLED, UNINSTALL 879 | if [ -f "$MOD_VER" ]; then 880 | if [ $(grep_prop versionCode $MOD_VER) -ge $(grep_prop versionCode $INSTALLER/module.prop) ]; then 881 | ui_print " " 882 | ui_print " ! Current or newer version detected. Uninstalling!" 883 | UPGRADE=false 884 | else 885 | ui_print " " 886 | ui_print " ! Older version detected. Removing..." 887 | UPGRADE=true 888 | fi 889 | INSTALL=false 890 | else 891 | UPGRADE=false 892 | fi 893 | 894 | if $INSTALL; then 895 | # MAKE INFO FILE 896 | $MAGISK || rm -f $CONFPROPS 897 | test ! -f "$INFO" && mktouch $INFO 898 | 899 | # RUN CUSTOMFULES1 900 | NUM=1; while [ $NUM -le $NUMOFCUSTRULES ]; do 901 | test "$(grep "TIMEOFEXEC=1" $INSTALLER/common/unity-customrules$NUM.sh)" && source $INSTALLER/common/unity-customrules$NUM.sh 902 | NUM=$((NUM+1)) 903 | done 904 | 905 | # WIPE FILES/FOLDERS 906 | cat $INSTALLER/common/unity-files-wipe.sh | while read LINE; do 907 | wipe_ch $LINE 908 | done 909 | 910 | # PATCH FILES 911 | $AUDMODLIB && aml_mod 912 | 913 | # COPY FILES 914 | unity_mod_copy 915 | 916 | # COMPLETING INSTALL 917 | ui_print " " 918 | ui_print "- Setting Permissions" 919 | if $MAGISK; then 920 | $AUDMODLIB && set_perm_recursive $AMLPATH 0 0 0755 0644 921 | set_permissions 922 | set_perm_recursive $AMLPATH/system/xbin 0 0 0755 0755 923 | else 924 | set_permissions 925 | action_complete 926 | exit 0 927 | fi 928 | else 929 | # UNINSTALL 930 | unity_uninstall 931 | 932 | if $UPGRADE; then 933 | INSTALL=true 934 | ui_print " " 935 | ui_print "! Uninstall completed, beginning install !" 936 | standard_procedure 937 | else 938 | # COMPLETING UNINSTALL 939 | ui_print " " 940 | ui_print "- Completing uninstall -" 941 | $MAGISK || { action_complete; exit 0; } 942 | fi 943 | fi 944 | } 945 | 946 | ########################################################################################## 947 | # (UN)INSTALL 948 | ########################################################################################## 949 | 950 | # MAGISK PATHS 951 | MAGISKBIN=/data/adb/magisk 952 | MOUNTPATH=$TMPDIR/magisk_img 953 | $BOOTMODE && IMG=/data/adb/magisk_merge.img 954 | 955 | # CHECK FOR OLD MAGISK, DETERMINE IF SYSTEM INSTALL OR MAGISK INSTALL, CHECK MAGISK VERSION (IF APPLICABLE) 956 | if [ ! -d $MAGISKBIN ] && [ ! -d /data/magisk ]; then 957 | system_install 958 | standard_procedure 959 | elif [ ! -f $MAGISKBIN/util_functions.sh ]; then 960 | require_new_magisk 961 | else 962 | . $MAGISKBIN/util_functions.sh 963 | [ ! -z $MAGISK_VER_CODE -a $MAGISK_VER_CODE -ge $(grep_prop minMagisk $INSTALLER/module.prop) ] || require_new_magisk 964 | fi 965 | 966 | # MOUNT PARTITIONS 967 | mount_partitions 968 | ui_print "- Magisk install detected" 969 | 970 | # DETECT VERSION AND ARCHITECTURE 971 | api_level_arch_detect_mod 972 | 973 | # SETUP BUSYBOX AND BINARIES 974 | $BOOTMODE && boot_actions || recovery_actions 975 | 976 | # Get the variable reqSizeM 977 | request_zip_size_check "$ZIP" 978 | 979 | # THIS FUNCTION WILL MOUNT $IMG TO $MOUNTPATH, AND RESIZE THE IMAGE BASED ON $REQSIZEM 980 | mount_magisk_img 981 | 982 | # ACTUAL (UN)INSTALL 983 | magisk_install 984 | standard_procedure 985 | 986 | # UNMOUNT MAGISK IMAGE AND SHRINK IF POSSIBLE 987 | unmount_magisk_img 988 | 989 | $BOOTMODE || recovery_cleanup 990 | rm -rf $TMPDIR 991 | 992 | action_complete 993 | 994 | # PLEASE LEAVE THIS MESSAGE IN YOUR FLASHABLE ZIP FOR CREDITS :) 995 | ui_print " " 996 | ui_print " *******************************************" 997 | ui_print " * Powered by Magisk (@topjohnwu) *" 998 | ui_print " *******************************************" 999 | ui_print " " 1000 | 1001 | exit 0 1002 | -------------------------------------------------------------------------------- /META-INF/com/google/android/updater-script: -------------------------------------------------------------------------------- 1 | #MAGISK 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # This is the Old AML. It's just left as as reference for now 2 | # Current AML is [here](https://github.com/Zackptg5/Audio-Modification-Library) 3 | 4 | # Audio Modification Library Template 5 | AudModLib is a compatibility framework that allows the seamless integration of multiple audio mods for both Magisk and System installs. [More details in support thread](https://forum.xda-developers.com/apps/magisk/module-audio-modification-library-t3579612). 6 | 7 | ## Compatibility 8 | * Android Jellybean+ 9 | * init.d (other root & rootless) - requires init.d support. If you don't have init.d support, try [Init.d Injector](https://forum.xda-developers.com/android/software-hacking/mod-universal-init-d-injector-wip-t3692105) 10 | * MagiskSU & SuperSU 11 | * Magisk & System install 12 | * Nexus/Pixel support (A/B OTA) 13 | * SELinux enforcing 14 | * Works with nearly every device, kernel, and rom 15 | 16 | ## Change Log 17 | ### v2.9 - 1.12.2018 18 | * Changed copy functions (CP_PRFX and CP_NBPRFX) so it works with partitions other than system and vendor. UNITY variable no longer needed adns shouldn't be used when the CP prefixes are used 19 | * Merged unity-wipe function with rest of installer - TIMEOFEXEC=1 still runs at the same time though so customrules aren't change 20 | * Copy system audio_effects cfg to vendor if missing 21 | * Add device_check function 22 | * Comment out music_helper effect instead of entire volume listener library 23 | 24 | ### v2.8 - 12.29.2017 25 | * Script improvements 26 | * oos oreo permissive workaround fixed and moved out of aml and into individual modules that need it 27 | 28 | ### v2.7 - 12.26.2017 29 | * Fixed lib patching bug with oreo devices that don't have a separate vendor partition 30 | * Fixed bug in magisk module template in which it doesn't properly detect older versions of magisk 31 | 32 | ### v2.6 - 12.25.2017 33 | * Move sepolicy out of aml and into individual modules 34 | * Fix and improve aml boot script 35 | * Update binary with v1500 magisk template - now only compatible with magisk v15+ 36 | 37 | ### v2.5 - 12.13.2017 38 | * Fix conditional logic 39 | * Fix boot scripts 40 | * Fix prop install 41 | * Concatentate and reorganize update-binary 42 | * Removed xmlstarlet - not compatible with all devices and there's no real need for it 43 | * Add some new variables and functionality so apps and libs will be installed to vendor if rom is oreo or newer 44 | * Added audio_effects xml files to CFGS array - along with previous point, should add pixel 2 compatibility' 45 | * Added new sepolicy patch needed for oreo 46 | * Replace sepolicy patches with "setenforce 0" if oos oreo is detected - temporary workaround for now 47 | 48 | ### v2.4 - 11.30.2017 49 | * Fix mounting issues with Magisk v14.0 50 | * Streamlined some of the code 51 | 52 | ### v2.3 - 11.28.2017 53 | * Bug fixes and fine tuning for prop logic 54 | * Fix unmounting for system installs 55 | * Get rid of errors causeing recovery log spam 56 | * Add pixel 2 support (need magisk 14.5 or newer) 57 | * Remove all variables for conf/pol/mix files - autodetect them instead 58 | * Comment out volume_listener library instead of the entire output_session_processing 59 | * Remove proxy library addition from aml (mod specific) 60 | * Redo util_functions - use magisk one if present 61 | * Add magisk 14.5 support 62 | * General script improvements 63 | 64 | ### v2.2 - 11.8.2017 65 | * Got rid of common aml prop file - now uses individual prop file for each mod 66 | * Sepolicy function fixes 67 | * Remove EXT variable - no need for it 68 | * Use /su/bin/sush shebang for scripts with systemless supersu install 69 | * Fix bootmode aml automount 70 | * Fix magisk clean flash support 71 | * Add AML upgrade feature 72 | 73 | ### v2.1 - 10.20.2017 74 | * Updated for Magisk v14.3 75 | * Updated to Magisk module template 1410 76 | * Massive script reduction & efficiency enhancements 77 | * Added XMLStartlet for arm/arm64 & x86 by JamesDSP developer, james3460297 @ XDA Developers (this toolkit allows the editing & patching of XML files using a simple set of shell commands in a way similar to how it is done with grep, sed, awk, diff, patch, join, etc commands) 78 | * Combined customrules.sh CP_PRFX command with MK_PRFX so by default, the command CP_PRFX both creates the directory and copies the file (thus removing the need to have two seperate customrules.sh for cp and mk) 79 | * Combined customrules.sh CP_PRFX command with CP_SFFX, so the default file placement permission is 0644 and the default folder creation permission is 0755 (you can manually define file copy permission by adding " 0755" or whatever permission you want at the end of the line that contains CP_PRFX) 80 | * Silently uninstall previous version before new version upgrades (this is to keep every upgrade install clean in cases where the new version doesn't include files the previous version may have included) 81 | * Further A/B OTA (Pixel family) improvements 82 | * System backup/restore fully automated (no need to manually write files to INFO file anymore) 83 | * Added MAXAPI variable to unity-uservariables that compliments MINAPI (this allows the developer to quickly set the minimum and maximum SDK version of their modification) 84 | * Added cabability for modifications to modify /data partition, with full backup/removal support 85 | * Greatly improved uninstall function by concatenating script 86 | * Added "minVer" (an internal check that should always be equal to the latest stable Magisk release in cases where the template is based off of a beta release) 87 | * Added support for SuperSU BINDSBIN mode 88 | * Fix cache system installs 89 | * Moved scripts to post-fs-data for Magisk installs (fixes some issues such as AM3D white screen on compatible devices) 90 | * Combined multiple wipe functions into one 91 | * Fixed System override issues some were facing 92 | * Fixed System install partition re-mounting 93 | * Updated Instructions (for developers only) 94 | * Addon.d script fixes/improvements 95 | * Various miscellaneous script fixes and improvements 96 | 97 | ### v2.0 98 | * Massive installer and script overhaul 99 | * Added autouninstall (if mod is already installed and you flash same version zip again, it'll uninstall), thus removing the need for an uninstall zip 100 | * Added file/folder backup/restore of modified files 101 | * Added file/folder backup/restore of normally wiped files 102 | * Added Osm0sis @ xda-developers uninstaller idea (just add "uninstall" to zip name and it'll function as uninstaller) 103 | * Added phh's SuperUser and LOS su support (note, LOS doesn't support sepolicy patching) 104 | * Added proxy library to AML to allow the proxy effects found in multiple audio modules 105 | * Added support for Magisk imgs located in /cache/audmodlib 106 | * Added system_root support for Pixel devices 107 | * Added system override (if you're on magisk but would rather have it install to system, add word "system" to zip name and it'll install everything but scripts to system) 108 | * Add Unity system props 109 | * Added vendor fix for Nexus devices 110 | * AML functionality and uses overhauled 111 | * Bug fixes 112 | * Modified Unity Installer to allow use for non AML modules 113 | * Moved scripts from Magisk .core to the individual module folder due to .core limitations 114 | * New modular approach - no need to modify update-binary anymore: check instructions for more details on how this works 115 | * Reworked addon.d system install scripts 116 | * Removed AML cache workaround by reworking AML changes via magisk_merge 117 | * Reworked AML vendor audio_effects to not be overwritten by system audio_effects by commenting out conflicting lines 118 | * Reworked script permissions 119 | * Update sepolicy for Magisk 13+ 120 | * Updated to Magisk module template 1400 121 | 122 | ### v1.4 123 | * Change SELinux live patching to allow better compatibility between different devices, kernels, and roms; while also keeping the amount of "allowances" to a minumum 124 | * Changed post-fs-data(.d)/service(.d) shell script names for cosmetic recognition 125 | * Merge SuperSU shell script with MagiskSU post-fs-data(.d)/service(.d) script for less fragmentation 126 | * Added /cache/audmodlib.log to determine if script has run successfully 127 | * More audio policy files and various mixer_paths files are now included in the framework 128 | * Install script changes that include: major update to Pixel (A/B OTA) support, mounting changes, improved script efficiency, fixes & consolidation, and cosmetic fixes 129 | * Add/fix proper addon.d support 130 | 131 | ### v1.3 132 | * Script addition to allow various audio mods working with SELinux Enforcing 133 | * Remove (audmodlib)service.sh and replace with post-fs-data(.d) audmodlib.sh, which should fix when root may be lost upon installing certain mods 134 | 135 | ### v1.2 136 | * Added audmodlib.sh post-fs-data.d script 137 | * Fix selinux injection script to work for MagiskSU/SuperSU (system and systemless) 138 | * Install script fixes 139 | 140 | ### v1.1 141 | * Hotfix for bootloop issues on some devices 142 | 143 | ### v1.0 144 | * Initial Magisk release 145 | 146 | ## Source Code 147 | * Module [GitHub](https://github.com/therealahrion/Audio-Modification-Library) 148 | -------------------------------------------------------------------------------- /common/aml-patches-remove.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/therealahrion/Audio-Modification-Library/44252d2780360edd200f5cd9807623d3837c407d/common/aml-patches-remove.sh -------------------------------------------------------------------------------- /common/aml-patches-wipe.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/therealahrion/Audio-Modification-Library/44252d2780360edd200f5cd9807623d3837c407d/common/aml-patches-wipe.sh -------------------------------------------------------------------------------- /common/aml-patches.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/therealahrion/Audio-Modification-Library/44252d2780360edd200f5cd9807623d3837c407d/common/aml-patches.sh -------------------------------------------------------------------------------- /common/post-fs-data.sh: -------------------------------------------------------------------------------- 1 | # v DO NOT MODIFY v 2 | # Only predefined variables for this script are: $ROOT, $SYS, $VEN, $MODID, $AMLPATH, $MAGISK, $XML_PRFX, $SH, and $SEINJECT 3 | # Add any script logic you want run here (post-fs-data in magisk and normal boot time scripts otherwise) 4 | # ^ DO NOT MODIFY ^ 5 | -------------------------------------------------------------------------------- /common/service.sh: -------------------------------------------------------------------------------- 1 | # v DO NOT MODIFY v 2 | # Only predefined variables for this script are: $ROOT, $SYS, $VEN, $MODID, $AMLPATH, $MAGISK, $XML_PRFX, $SH, and $SEINJECT 3 | # Add any script logic you want run here (late service start in magisk and normal boot time scripts otherwise) 4 | # ^ DO NOT MODIFY ^ 5 | -------------------------------------------------------------------------------- /common/system.prop: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/therealahrion/Audio-Modification-Library/44252d2780360edd200f5cd9807623d3837c407d/common/system.prop -------------------------------------------------------------------------------- /common/unity-audmodlib/audmodlib-post-fs-data.sh: -------------------------------------------------------------------------------- 1 | 2 | SH=${0%/*} 3 | SEINJECT= 4 | AMLPATH= 5 | MAGISK= 6 | ROOT= 7 | SYS= 8 | VEN= 9 | SOURCE= 10 | LIBDIR= 11 | MODIDS="" 12 | ### FILE LOCATIONS ### 13 | CFGS="" 14 | CFGSXML="" 15 | POLS="" 16 | POLSXML="" 17 | MIXS="" 18 | # MOD PATCHES 19 | 20 | if [ "$MAGISK" == true ]; then 21 | for MOD in ${MODIDS}; do 22 | sed -i "/^#$MOD/,/fi #$MOD/d" $SH/post-fs-data.sh 23 | done 24 | test ! "$(sed -n '/# MOD PATCHES/{n;p}' $AMLPATH/post-fs-data.sh)" && rm -rf $AMLPATH 25 | fi 26 | -------------------------------------------------------------------------------- /common/unity-audmodlib/audmodlibmodule.prop: -------------------------------------------------------------------------------- 1 | id=AudModLib 2 | name=Audio Modification Library 3 | version=v2.9 4 | versionCode=15 5 | author=ahrion, zackptg5 6 | description=AudModLib is a framework that allows the seamless integration of multiple audio mods in Magisk 7 | support=https://forum.xda-developers.com/apps/magisk/module-audio-modification-library-t3579612 8 | donate=https://github.com/therealahrion/Audio-Modification-Library 9 | minMagisk=1500 10 | -------------------------------------------------------------------------------- /common/unity-audmodlib/modid.sh: -------------------------------------------------------------------------------- 1 | 2 | SH=${0%/*} 3 | SEINJECT= 4 | AMLPATH= 5 | MAGISK= 6 | ROOT= 7 | SYS= 8 | VEN= 9 | SOURCE= 10 | LIBDIR= 11 | MODID= 12 | ### FILE LOCATIONS ### 13 | CFGS="" 14 | CFGSXML="" 15 | POLS="" 16 | POLSXML="" 17 | MIXS="" 18 | # SEPOLICY SETTING FUNCTION 19 | set_sepolicy() { 20 | if [ "$(basename $SEINJECT)" == "sepolicy-inject" ]; then 21 | if [ -z $2 ]; then $SEINJECT -Z $1 -l; else $SEINJECT -s $1 -t $2 -c $3 -p $4 -l; fi 22 | else 23 | if [ -z $2 ]; then $SEINJECT --live "permissive $(echo $1 | sed 's/,/ /g')"; else $SEINJECT --live "allow $1 $2 $3 { $(echo $4 | sed 's/,/ /g') }"; fi 24 | fi 25 | } 26 | 27 | # CUSTOM USER SCRIPT 28 | -------------------------------------------------------------------------------- /common/unity-customrules1.sh: -------------------------------------------------------------------------------- 1 | TIMEOFEXEC=0 2 | -------------------------------------------------------------------------------- /common/unity-files-wipe.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/therealahrion/Audio-Modification-Library/44252d2780360edd200f5cd9807623d3837c407d/common/unity-files-wipe.sh -------------------------------------------------------------------------------- /common/unity-uservariables.sh: -------------------------------------------------------------------------------- 1 | # v DO NOT MODIFY v 2 | # Uncomment AUDMODLIB=true if using audio modifcation library (if you're using a sound module). Otherwise, comment it 3 | # Uncomment and change 'MINAPI' and 'MAXAPI' to the minimum and maxium android version for your mod (note that magisk has it's own minimum api: 21 (lollipop)) 4 | # ^ DO NOT MODIFY ^ 5 | #MINAPI=21 6 | #MAXAPI=25 7 | #AUDMODLIB=true 8 | -------------------------------------------------------------------------------- /config.sh: -------------------------------------------------------------------------------- 1 | ########################################################################################## 2 | # 3 | # Magisk Module Template Config Script 4 | # by topjohnwu 5 | # 6 | ########################################################################################## 7 | ########################################################################################## 8 | # 9 | # Instructions: 10 | # 11 | # 1. Place your files into system folder (delete the placeholder file) 12 | # 2. Fill in your module's info into module.prop 13 | # 3. Configure the settings in this file (common/config.sh) 14 | # 4. For advanced features, add shell commands into the script files under common: 15 | # post-fs-data.sh, service.sh 16 | # 5. For changing props, add your additional/modified props into common/system.prop 17 | # 18 | ########################################################################################## 19 | 20 | ########################################################################################## 21 | # Defines 22 | ########################################################################################## 23 | 24 | # NOTE: This part has to be adjusted to fit your own needs 25 | 26 | # Set to true if you need to enable Magic Mount 27 | # Most mods would like it to be enabled 28 | AUTOMOUNT=true 29 | 30 | # Set to true if you need post-fs-data script 31 | POSTFSDATA=false 32 | 33 | # Set to true if you need late_start service script 34 | LATESTARTSERVICE=false 35 | 36 | ########################################################################################## 37 | # Installation Message 38 | ########################################################################################## 39 | 40 | # Set what you want to show when installing your mod 41 | 42 | print_modname() { 43 | ui_print " " 44 | ui_print " *******************************************" 45 | ui_print " **" 46 | ui_print " *******************************************" 47 | ui_print " **" 48 | ui_print " **" 49 | ui_print " *******************************************" 50 | ui_print " " 51 | } 52 | 53 | ########################################################################################## 54 | # Replace list 55 | ########################################################################################## 56 | 57 | # List all directories you want to directly replace in the system 58 | # By default Magisk will merge your files with the original system 59 | # Directories listed here however, will be directly mounted to the correspond directory in the system 60 | 61 | # You don't need to remove the example below, these values will be overwritten by your own list 62 | # This is an example 63 | REPLACE=" 64 | /system/app/Youtube 65 | /system/priv-app/SystemUI 66 | /system/priv-app/Settings 67 | /system/framework 68 | " 69 | 70 | # Construct your own list here, it will overwrite the example 71 | # !DO NOT! remove this if you don't need to replace anything, leave it empty as it is now 72 | REPLACE=" 73 | " 74 | 75 | ########################################################################################## 76 | # Permissions 77 | ########################################################################################## 78 | 79 | # NOTE: This part has to be adjusted to fit your own needs 80 | 81 | set_permissions() { 82 | # DEFAULT PERMISSIONS, DON'T REMOVE THEM 83 | test "$MAGISK" == "true" && set_perm_recursive $MODPATH 0 0 0755 0644 84 | 85 | # CUSTOM PERMISSIONS 86 | 87 | # Some templates if you have no idea what to do: 88 | # Note that all files/folders have the $UNITY prefix - keep this prefix on all of your files/folders 89 | # Also note the lack of '/' between variables - preceding slashes are already included in the variables 90 | # Use $SYS for system and $VEN for vendor (Do not use $SYS$VEN, the $VEN is set to proper vendor path already - could be /vendor, /system/vendor, etc.) 91 | 92 | # set_perm_recursive (default: u:object_r:system_file:s0) 93 | # set_perm_recursive $UNITY$SYS/lib 0 0 0755 0644 94 | # set_perm_recursive $UNITY$VEN/lib/soundfx 0 0 0755 0644 95 | 96 | # set_perm (default: u:object_r:system_file:s0) 97 | # set_perm $UNITY$SYS/lib/libart.so 0 0 0644 98 | } 99 | -------------------------------------------------------------------------------- /custom/placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/therealahrion/Audio-Modification-Library/44252d2780360edd200f5cd9807623d3837c407d/custom/placeholder -------------------------------------------------------------------------------- /data/placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/therealahrion/Audio-Modification-Library/44252d2780360edd200f5cd9807623d3837c407d/data/placeholder -------------------------------------------------------------------------------- /module.prop: -------------------------------------------------------------------------------- 1 | id=AMLTemplate 2 | name=Audio Modification Library Template 3 | version=v2.9 4 | versionCode=15 5 | author=ahrion, zackptg5 6 | description=AudModLib is a framework that allows the seamless integration of multiple audio mods in Magisk. This will uninstall it 7 | support=https://forum.xda-developers.com/apps/magisk/module-audio-modification-library-t3579612 8 | donate=https://github.com/therealahrion/Audio-Modification-Library 9 | minMagisk=1500 10 | -------------------------------------------------------------------------------- /system/addon.d/audmodlib.sh: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | # 3 | . /tmp/backuptool.functions 4 | 5 | list_files() { 6 | cat < 5 | list_files() { 6 | cat <