From dca675e5f64b374e61bbd62183a7b95e961f97bb Mon Sep 17 00:00:00 2001 From: ShyPixie Date: Thu, 22 Sep 2022 19:27:11 -0300 Subject: [PATCH 01/11] Make sudo optional --- scripts/build.sh | 167 ++++++++++++++++++++++++----------------------- 1 file changed, 84 insertions(+), 83 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 935b6c37ee..c11eb96d95 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -38,20 +38,21 @@ DOWNLOAD_DIR=../download DOWNLOAD_CONF_NAME=download.list OUTPUT_DIR=../output MOUNT_DIR="$WORK_DIR"/system +SUDO="$(which sudo 2>/dev/null)" umount_clean() { if [ -d "$MOUNT_DIR" ]; then echo "Cleanup Work Directory" if [ -d "$MOUNT_DIR/vendor" ]; then - sudo umount "$MOUNT_DIR"/vendor + $SUDO umount "$MOUNT_DIR"/vendor fi if [ -d "$MOUNT_DIR/product" ]; then - sudo umount "$MOUNT_DIR"/product + $SUDO umount "$MOUNT_DIR"/product fi if [ -d "$MOUNT_DIR/system_ext" ]; then - sudo umount "$MOUNT_DIR"/system_ext + $SUDO umount "$MOUNT_DIR"/system_ext fi - sudo umount "$MOUNT_DIR" - sudo rm -rf "${WORK_DIR:?}" + $SUDO umount "$MOUNT_DIR" + $SUDO rm -rf "${WORK_DIR:?}" else rm -rf "${WORK_DIR:?}" fi @@ -276,8 +277,8 @@ if [ "$DEBUG" ]; then fi require_su() { - if [ "$(sudo whoami)" != "root" ]; then - sudo echo "sudo is required to run this script" + if test -z $SUDO && test $(whoami) != "root"; then + echo "ROOT/SUDO is required to run this script" fi } @@ -366,10 +367,10 @@ if [ -f "$MAGISK_PATH" ]; then CLEAN_DOWNLOAD_MAGISK=1 abort fi - sudo patchelf --replace-needed libc.so "../linker/$HOST_ARCH/libc.so" "$WORK_DIR"/magisk/magiskpolicy || abort - sudo patchelf --replace-needed libm.so "../linker/$HOST_ARCH/libm.so" "$WORK_DIR"/magisk/magiskpolicy || abort - sudo patchelf --replace-needed libdl.so "../linker/$HOST_ARCH/libdl.so" "$WORK_DIR"/magisk/magiskpolicy || abort - sudo patchelf --set-interpreter "../linker/$HOST_ARCH/linker64" "$WORK_DIR"/magisk/magiskpolicy || abort + $SUDO patchelf --replace-needed libc.so "../linker/$HOST_ARCH/libc.so" "$WORK_DIR"/magisk/magiskpolicy || abort + $SUDO patchelf --replace-needed libm.so "../linker/$HOST_ARCH/libm.so" "$WORK_DIR"/magisk/magiskpolicy || abort + $SUDO patchelf --replace-needed libdl.so "../linker/$HOST_ARCH/libdl.so" "$WORK_DIR"/magisk/magiskpolicy || abort + $SUDO patchelf --set-interpreter "../linker/$HOST_ARCH/linker64" "$WORK_DIR"/magisk/magiskpolicy || abort chmod +x "$WORK_DIR"/magisk/magiskpolicy || abort elif [ -z "${CUSTOM_MAGISK+x}" ]; then echo "The Magisk zip package does not exist, is the download incomplete?" @@ -411,7 +412,7 @@ if [ "$GAPPS_BRAND" != 'none' ]; then fi echo "Expand images" -if [ ! -f /etc/mtab ]; then sudo ln -s /proc/self/mounts /etc/mtab; fi +if [ ! -f /etc/mtab ]; then $SUDO ln -s /proc/self/mounts /etc/mtab; fi e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/system_ext.img || abort SYSTEM_EXT_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/system_ext.img | cut -f1) + 20000)) if [ -d "$WORK_DIR"/gapps/system_ext ]; then @@ -451,28 +452,28 @@ resize2fs "$WORK_DIR"/wsa/"$ARCH"/vendor.img "$VENDOR_SIZE"s || abort echo -e "Expand images done\n" echo "Mount images" -sudo mkdir "$MOUNT_DIR" || abort -sudo mount -o loop "$WORK_DIR"/wsa/"$ARCH"/system.img "$MOUNT_DIR" || abort -sudo mount -o loop "$WORK_DIR"/wsa/"$ARCH"/vendor.img "$MOUNT_DIR"/vendor || abort -sudo mount -o loop "$WORK_DIR"/wsa/"$ARCH"/product.img "$MOUNT_DIR"/product || abort -sudo mount -o loop "$WORK_DIR"/wsa/"$ARCH"/system_ext.img "$MOUNT_DIR"/system_ext || abort +$SUDO mkdir "$MOUNT_DIR" || abort +$SUDO mount -o loop "$WORK_DIR"/wsa/"$ARCH"/system.img "$MOUNT_DIR" || abort +$SUDO mount -o loop "$WORK_DIR"/wsa/"$ARCH"/vendor.img "$MOUNT_DIR"/vendor || abort +$SUDO mount -o loop "$WORK_DIR"/wsa/"$ARCH"/product.img "$MOUNT_DIR"/product || abort +$SUDO mount -o loop "$WORK_DIR"/wsa/"$ARCH"/system_ext.img "$MOUNT_DIR"/system_ext || abort echo -e "done\n" if [ "$REMOVE_AMAZON" ]; then echo "Remove Amazon Appstore" - find "${MOUNT_DIR:?}"/product/{etc/permissions,etc/sysconfig,framework,priv-app} | grep -e amazon -e venezia | sudo xargs rm -rf + find "${MOUNT_DIR:?}"/product/{etc/permissions,etc/sysconfig,framework,priv-app} | grep -e amazon -e venezia | $SUDO xargs rm -rf echo -e "done\n" fi if [ "$ROOT_SOL" = 'magisk' ] || [ "$ROOT_SOL" = '' ]; then echo "Integrate Magisk" - sudo mkdir "$MOUNT_DIR"/sbin - sudo setfattr -n security.selinux -v "u:object_r:rootfs:s0" "$MOUNT_DIR"/sbin || abort - sudo chown root:root "$MOUNT_DIR"/sbin - sudo chmod 0700 "$MOUNT_DIR"/sbin - sudo cp "$WORK_DIR"/magisk/magisk/* "$MOUNT_DIR"/sbin/ - sudo cp "$MAGISK_PATH" "$MOUNT_DIR"/sbin/magisk.apk - sudo tee -a "$MOUNT_DIR"/sbin/loadpolicy.sh </\n$(cat "$WORK_DIR"/wsa/xml/* | echo -e "Merge Language Resources done\n" echo "Add extra packages" -sudo cp -r ../"$ARCH"/system/* "$MOUNT_DIR" || abort -find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system/priv-app/placeholder -type d -exec chmod 0755 {} \; -find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system/priv-app/placeholder -type f -exec chmod 0644 {} \; -find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system/priv-app/placeholder -exec chown root:root {} \; -find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system/priv-app/placeholder -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort -find ../"$ARCH"/system/system/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system/etc/permissions/placeholder -type f -exec chmod 0644 {} \; -find ../"$ARCH"/system/system/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system/etc/permissions/placeholder -exec chown root:root {} \; -find ../"$ARCH"/system/system/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system/etc/permissions/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort +$SUDO cp -r ../"$ARCH"/system/* "$MOUNT_DIR" || abort +find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type d -exec chmod 0755 {} \; +find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type f -exec chmod 0644 {} \; +find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -exec chown root:root {} \; +find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort +find ../"$ARCH"/system/system/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/permissions/placeholder -type f -exec chmod 0644 {} \; +find ../"$ARCH"/system/system/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/permissions/placeholder -exec chown root:root {} \; +find ../"$ARCH"/system/system/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/permissions/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort echo -e "Add extra packages done\n" if [ "$GAPPS_BRAND" != 'none' ]; then echo "Integrate $GAPPS_BRAND" - find "$WORK_DIR/gapps/" -mindepth 1 -type d -exec sudo chmod 0755 {} \; - find "$WORK_DIR/gapps/" -mindepth 1 -type d -exec sudo chown root:root {} \; + find "$WORK_DIR/gapps/" -mindepth 1 -type d -exec $SUDO chmod 0755 {} \; + find "$WORK_DIR/gapps/" -mindepth 1 -type d -exec $SUDO chown root:root {} \; file_list="$(find "$WORK_DIR/gapps/" -mindepth 1 -type f | cut -d/ -f5-)" for file in $file_list; do - sudo chown root:root "$WORK_DIR/gapps/${file}" - sudo chmod 0644 "$WORK_DIR/gapps/${file}" + $SUDO chown root:root "$WORK_DIR/gapps/${file}" + $SUDO chmod 0644 "$WORK_DIR/gapps/${file}" done if [ "$GAPPS_BRAND" = "OpenGApps" ]; then - find "$WORK_DIR"/gapps/ -maxdepth 1 -mindepth 1 -type d -not -path '*product' -exec sudo cp --preserve=all -r {} "$MOUNT_DIR"/system \; || abort + find "$WORK_DIR"/gapps/ -maxdepth 1 -mindepth 1 -type d -not -path '*product' -exec $SUDO cp --preserve=all -r {} "$MOUNT_DIR"/system \; || abort elif [ "$GAPPS_BRAND" = "MindTheGapps" ]; then - sudo cp --preserve=all -r "$WORK_DIR"/gapps/system_ext/* "$MOUNT_DIR"/system_ext/ || abort + $SUDO cp --preserve=all -r "$WORK_DIR"/gapps/system_ext/* "$MOUNT_DIR"/system_ext/ || abort if [ -e "$MOUNT_DIR"/system_ext/priv-app/SetupWizard ]; then rm -rf "${MOUNT_DIR:?}/system_ext/priv-app/Provision" fi fi - sudo cp --preserve=all -r "$WORK_DIR"/gapps/product/* "$MOUNT_DIR"/product || abort + $SUDO cp --preserve=all -r "$WORK_DIR"/gapps/product/* "$MOUNT_DIR"/product || abort - find "$WORK_DIR"/gapps/product/overlay -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/product/overlay/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:vendor_overlay_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/product/overlay -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/overlay/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:vendor_overlay_file:s0" {} \; || abort if [ "$GAPPS_BRAND" = "OpenGApps" ]; then - find "$WORK_DIR"/gapps/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system/app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system/framework/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system/priv-app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system/app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system/framework/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system/priv-app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system/etc/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system/etc/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/framework/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/framework/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort else - find "$WORK_DIR"/gapps/product/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/product/app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/product/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/product/etc/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/product/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/product/priv-app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/product/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/product/framework/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - - find "$WORK_DIR"/gapps/product/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/product/app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/product/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/product/etc/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/product/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/product/priv-app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/product/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/product/framework/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/system_ext/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system_ext/etc/permissions/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - - sudo setfattr -n security.selinux -v "u:object_r:system_lib_file:s0" "$MOUNT_DIR"/product/lib || abort - find "$WORK_DIR"/gapps/product/lib/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/product/lib/placeholder -exec setfattr -n security.selinux -v "u:object_r:system_lib_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/product/lib64/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/product/lib64/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_lib_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/system_ext/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system_ext/priv-app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/system_ext/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system_ext/etc/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort - find "$WORK_DIR"/gapps/system_ext/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder sudo find "$MOUNT_DIR"/system_ext/priv-app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/product/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/product/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/etc/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/product/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/priv-app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/product/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/framework/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + + find "$WORK_DIR"/gapps/product/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/product/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/etc/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/product/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/priv-app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/product/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/framework/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/system_ext/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system_ext/etc/permissions/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + + $SUDO setfattr -n security.selinux -v "u:object_r:system_lib_file:s0" "$MOUNT_DIR"/product/lib || abort + find "$WORK_DIR"/gapps/product/lib/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/lib/placeholder -exec setfattr -n security.selinux -v "u:object_r:system_lib_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/product/lib64/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/lib64/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_lib_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/system_ext/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system_ext/priv-app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/system_ext/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system_ext/etc/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort + find "$WORK_DIR"/gapps/system_ext/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system_ext/priv-app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort fi - sudo "$WORK_DIR"/magisk/magiskpolicy --load "$MOUNT_DIR"/vendor/etc/selinux/precompiled_sepolicy --save "$MOUNT_DIR"/vendor/etc/selinux/precompiled_sepolicy "allow gmscore_app gmscore_app vsock_socket { create connect write read }" "allow gmscore_app device_config_runtime_native_boot_prop file read" "allow gmscore_app system_server_tmpfs dir search" "allow gmscore_app system_server_tmpfs file open" "allow gmscore_app system_server_tmpfs filesystem getattr" "allow gmscore_app gpu_device dir search" || abort + $SUDO "$WORK_DIR"/magisk/magiskpolicy --load "$MOUNT_DIR"/vendor/etc/selinux/precompiled_sepolicy --save "$MOUNT_DIR"/vendor/etc/selinux/precompiled_sepolicy "allow gmscore_app gmscore_app vsock_socket { create connect write read }" "allow gmscore_app device_config_runtime_native_boot_prop file read" "allow gmscore_app system_server_tmpfs dir search" "allow gmscore_app system_server_tmpfs file open" "allow gmscore_app system_server_tmpfs filesystem getattr" "allow gmscore_app gpu_device dir search" || abort echo -e "Integrate $GAPPS_BRAND done\n" fi if [ "$GAPPS_BRAND" != 'none' ]; then echo "Fix $GAPPS_BRAND prop" - sudo python3 fixGappsProp.py "$MOUNT_DIR" || abort + $SUDO python3 fixGappsProp.py "$MOUNT_DIR" || abort echo -e "done\n" fi echo "Umount images" -sudo find "$MOUNT_DIR" -exec touch -hamt 200901010000.00 {} \; -sudo umount "$MOUNT_DIR"/vendor -sudo umount "$MOUNT_DIR"/product -sudo umount "$MOUNT_DIR"/system_ext -sudo umount "$MOUNT_DIR" +$SUDO find "$MOUNT_DIR" -exec touch -hamt 200901010000.00 {} \; +$SUDO umount "$MOUNT_DIR"/vendor +$SUDO umount "$MOUNT_DIR"/product +$SUDO umount "$MOUNT_DIR"/system_ext +$SUDO umount "$MOUNT_DIR" echo -e "done\n" echo "Shrink images" @@ -661,7 +662,7 @@ resize2fs -M "$WORK_DIR"/wsa/"$ARCH"/system_ext.img || abort echo -e "Shrink images done\n" echo "Remove signature and add scripts" -sudo rm -rf "${WORK_DIR:?}"/wsa/"$ARCH"/\[Content_Types\].xml "$WORK_DIR"/wsa/"$ARCH"/AppxBlockMap.xml "$WORK_DIR"/wsa/"$ARCH"/AppxSignature.p7x "$WORK_DIR"/wsa/"$ARCH"/AppxMetadata || abort +$SUDO rm -rf "${WORK_DIR:?}"/wsa/"$ARCH"/\[Content_Types\].xml "$WORK_DIR"/wsa/"$ARCH"/AppxBlockMap.xml "$WORK_DIR"/wsa/"$ARCH"/AppxSignature.p7x "$WORK_DIR"/wsa/"$ARCH"/AppxMetadata || abort cp "$vclibs_PATH" "$xaml_PATH" "$WORK_DIR"/wsa/"$ARCH" || abort tee "$WORK_DIR"/wsa/"$ARCH"/Install.ps1 < Date: Fri, 23 Sep 2022 16:31:12 +0800 Subject: [PATCH 02/11] Also check if `sudo` exists in `run.sh` More distributions supported Now supports OpenSUSE's default package manager --- README.md | 15 +++++++++++++-- scripts/build.sh | 17 ++++++++++++----- scripts/run.sh | 49 +++++++++++++++++++++++++++++++++++------------- 3 files changed, 61 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 334406f033..c8594e056e 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,22 @@ - Recommended Use - Ubuntu (You can use [WSL2](https://apps.microsoft.com/store/search?publisher=Canonical%20Group%20Limited)) - `run.sh` will handle all dependencies automatically. - No need to type any commands. + Ready to use right out of the box. + - Debian (You can use [WSL2](https://apps.microsoft.com/store/detail/debian/9MSVKQC78PK6)) + + Need to add `contrib` sources to the source list to install winetricks. + + - OpenSUSE (You can use [WSL2](https://apps.microsoft.com/store/search?publisher=SUSE)) + + Ready to use right out of the box. + + `run.sh` will handle all dependencies automatically. + + No need to type any commands. - Other Distributions Install the dependencies manually. + Use the command-line program `build.sh`. ## Features diff --git a/scripts/build.sh b/scripts/build.sh index c11eb96d95..eaf2a8f594 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -39,6 +39,9 @@ DOWNLOAD_CONF_NAME=download.list OUTPUT_DIR=../output MOUNT_DIR="$WORK_DIR"/system SUDO="$(which sudo 2>/dev/null)" +if [ -z "$SUDO" ]; then + unset SUDO +fi umount_clean() { if [ -d "$MOUNT_DIR" ]; then echo "Cleanup Work Directory" @@ -277,15 +280,18 @@ if [ "$DEBUG" ]; then fi require_su() { - if test -z $SUDO && test $(whoami) != "root"; then - echo "ROOT/SUDO is required to run this script" + if test "$(whoami)" != "root"; then + if [ -z "$SUDO" ] && [ "$($SUDO whoami)" != "root" ]; then + echo "ROOT/SUDO is required to run this script" + abort + fi fi } declare -A RELEASE_NAME_MAP=(["retail"]="Retail" ["RP"]="Release Preview" ["WIS"]="Insider Slow" ["WIF"]="Insider Fast") RELEASE_NAME=${RELEASE_NAME_MAP[$RELEASE_TYPE]} || abort -echo -e "build: RELEASE_TYPE=$RELEASE_NAME" +echo -e "Build: RELEASE_TYPE=$RELEASE_NAME" WSA_ZIP_PATH=$DOWNLOAD_DIR/wsa-$ARCH-$RELEASE_TYPE.zip vclibs_PATH=$DOWNLOAD_DIR/vclibs-"$ARCH".appx @@ -803,10 +809,11 @@ if [ ! -d "$OUTPUT_DIR" ]; then fi if [ "$COMPRESS_OUTPUT" ]; then rm -f "${OUTPUT_DIR:?}"/"$artifact_name.7z" || abort - 7z a "$OUTPUT_DIR"/"$artifact_name.7z" "$WORK_DIR/wsa/$ARCH/" || abort + mv "$WORK_DIR/wsa/$ARCH" "$WORK_DIR/wsa/$artifact_name" + 7z a "$OUTPUT_DIR"/"$artifact_name.7z" "$WORK_DIR/wsa/$artifact_name" || abort else rm -rf "${OUTPUT_DIR:?}/${artifact_name}" || abort - mv "$WORK_DIR"/wsa/"$ARCH" "$OUTPUT_DIR/$artifact_name" || abort + cp -r "$WORK_DIR"/wsa/"$ARCH" "$OUTPUT_DIR/$artifact_name" || abort fi echo -e "done\n" diff --git a/scripts/run.sh b/scripts/run.sh index 73c93c2bd6..e2777b3a67 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -26,15 +26,22 @@ if [ ! "$BASH_VERSION" ]; then exit 1 fi cd "$(dirname "$0")" || exit 1 - +SUDO="$(which sudo 2>/dev/null)" abort() { echo "Dependencies: an error has occurred, exit" exit 1 } - +require_su() { + if test "$(whoami)" != "root"; then + if [ -z "$SUDO" ] && [ "$($SUDO whoami)" != "root" ]; then + echo "ROOT/SUDO is required to run this script" + abort + fi + fi +} echo "Checking and ensuring dependencies" check_dependencies() { - command -v whiptail >/dev/null 2>&1 || NEED_INSTALL+=("whiptail") + command -v whiptail >/dev/null 2>&1 || command -v dialog >/dev/null 2>&1 || NEED_INSTALL+=("dialog") command -v seinfo >/dev/null 2>&1 || NEED_INSTALL+=("setools") command -v lzip >/dev/null 2>&1 || NEED_INSTALL+=("lzip") command -v wine64 >/dev/null 2>&1 || NEED_INSTALL+=("wine") @@ -47,11 +54,12 @@ check_dependencies() { command -v setfattr > /dev/null 2>&1 || NEED_INSTALL+=("attr") } check_dependencies +osrel=$(sed -n '/^ID_LIKE=/s/^.*=//p' /etc/os-release); declare -A os_pm_install; # os_pm_install["/etc/redhat-release"]=yum # os_pm_install["/etc/arch-release"]=pacman # os_pm_install["/etc/gentoo-release"]=emerge -# os_pm_install["/etc/SuSE-release"]=zypp +os_pm_install["/etc/SuSE-release"]=zypper os_pm_install["/etc/debian_version"]=apt-get # os_pm_install["/etc/alpine-release"]=apk @@ -59,7 +67,7 @@ declare -A PM_UPDATE_MAP; PM_UPDATE_MAP["yum"]="check-update" PM_UPDATE_MAP["pacman"]="-Syu --noconfirm" PM_UPDATE_MAP["emerge"]="-auDN @world" -PM_UPDATE_MAP["zypp"]="update -y" +PM_UPDATE_MAP["zypper"]="ref" PM_UPDATE_MAP["apt-get"]="update" PM_UPDATE_MAP["apk"]="update" @@ -67,7 +75,7 @@ declare -A PM_INSTALL_MAP; PM_INSTALL_MAP["yum"]="install -y" PM_INSTALL_MAP["pacman"]="-S --noconfirm --needed" PM_INSTALL_MAP["emerge"]="-a" -PM_INSTALL_MAP["zypp"]="install -y" +PM_INSTALL_MAP["zypper"]="in -y" PM_INSTALL_MAP["apt-get"]="install -y" PM_INSTALL_MAP["apk"]="add" @@ -75,20 +83,33 @@ check_package_manager() { for f in "${!os_pm_install[@]}"; do if [[ -f $f ]]; then PM="${os_pm_install[$f]}" - readarray -td ' ' UPDATE_OPTION <<<"${PM_UPDATE_MAP[$PM]} "; unset 'UPDATE_OPTION[-1]'; - readarray -td ' ' INSTALL_OPTION <<<"${PM_INSTALL_MAP[$PM]} "; unset 'INSTALL_OPTION[-1]'; break fi done + if [[ "$osrel" = *"suse"* ]]; then + PM="zypper" + fi + if [ -n "$PM" ]; then + readarray -td ' ' UPDATE_OPTION <<<"${PM_UPDATE_MAP[$PM]} "; unset 'UPDATE_OPTION[-1]'; + readarray -td ' ' INSTALL_OPTION <<<"${PM_INSTALL_MAP[$PM]} "; unset 'INSTALL_OPTION[-1]'; + fi } check_package_manager if [ -n "${NEED_INSTALL[*]}" ]; then if [ -z "$PM" ]; then - echo "Unable to determine package manager: unknown distribution" + echo "Unable to determine package manager: Unsupported distros" abort else - if ! (sudo "$PM" "${UPDATE_OPTION[@]}" && sudo "$PM" "${INSTALL_OPTION[@]}" "${NEED_INSTALL[@]}") then abort; fi + if [ "$PM" = "zypper" ]; then + NEED_INSTALL=${NEED_INSTALL[*]} + readarray -td ' ' NEED_INSTALL <<<"${NEED_INSTALL//setools/setools-console} "; unset 'NEED_INSTALL[-1]'; + elif [ "$PM" = "apk" ]; then + NEED_INSTALL=${NEED_INSTALL[*]} + readarray -td ' ' NEED_INSTALL <<<"${NEED_INSTALL//p7zip-full/p7zip} "; unset 'NEED_INSTALL[-1]'; + fi + require_su + if ! ($SUDO "$PM" "${UPDATE_OPTION[@]}" && $SUDO "$PM" "${INSTALL_OPTION[@]}" "${NEED_INSTALL[@]}") then abort; fi fi fi pip list --disable-pip-version-check | grep -E "^requests " >/dev/null 2>&1 || python3 -m pip install requests @@ -97,11 +118,13 @@ winetricks list-installed | grep -E "^msxml6" >/dev/null 2>&1 || { cp -r ../wine/.cache/* ~/.cache winetricks msxml6 || abort } - +WHIPTAIL=$(command -v whiptail 2>/dev/null) +DIALOG=$(command -v dialog 2>/dev/null) +DIALOG=${WHIPTAIL:DIALOG} function Radiolist { declare -A o="$1" shift - if ! whiptail --nocancel --radiolist "${o[title]}" 0 0 0 "$@" 3>&1 1>&2 2>&3; then + if ! $DIALOG --nocancel --radiolist "${o[title]}" 0 0 0 "$@" 3>&1 1>&2 2>&3; then echo "${o[default]}" fi } @@ -109,7 +132,7 @@ function Radiolist { function YesNoBox { declare -A o="$1" shift - whiptail --title "${o[title]}" --yesno "${o[text]}" 0 0 + $DIALOG --title "${o[title]}" --yesno "${o[text]}" 0 0 } ARCH=$( From 97e5072d9f322870381346c895b69b282b837c2f Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Fri, 23 Sep 2022 16:43:50 +0800 Subject: [PATCH 03/11] Minor Fixes --- scripts/build.sh | 2 +- scripts/run.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index eaf2a8f594..8e0774da71 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -281,7 +281,7 @@ fi require_su() { if test "$(whoami)" != "root"; then - if [ -z "$SUDO" ] && [ "$($SUDO whoami)" != "root" ]; then + if [ -z "$SUDO" ] || [ "$($SUDO whoami)" != "root" ]; then echo "ROOT/SUDO is required to run this script" abort fi diff --git a/scripts/run.sh b/scripts/run.sh index e2777b3a67..3c1c2f8919 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -120,7 +120,7 @@ winetricks list-installed | grep -E "^msxml6" >/dev/null 2>&1 || { } WHIPTAIL=$(command -v whiptail 2>/dev/null) DIALOG=$(command -v dialog 2>/dev/null) -DIALOG=${WHIPTAIL:DIALOG} +DIALOG=${WHIPTAIL:-$DIALOG} function Radiolist { declare -A o="$1" shift From 0e31e695b393a714665dfedfc46171487cb815c6 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Fri, 23 Sep 2022 17:02:37 +0800 Subject: [PATCH 04/11] Preference for `whiptail` --- scripts/run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/run.sh b/scripts/run.sh index 3c1c2f8919..c4314ade03 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -41,7 +41,7 @@ require_su() { } echo "Checking and ensuring dependencies" check_dependencies() { - command -v whiptail >/dev/null 2>&1 || command -v dialog >/dev/null 2>&1 || NEED_INSTALL+=("dialog") + command -v whiptail >/dev/null 2>&1 || command -v dialog >/dev/null 2>&1 || NEED_INSTALL+=("whiptail") command -v seinfo >/dev/null 2>&1 || NEED_INSTALL+=("setools") command -v lzip >/dev/null 2>&1 || NEED_INSTALL+=("lzip") command -v wine64 >/dev/null 2>&1 || NEED_INSTALL+=("wine") @@ -104,6 +104,7 @@ if [ -n "${NEED_INSTALL[*]}" ]; then if [ "$PM" = "zypper" ]; then NEED_INSTALL=${NEED_INSTALL[*]} readarray -td ' ' NEED_INSTALL <<<"${NEED_INSTALL//setools/setools-console} "; unset 'NEED_INSTALL[-1]'; + readarray -td ' ' NEED_INSTALL <<<"${NEED_INSTALL//whiptail/dialog} "; unset 'NEED_INSTALL[-1]'; elif [ "$PM" = "apk" ]; then NEED_INSTALL=${NEED_INSTALL[*]} readarray -td ' ' NEED_INSTALL <<<"${NEED_INSTALL//p7zip-full/p7zip} "; unset 'NEED_INSTALL[-1]'; From 2564ad0387b2fa677b0c5264196c074cf38d6458 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Fri, 23 Sep 2022 17:18:19 +0800 Subject: [PATCH 05/11] Fix OpenSUSE need install package --- scripts/run.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/run.sh b/scripts/run.sh index c4314ade03..ff2bfca326 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -102,12 +102,13 @@ if [ -n "${NEED_INSTALL[*]}" ]; then abort else if [ "$PM" = "zypper" ]; then - NEED_INSTALL=${NEED_INSTALL[*]} - readarray -td ' ' NEED_INSTALL <<<"${NEED_INSTALL//setools/setools-console} "; unset 'NEED_INSTALL[-1]'; - readarray -td ' ' NEED_INSTALL <<<"${NEED_INSTALL//whiptail/dialog} "; unset 'NEED_INSTALL[-1]'; + NEED_INSTALL_FIX=${NEED_INSTALL[*]} + NEED_INSTALL_FIX=${NEED_INSTALL_FIX//setools/setools-console} >> /dev/null 2>&1 + NEED_INSTALL_FIX=${NEED_INSTALL_FIX//whiptail/dialog} >> /dev/null 2>&1 + readarray -td ' ' NEED_INSTALL <<<"$NEED_INSTALL_FIX "; unset 'NEED_INSTALL[-1]'; elif [ "$PM" = "apk" ]; then - NEED_INSTALL=${NEED_INSTALL[*]} - readarray -td ' ' NEED_INSTALL <<<"${NEED_INSTALL//p7zip-full/p7zip} "; unset 'NEED_INSTALL[-1]'; + NEED_INSTALL_FIX=${NEED_INSTALL[*]} + readarray -td ' ' NEED_INSTALL <<<"${NEED_INSTALL_FIX//p7zip-full/p7zip} "; unset 'NEED_INSTALL[-1]'; fi require_su if ! ($SUDO "$PM" "${UPDATE_OPTION[@]}" && $SUDO "$PM" "${INSTALL_OPTION[@]}" "${NEED_INSTALL[@]}") then abort; fi From ff624199665933590a06106a140ebc0d991def4b Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Fri, 23 Sep 2022 22:56:06 +0800 Subject: [PATCH 06/11] Add issue template (#134) --- .github/ISSUE_TEMPLATE/bug_report.yml | 86 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 5 ++ .github/ISSUE_TEMPLATE/feature_request.yml | 24 ++++++ 3 files changed, 115 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000000..0e7bb8643c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,86 @@ +name: Bug report/反馈 Bug +description: Report errors or unexpected behavior./反馈错误或异常行为。 +labels: [bug] +title: "[Bug] " +body: + - type: markdown + attributes: + value: | + Thanks for reporting issues of MagiskOnWSALocal! + + To make it easier for us to help you please enter detailed information below. + + 感谢给 MagiskOnWSALocal 汇报问题! + 为了使我们更好地帮助你,请提供以下信息。 + 为了防止重复汇报,标题请务必使用英文。 + - type: textarea + attributes: + label: Steps to reproduce/复现步骤 + placeholder: | + 1. + 2. + 3. + validations: + required: true + - type: textarea + attributes: + label: Expected behaviour/预期行为 + placeholder: Tell us what should happen/正常情况下应该发生什么 + validations: + required: true + - type: textarea + attributes: + label: Actual behaviour/实际行为 + placeholder: Tell us what happens instead/实际上发生了什么 + validations: + required: true + - type: input + attributes: + label: MagiskOnWSALocal commit full SHA/MagiskOnWSALocal 提交的完整哈希 + description: Don't use 'latest'. Copy and paste full commit SHA, otherwise your issue will be closed./不要填用“最新”。复制并粘贴完整 commit SHA,不然 issue 会被关闭。 + validations: + required: true + - type: textarea + attributes: + label: Linux distribution info/Linux 发行版信息 + render: shell + validations: + required: true + - type: textarea + attributes: + label: Build Parameters/构建参数 + description: The script prints the build information each time you start a build It looks like this, please copy and paste it./每次开始构建时脚本都会打印构建信息,它看起来是这样的,请复制并粘贴上来。 + render: shell + placeholder: | + COMMAND_LINE=--arch x64 --release-type retail --magisk-ver stable --gapps-brand MindTheGapps --gapps-variant pico --root-sol magisk + INFO: Architecture: x64 + INFO: Release Type: retail + INFO: Magisk Version: stable + INFO: GApps Brand: MindTheGapps + INFO: GApps Variant: pico + INFO: Root Solution: magisk + Build: RELEASE_TYPE=Retail + validations: + required: true + - type: checkboxes + id: latest + attributes: + label: Version requirement/版本要求 + options: + - label: I am using latest commit of MagiskOnWSALocal/我正在使用最新 commit 的版本 + required: true + - type: textarea + attributes: + label: Logs/日志 + description: Please copy and paste the error or submit a screenshot. Without log, the issue will be closed. /请复制粘贴错误或提交截图截图。无日志提交会被关闭。 + render: markdown + placeholder: | +
+ Details + Upload screenshots by clicking the bar on the bottom. /点击文本框底栏上传截图文件。 + + +
+ + validations: + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..3e0476632d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Ask a question/提问 + url: https://github.com/LSPosed/MagiskOnWSALocal/discussions/new?category=Q-A + about: Please ask and answer questions here./如果有任何疑问请在这里提问 diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000000..239a4d1711 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,24 @@ +--- +name: Feature request/新特性请求 +description: Suggest an idea./提出建议 +labels: [enhancement] +title: "[Feature Request] " +body: + - type: textarea + attributes: + label: Is your feature request related to a problem?/你的请求是否与某个问题相关? + placeholder: A clear and concise description of what the problem is./请清晰准确表述该问题。 + validations: + required: true + - type: textarea + attributes: + label: Describe the solution you'd like/描述你想要的解决方案 + placeholder: A clear and concise description of what you want to happen./请清晰准确描述新特性的预期行为 + validations: + required: true + - type: textarea + attributes: + label: Additional context/其他信息 + placeholder: Add any other context or screenshots about the feature request here./其他关于新特性的信息或者截图 + validations: + required: false \ No newline at end of file From d0b48437531318e30586d6cfab439f69ba42e584 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Fri, 23 Sep 2022 23:00:32 +0800 Subject: [PATCH 07/11] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 0e7bb8643c..93e872ab08 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -43,14 +43,12 @@ body: - type: textarea attributes: label: Linux distribution info/Linux 发行版信息 - render: shell validations: required: true - type: textarea attributes: label: Build Parameters/构建参数 - description: The script prints the build information each time you start a build It looks like this, please copy and paste it./每次开始构建时脚本都会打印构建信息,它看起来是这样的,请复制并粘贴上来。 - render: shell + description: The script prints the build information each time you start a build. It looks like this, please copy and paste it./每次开始构建时脚本都会打印构建信息,它看起来是这样的,请复制并粘贴上来。 placeholder: | COMMAND_LINE=--arch x64 --release-type retail --magisk-ver stable --gapps-brand MindTheGapps --gapps-variant pico --root-sol magisk INFO: Architecture: x64 @@ -73,7 +71,6 @@ body: attributes: label: Logs/日志 description: Please copy and paste the error or submit a screenshot. Without log, the issue will be closed. /请复制粘贴错误或提交截图截图。无日志提交会被关闭。 - render: markdown placeholder: |
Details @@ -81,6 +78,5 @@ body:
- validations: required: true \ No newline at end of file From 0c4d271ac545dd37360ee5d709a29eade1a1b3ae Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Fri, 23 Sep 2022 23:05:30 +0800 Subject: [PATCH 08/11] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 93e872ab08..40ba70d588 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -16,7 +16,7 @@ body: - type: textarea attributes: label: Steps to reproduce/复现步骤 - placeholder: | + value: | 1. 2. 3. @@ -71,12 +71,12 @@ body: attributes: label: Logs/日志 description: Please copy and paste the error or submit a screenshot. Without log, the issue will be closed. /请复制粘贴错误或提交截图截图。无日志提交会被关闭。 - placeholder: | + value: |
Details - Upload screenshots by clicking the bar on the bottom. /点击文本框底栏上传截图文件。 +
validations: - required: true \ No newline at end of file + required: true From 00dfe283b63a25ad27e8f84fe1b74d9a151c6815 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Fri, 23 Sep 2022 23:07:17 +0800 Subject: [PATCH 09/11] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 40ba70d588..8e7a301136 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -70,7 +70,7 @@ body: - type: textarea attributes: label: Logs/日志 - description: Please copy and paste the error or submit a screenshot. Without log, the issue will be closed. /请复制粘贴错误或提交截图截图。无日志提交会被关闭。 + description: Please copy and paste the error or submit a screenshot. Without log, the issue will be closed. /请复制粘贴错误或提交截图。无日志提交会被关闭。 value: |
Details From 0c650f9f15ecc26c60d97c2283ab681fae7e4b46 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sat, 24 Sep 2022 01:38:03 +0800 Subject: [PATCH 10/11] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 8e7a301136..ad3c06b5c6 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -45,6 +45,12 @@ body: label: Linux distribution info/Linux 发行版信息 validations: required: true + - type: input + attributes: + label: Windows version/Windows 版本 + placeholder: 10.0.22000.978 + validations: + required: true - type: textarea attributes: label: Build Parameters/构建参数 From 105a778eeec1b643d28c2617f89459d11ca6fd64 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sat, 24 Sep 2022 15:42:37 +0800 Subject: [PATCH 11/11] Manually grant executable privileges to linker Even though executable permissions have been added to the version control, considering that some people don't use it, they directly download the zip archive and unzip it, which by default has no executable permissions Close #121 --- scripts/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build.sh b/scripts/build.sh index 8e0774da71..79b50d7fd4 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -376,6 +376,7 @@ if [ -f "$MAGISK_PATH" ]; then $SUDO patchelf --replace-needed libc.so "../linker/$HOST_ARCH/libc.so" "$WORK_DIR"/magisk/magiskpolicy || abort $SUDO patchelf --replace-needed libm.so "../linker/$HOST_ARCH/libm.so" "$WORK_DIR"/magisk/magiskpolicy || abort $SUDO patchelf --replace-needed libdl.so "../linker/$HOST_ARCH/libdl.so" "$WORK_DIR"/magisk/magiskpolicy || abort + chmod +x "../linker/$HOST_ARCH/linker64" || abort $SUDO patchelf --set-interpreter "../linker/$HOST_ARCH/linker64" "$WORK_DIR"/magisk/magiskpolicy || abort chmod +x "$WORK_DIR"/magisk/magiskpolicy || abort elif [ -z "${CUSTOM_MAGISK+x}" ]; then