diff --git a/#GAPPS/dummyfile b/#GAPPS/dummyfile deleted file mode 100644 index 2995a4d..0000000 --- a/#GAPPS/dummyfile +++ /dev/null @@ -1 +0,0 @@ -dummy \ No newline at end of file diff --git a/#IMAGES/dummyfile b/#IMAGES/dummyfile deleted file mode 100644 index 2995a4d..0000000 --- a/#IMAGES/dummyfile +++ /dev/null @@ -1 +0,0 @@ -dummy \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3448ff2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +gapps/ +images/ diff --git a/README.md b/README.md index 927f58c..93a3102 100644 --- a/README.md +++ b/README.md @@ -46,39 +46,16 @@ For Ubuntu ``` git clone https://github.com/ADeltaX/WSAGAScript -cd WSAGAScript/\#IMAGES -mv /mnt/path-to-extracted-msix/*.img . -cd ../\#GAPPS -cp /mnt/path-to-downloaded-gapps/*.zip . +cd WSAGAScript/ +mv /mnt/path-to-extracted-msix/*.img images/ +cp /mnt/path-to-downloaded-gapps/*.zip gapps/ ``` paths in wsl follow the same as windows after /mnt/ its just the drive letter then folder structure as normal. For example /mnt/c/users would be the c:\users folder ### Edit scripts -Set executable permission for the scripts - -``` -cd .. -sudo chmod +x extract_gapps_pico.sh -sudo chmod +x extend_and_mount_images.sh -sudo chmod +x apply.sh -sudo chmod +x unmount_images.sh -``` - -Change the root directory in VARIABLES.sh - -``` -pwd -``` - -(take note of the output) - -``` -nano VARIABLES.sh -``` - -replace the root variable with the output of pwd up until and including the WSAGAScript folder +If needed, you can change the variables used in the scripts in the `VARIABLES` file. The defaults should work fine. **Debian WSL users need to create an mtab symlink:** ``` @@ -97,8 +74,7 @@ sudo ./unmount_images.sh ### Copy the edited images ``` -cd \#IMAGES -cp *.img /mnt/path-to-extracted-msix/ +cp images/*.img /mnt/path-to-extracted-msix/ ``` ### Register the edited WSA diff --git a/VARIABLES b/VARIABLES new file mode 100644 index 0000000..3365bb0 --- /dev/null +++ b/VARIABLES @@ -0,0 +1,16 @@ +# Modify your variables here to corretly reference your directory and subdir + +Root="$(dirname "$(realpath "$0")")" + +MiscRoot="$Root/misc" + +GAppsRoot="$Root/gapps" +GAppsOutputFolder="$GAppsRoot/output" +GAppsExtractFolder="$GAppsRoot/extract" +GAppsTmpFolder="$GAppsRoot/tmp" + +ImagesRoot="$Root/images" +MountPointSystem="/mnt/system" + +InstallPartition="$MountPointSystem" +InstallDir="$InstallPartition/system" diff --git a/VARIABLES.sh b/VARIABLES.sh deleted file mode 100644 index c9d9278..0000000 --- a/VARIABLES.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Modify your variables here to corretly reference your directory and subdir - -Root="/mnt/c/GAppsWSA" - -MiscRoot="$Root/misc" - -GAppsRoot="$Root/#GAPPS" -GAppsOutputFolder="$GAppsRoot/output" -GAppsExtractFolder="$GAppsRoot/extract" -GAppsTmpFolder="$GAppsRoot/tmp" - -ImagesRoot="$Root/#IMAGES" -MountPointProduct="/mnt/product" -MountPointSystemExt="/mnt/system_ext" -MountPointSystem="/mnt/system" -MountPointVendor="/mnt/vendor" - -InstallPartition="/mnt/system" -InstallDir="$InstallPartition/system" \ No newline at end of file diff --git a/apply.sh b/apply.sh old mode 100644 new mode 100755 index 09a125d..0975a21 --- a/apply.sh +++ b/apply.sh @@ -1,21 +1,17 @@ #!/bin/bash -. ./VARIABLES.sh +. ./VARIABLES echo "Copying build.prop for each image" -cp "$MiscRoot/prop/build_system_ext.prop" /mnt/system_ext/build.prop -cp "$MiscRoot/prop/build_system.prop" /mnt/system/build.prop -cp "$MiscRoot/prop/build_system.prop" /mnt/system/system/build.prop -cp "$MiscRoot/prop/build_product.prop" /mnt/product/build.prop -cp "$MiscRoot/prop/build_vendor.prop" /mnt/vendor/build.prop -cp "$MiscRoot/prop/build_vendor_odm.prop" /mnt/vendor/odm/etc/vendor.prop +cp "$MiscRoot/prop/build_system_ext.prop" "$MountPointSystem/system_ext/build.prop" +cp "$MiscRoot/prop/build_system.prop" "$MountPointSystem/build.prop" +cp "$MiscRoot/prop/build_system.prop" "$MountPointSystem/system/build.prop" +cp "$MiscRoot/prop/build_product.prop" "$MountPointSystem/product/build.prop" +cp "$MiscRoot/prop/build_vendor.prop" "$MountPointSystem/vendor/build.prop" +cp "$MiscRoot/prop/build_vendor_odm.prop" "$MountPointSystem/vendor/odm/etc/vendor.prop" echo "Copying GApps files to system..." -cp -f -a $GAppsOutputFolder/app/* $InstallDir/app -cp -f -a $GAppsOutputFolder/etc/* $InstallDir/etc -cp -f -a $GAppsOutputFolder/overlay/* $InstallDir/overlay -cp -f -a $GAppsOutputFolder/priv-app/* $InstallDir/priv-app -cp -f -a $GAppsOutputFolder/framework/* $InstallDir/framework +cp -Ra $GAppsOutputFolder/* $InstallDir/ echo "Applying root file ownership" find $InstallDir/app -exec chown root:root {} &>/dev/null \; diff --git a/extend_and_mount_images.sh b/extend_and_mount_images.sh old mode 100644 new mode 100755 index f5a8b15..c84fc02 --- a/extend_and_mount_images.sh +++ b/extend_and_mount_images.sh @@ -1,6 +1,6 @@ #!/bin/bash -. ./VARIABLES.sh +. ./VARIABLES echo "chk product.img" e2fsck -f $ImagesRoot/product.img @@ -12,7 +12,7 @@ echo "chk system.img" e2fsck -f $ImagesRoot/system.img echo "Resizing system.img" -resize2fs $ImagesRoot/system.img 1280M +resize2fs $ImagesRoot/system.img 1536M echo "chk system_ext.img" e2fsck -f $ImagesRoot/system_ext.img @@ -26,28 +26,19 @@ e2fsck -f $ImagesRoot/vendor.img echo "Resizing vendor.img" resize2fs $ImagesRoot/vendor.img 300M -echo "Creating mount point for product" -mkdir -p $MountPointProduct - -echo "Creating mount point for system_ext" -mkdir -p $MountPointSystemExt - echo "Creating mount point for system" mkdir -p $MountPointSystem -echo "Creating mount point for vendor" -mkdir -p $MountPointVendor +echo "Mounting system" +mount -o rw $ImagesRoot/system.img $MountPointSystem echo "Mounting product" -mount -o rw $ImagesRoot/product.img $MountPointProduct +mount -o rw $ImagesRoot/product.img $MountPointSystem/product echo "Mounting system_ext" -mount -o rw $ImagesRoot/system_ext.img $MountPointSystemExt - -echo "Mounting system" -mount -o rw $ImagesRoot/system.img $MountPointSystem +mount -o rw $ImagesRoot/system_ext.img $MountPointSystem/system_ext echo "Mounting vendor" -mount -o rw $ImagesRoot/vendor.img $MountPointVendor +mount -o rw $ImagesRoot/vendor.img $MountPointSystem/vendor echo "!! Images mounted !!" \ No newline at end of file diff --git a/extract_gapps_pico.sh b/extract_gapps.sh old mode 100644 new mode 100755 similarity index 98% rename from extract_gapps_pico.sh rename to extract_gapps.sh index af0c195..128d5c9 --- a/extract_gapps_pico.sh +++ b/extract_gapps.sh @@ -1,6 +1,6 @@ #!/bin/bash -. ./VARIABLES.sh +. ./VARIABLES rm -rf $GAppsOutputFolder rm -rf $GAppsTmpFolder diff --git a/gapps/.gitkeep b/gapps/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/images/.gitkeep b/images/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/unmount_images.sh b/unmount_images.sh old mode 100644 new mode 100755 index 7b0ef6d..6387c7f --- a/unmount_images.sh +++ b/unmount_images.sh @@ -1,17 +1,17 @@ #!/bin/bash -. ./VARIABLES.sh +. ./VARIABLES echo "Unmounting product.img" -umount $MountPointProduct +umount $MountPointSystem/product echo "Unmounting system_ext.img" -umount $MountPointSystemExt +umount $MountPointSystem/system_ext + +echo "Unmounting vendor.img" +umount $MountPointSystem/vendor echo "Unmounting system.img" umount $MountPointSystem -echo "Unmounting vendor.img" -umount $MountPointVendor - echo "!! Unmounting completed !!" \ No newline at end of file