diff --git a/.gitattributes b/.gitattributes index 457285960..a6b2af8d1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10,8 +10,7 @@ *.cmd text eol=crlf # Denote all files that are truly binary and should not be modified. -busybox binary -futility binary +binaries/** binary *.jar binary *.exe binary *.apk binary diff --git a/.gitignore b/.gitignore index 424a4d902..8f1074217 100644 --- a/.gitignore +++ b/.gitignore @@ -2,15 +2,17 @@ obj/ libs/ *.zip -# Generated binaries +# Copied binaries zip_static/arm/* zip_static/arm64/* zip_static/x86/* zip_static/x64/* +zip_static/chromeos/* uninstaller/arm/* uninstaller/arm64/* uninstaller/x86/* uninstaller/x64/* +uninstaller/chromeos/* ziptools/zipadjust # Generated scripts @@ -20,6 +22,3 @@ zip_static/common/magisksu.sh zip_static/common/init.magisk.rc zip_static/common/custom_ramdisk_patch.sh zip_static/META-INF/com/google/android/update-binary - -# Leave all busybox! -!busybox diff --git a/zip_static/arm/busybox b/binaries/busybox-arm similarity index 100% rename from zip_static/arm/busybox rename to binaries/busybox-arm diff --git a/zip_static/arm64/busybox b/binaries/busybox-arm64 similarity index 100% rename from zip_static/arm64/busybox rename to binaries/busybox-arm64 diff --git a/zip_static/x64/busybox b/binaries/busybox-x64 similarity index 100% rename from zip_static/x64/busybox rename to binaries/busybox-x64 diff --git a/zip_static/x86/busybox b/binaries/busybox-x86 similarity index 100% rename from zip_static/x86/busybox rename to binaries/busybox-x86 diff --git a/uninstaller/chromeos/futility b/binaries/chromeos/futility similarity index 100% rename from uninstaller/chromeos/futility rename to binaries/chromeos/futility diff --git a/uninstaller/chromeos/kernel.keyblock b/binaries/chromeos/kernel.keyblock similarity index 100% rename from uninstaller/chromeos/kernel.keyblock rename to binaries/chromeos/kernel.keyblock diff --git a/uninstaller/chromeos/kernel_data_key.vbprivk b/binaries/chromeos/kernel_data_key.vbprivk similarity index 100% rename from uninstaller/chromeos/kernel_data_key.vbprivk rename to binaries/chromeos/kernel_data_key.vbprivk diff --git a/build.cmd b/build.cmd index 2f2c58c6f..952ff6ef2 100644 --- a/build.cmd +++ b/build.cmd @@ -69,10 +69,11 @@ EXIT /B %ERRORLEVEL% ECHO * Cleaning up ECHO ************************ CALL ndk-build clean - forfiles /P zip_static\arm /C "cmd /C IF NOT @file == \"busybox\" DEL @file" - forfiles /P zip_static\arm64 /C "cmd /C IF NOT @file == \"busybox\" DEL @file" - forfiles /P zip_static\x86 /C "cmd /C IF NOT @file == \"busybox\" DEL @file" - forfiles /P zip_static\x64 /C "cmd /C IF NOT @file == \"busybox\" DEL @file" + 2>NUL RMDIR /S /Q zip_static\arm + 2>NUL RMDIR /S /Q zip_static\arm64 + 2>NUL RMDIR /S /Q zip_static\x86 + 2>NUL RMDIR /S /Q zip_static\x64 + 2>NUL RMDIR /S /Q zip_static\chromeos 2>NUL DEL zip_static\META-INF\com\google\android\update-binary 2>NUL DEL zip_static\common\custom_ramdisk_patch.sh 2>NUL DEL zip_static\common\magisksu.sh @@ -83,6 +84,7 @@ EXIT /B %ERRORLEVEL% 2>NUL RMDIR /S /Q uninstaller\arm64 2>NUL RMDIR /S /Q uninstaller\x86 2>NUL RMDIR /S /Q uninstaller\x64 + 2>NUL RMDIR /S /Q uninstaller\chromeos EXIT /B 0 :zip @@ -100,11 +102,19 @@ EXIT /B %ERRORLEVEL% powershell.exe -nologo -noprofile -command "(gc -Raw scripts\flash_script.sh) -replace 'MAGISK_VERSION_STUB', 'Magisk v%~1 Boot Image Patcher' | sc zip_static\META-INF\com\google\android\update-binary" powershell.exe -nologo -noprofile -command "(gc -Raw scripts\magic_mask.sh) -replace 'MAGISK_VERSION_STUB', 'setprop magisk.version \"%~1\"' | sc zip_static\common\magic_mask.sh" ECHO ************************ - ECHO * Zipping Magisk v%~1 + ECHO * Copying Files ECHO ************************ COPY /Y scripts\custom_ramdisk_patch.sh zip_static\common\custom_ramdisk_patch.sh COPY /Y scripts\magisksu.sh zip_static\common\magisksu.sh COPY /Y scripts\init.magisk.rc zip_static\common\init.magisk.rc + COPY /Y binaries\busybox-arm zip_static\arm\busybox + COPY /Y binaries\busybox-arm64 zip_static\arm64\busybox + COPY /Y binaries\busybox-x86 zip_static\x86\busybox + COPY /Y binaries\busybox-x64 zip_static\x64\busybox + CALL :mkcp binaries\chromeos zip_static\chromeos + ECHO ************************ + ECHO * Zipping Magisk v%~1 + ECHO ************************ CD zip_static 2>NUL DEL "..\Magisk-v%~1.zip" ..\ziptools\win_bin\zip "..\Magisk-v%~1.zip" -r . @@ -117,9 +127,17 @@ EXIT /B %ERRORLEVEL% IF NOT EXIST "uninstaller\arm\bootimgtools" CALL :error "Missing binaries! Please run '%me% build' before zipping!" IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL% ECHO ************************ - ECHO * Zipping uninstaller + ECHO * Copying Files ECHO ************************ CALL :mkcp scripts\magisk_uninstaller.sh uninstaller\common + COPY /Y binaries\busybox-arm uninstaller\arm\busybox + COPY /Y binaries\busybox-arm64 uninstaller\arm64\busybox + COPY /Y binaries\busybox-x86 uninstaller\x86\busybox + COPY /Y binaries\busybox-x64 uninstaller\x64\busybox + CALL :mkcp binaries\chromeos uninstaller\chromeos + ECHO ************************ + ECHO * Zipping uninstaller + ECHO ************************ FOR /F "tokens=* USEBACKQ" %%F IN (`ziptools\win_bin\date "+%%Y%%m%%d"`) DO (set timestamp=%%F) CD uninstaller 2>NUL DEL "../Magisk-uninstaller-%timestamp%.zip" diff --git a/build.sh b/build.sh index f6b4647b9..bb655bab0 100755 --- a/build.sh +++ b/build.sh @@ -20,10 +20,11 @@ cleanup() { echo "* Cleaning up" echo "************************" ndk-build clean 2>/dev/null - ls zip_static/arm/* | grep -v "busybox" | xargs rm -rfv - ls zip_static/arm64/* | grep -v "busybox" | xargs rm -rfv - ls zip_static/x86/* | grep -v "busybox" | xargs rm -rfv - ls zip_static/x64/* | grep -v "busybox" | xargs rm -rfv + rm -rfv zip_static/arm + rm -rfv zip_static/arm64 + rm -rfv zip_static/x86 + rm -rfv zip_static/x64 + rm -rfv zip_static/chromeos rm -rfv zip_static/META-INF/com/google/android/update-binary rm -rfv zip_static/common/custom_ramdisk_patch.sh rm -rfv zip_static/common/magisksu.sh @@ -34,6 +35,7 @@ cleanup() { rm -rfv uninstaller/arm64 rm -rfv uninstaller/x86 rm -rfv uninstaller/x64 + rm -rfv uninstaller/chromeos } mkcp() { @@ -73,11 +75,19 @@ zip_package() { sed "s/MAGISK_VERSION_STUB/Magisk v$1 Boot Image Patcher/g" scripts/flash_script.sh > zip_static/META-INF/com/google/android/update-binary sed "s/MAGISK_VERSION_STUB/setprop magisk.version \"$1\"/g" scripts/magic_mask.sh > zip_static/common/magic_mask.sh echo "************************" - echo "* Zipping Magisk v$1" + echo "* Copying files" echo "************************" cp -afv scripts/custom_ramdisk_patch.sh zip_static/common/custom_ramdisk_patch.sh cp -afv scripts/magisksu.sh zip_static/common/magisksu.sh cp -afv scripts/init.magisk.rc zip_static/common/init.magisk.rc + cp -afv binaries/busybox-arm zip_static/arm/busybox + cp -afv binaries/busybox-arm64 zip_static/arm64/busybox + cp -afv binaries/busybox-x86 zip_static/x86/busybox + cp -afv binaries/busybox-x64 zip_static/x64/busybox + cp -afv binaries/chromeos/. zip_static/chromeos + echo "************************" + echo "* Zipping Magisk v$1" + echo "************************" cd zip_static find . -type f -exec chmod 644 {} \; find . -type d -exec chmod 755 {} \; @@ -90,6 +100,15 @@ zip_package() { zip_uninstaller() { [ ! -f "uninstaller/arm/bootimgtools" ] && error "Missing binaries!! Please run '$0 build' before zipping" echo "************************" + echo "* Copying files" + echo "************************" + mkcp scripts/magisk_uninstaller.sh uninstaller/common + cp -afv binaries/busybox-arm uninstaller/arm/busybox + cp -afv binaries/busybox-arm64 uninstaller/arm64/busybox + cp -afv binaries/busybox-x86 uninstaller/x86/busybox + cp -afv binaries/busybox-x64 uninstaller/x64/busybox + cp -afv binaries/chromeos/. zip_static/chromeos + echo "************************" echo "* Zipping uninstaller" echo "************************" mkcp scripts/magisk_uninstaller.sh uninstaller/common diff --git a/zip_static/chromeos/futility b/zip_static/chromeos/futility deleted file mode 100644 index 28304a1bc..000000000 Binary files a/zip_static/chromeos/futility and /dev/null differ diff --git a/zip_static/chromeos/kernel.keyblock b/zip_static/chromeos/kernel.keyblock deleted file mode 100644 index 9740be4e6..000000000 Binary files a/zip_static/chromeos/kernel.keyblock and /dev/null differ diff --git a/zip_static/chromeos/kernel_data_key.vbprivk b/zip_static/chromeos/kernel_data_key.vbprivk deleted file mode 100644 index 8d392fb29..000000000 Binary files a/zip_static/chromeos/kernel_data_key.vbprivk and /dev/null differ