diff --git a/scripts/run.sh b/scripts/run.sh index 0809923..c1326bc 100644 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -17,6 +17,10 @@ function YesNoBox { whiptail --title "${o[title]}" --yesno "${o[text]}" 0 0 } +function Gen_Rand_Str { + echo $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w "$1" | head -n 1) +} + echo "Dependencies" sudo apt update && sudo apt -y install setools lzip wine winetricks patchelf whiptail e2fsprogs cp -r ../wine/.cache/* ~/.cache @@ -212,47 +216,52 @@ EOF sudo patchelf --replace-needed libdl.so "../linker/libdl.so" ../_WORK_DIR_/magisk/magiskpolicy || true sudo patchelf --set-interpreter "../linker/linker64" ../_WORK_DIR_/magisk/magiskpolicy || true chmod +x ../_WORK_DIR_/magisk/magiskpolicy - echo '/dev/wsa-magisk(/.*)? u:object_r:magisk_file:s0' | sudo tee -a $MOUNT_DIR/vendor/etc/selinux/vendor_file_contexts + TMP_PATH=$(Gen_Rand_Str 8) + echo "/dev/"$TMP_PATH"(/.*)? u:object_r:magisk_file:s0" | sudo tee -a $MOUNT_DIR/vendor/etc/selinux/vendor_file_contexts echo '/data/adb/magisk(/.*)? u:object_r:magisk_file:s0' | sudo tee -a $MOUNT_DIR/vendor/etc/selinux/vendor_file_contexts sudo ../_WORK_DIR_/magisk/magiskpolicy --load $MOUNT_DIR/vendor/etc/selinux/precompiled_sepolicy --save $MOUNT_DIR/vendor/etc/selinux/precompiled_sepolicy --magisk "allow * magisk_file lnk_file *" + SERVER_NAME1=$(Gen_Rand_Str 12) + SERVER_NAME2=$(Gen_Rand_Str 12) + SERVER_NAME3=$(Gen_Rand_Str 12) + SERVER_NAME4=$(Gen_Rand_Str 12) sudo tee -a $MOUNT_DIR/system/etc/init/hw/init.rc <