Last active
November 5, 2019 14:28
-
-
Save hsur/eac576e62e1a72626b4d510aa4f3acf7 to your computer and use it in GitHub Desktop.
Build quote_colors.xpi for TB60
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
::: Build quote_colors-0.3.1-tb+sm.xpi (TB60 supported) | |
::: author: hsur | |
::: Distributed under the BSD-2-Clause License | |
::::::::::::::::::: | |
::: download files | |
::::::::::::::::::: | |
curl -s https://addons.thunderbird.net/user-media/addons/_attachments/170/quote_colors-0.3-tb+sm.xpi?filehash=sha256%3Ad539dd527da4925c1ed930b54ffd0e9e7a70e71fb83de2bf37f1b3ce8e4d19cd --output quote_colors-0.3-tb+sm.xpi | |
curl -s https://frippery.org/files/busybox/busybox.exe --output busybox.exe | |
curl -s https://gist.githubusercontent.com/hsur/9e2dafc099bd21dd1eaf7b0534e57c43/raw/c262e3cb178ec403aa3f3d076639a9e97f1e8877/quote_colors-0.3-tb+sm.diff --output quote_colors-0.3-tb+sm.diff | |
curl -s http://k-takata.o.oo7.jp/mysoft/undll204.zip --output undll204.zip | |
curl -s http://www.madobe.net/archiver/lib/7z922002.zip --output 7z922002.zip | |
::::::::::::::::::: | |
::: check sha256 | |
::::::::::::::::::: | |
call :CHECKHASH quote_colors-0.3-tb+sm.xpi e57ecbaf25989f1555bf5f0cc6b3cda08bc3981fc7b0908ffa9d02720918ab7b | |
if %ERRORLEVEL% NEQ 0 goto SIGERROR | |
call :CHECKHASH busybox.exe f89ff320ce50e58ea8859d9acc59d70907ae31d53a2c870e2680a7391faef575 | |
if %ERRORLEVEL% NEQ 0 goto SIGERROR | |
call :CHECKHASH quote_colors-0.3-tb+sm.diff a8313bc284558fb2744095fe930a6f92a96acea51bf15b8949b73dd69956a675 | |
if %ERRORLEVEL% NEQ 0 goto SIGERROR | |
call :CHECKHASH undll204.zip 1b7607de139e63bdaddd6f3e651abefad783a82581a4b602a5c2d8208216b765 | |
if %ERRORLEVEL% NEQ 0 goto SIGERROR | |
call :CHECKHASH 7z922002.zip a78a17da73df8790a93a3ed9664788301e5dc8a9dff9d45cda7faa900135d7b7 | |
if %ERRORLEVEL% NEQ 0 goto SIGERROR | |
::::::::::::::::::: | |
::: build xpi | |
::::::::::::::::::: | |
:::unzip | |
busybox.exe unzip -o 7z922002.zip 7-zip32.dll | |
busybox.exe unzip -o undll204.zip undll.exe undll.ini | |
busybox.exe mv undll.exe 7-zip32.exe | |
:::extract xpi | |
busybox.exe mkdir quote_colors-0.3-tb+sm | |
busybox.exe unzip -d "quote_colors-0.3-tb+sm" "quote_colors-0.3-tb+sm.xpi" | |
:::extract jar | |
busybox.exe mkdir "quote_colors-0.3-tb+sm\chrome\quotecolors" | |
busybox.exe unzip -d "quote_colors-0.3-tb+sm\chrome\quotecolors" "quote_colors-0.3-tb+sm\chrome\quotecolors.jar" | |
::: patch | |
busybox.exe patch -p0 < "quote_colors-0.3-tb+sm.diff" | |
::: create jar | |
7-zip32.exe a -tzip ..\quotecolors.zip quote_colors-0.3-tb+sm\chrome\quotecolors\ -r "*" | |
busybox.exe rm -r "quote_colors-0.3-tb+sm\chrome\quotecolors" | |
busybox.exe rm "quote_colors-0.3-tb+sm\chrome\quotecolors.jar" | |
busybox.exe mv "quote_colors-0.3-tb+sm\chrome\quotecolors.zip" "quote_colors-0.3-tb+sm\chrome\quotecolors.jar" | |
::: create xpi | |
7-zip32.exe a -tzip ..\quote_colors-0.3.1-tb+sm.zip quote_colors-0.3-tb+sm\ -r "*" | |
busybox.exe mv "quote_colors-0.3.1-tb+sm.zip" "quote_colors-0.3.1-tb+sm.xpi" | |
busybox.exe rm -r "quote_colors-0.3-tb+sm" | |
echo completed! | |
pause | |
exit /b | |
:SIGERROR | |
echo hash does not match! | |
pause | |
exit /b 1 | |
::: Based on https://stackoverflow.com/questions/42170361/verifying-md5-hashes-in-batch | |
:CHECKHASH | |
call :SHA256SUM %1 | |
if "%2" equ "%hash%" ( | |
echo %hash% %1 : OK | |
) else ( | |
echo %hash% %1 : NG | |
exit /b 1 | |
) | |
exit /b | |
:SHA256SUM | |
set "hash=" | |
for /f "skip=1 tokens=* delims=" %%# in ('certutil -hashfile "%1" SHA256') do ( | |
if not defined hash ( | |
for %%Z in (%%#) do set "hash=%%Z" | |
) | |
) | |
exit /b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have applied the patch, QuoteColrs installs on TB 60.6.1 64 bit, but I can't see the Settings Button.