From fe57d3dffe89c129fd8b03568eab86f87a1b5ba6 Mon Sep 17 00:00:00 2001 From: donovan6000 Date: Mon, 26 Dec 2022 05:23:45 -0800 Subject: [PATCH] Initial commit --- .gitignore | 1 + LICENSE | 21 ++++ README.md | 14 +++ build.sh | 297 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 333 insertions(+) create mode 100644 .gitignore create mode 100755 LICENSE create mode 100755 README.md create mode 100755 build.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea9bc26 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +MWC Wallet Standalone v*.html diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..6d7451c --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Nicolas Flamel + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100755 index 0000000..7d9caa5 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# MWC Wallet Standalone + +### Description +Standalone version of the MimbleWimble Coin web wallet, [mwcwallet.com](https://mwcwallet.com), that consists of just a single HTML file. + +### Building +Run the following commands to build this. +``` +wget "https://github.com/NicolasFlamel1/MWC-Wallet-Standalone/archive/refs/heads/master.zip" +unzip "./master" +cd "./MWC-Wallet-Standalone-master" +"./build.sh" +``` +This will create the HTML file, `MWC Wallet Standalone.html`. diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..95c3f2b --- /dev/null +++ b/build.sh @@ -0,0 +1,297 @@ +# Copy files +rm -rf "./temp" +mkdir "./temp" +wget "https://github.com/NicolasFlamel1/mwcwallet.com/archive/refs/heads/master.zip" +unzip "./master" +cp -r "./mwcwallet.com-master/public_html/." "./temp/" +chmod 777 -R "./temp/" +wget "https://github.com/NicolasFlamel1/Secp256k1-zkp-WASM-Wrapper/releases/download/v0.0.25/Secp256k1-zkp-0.0.25.zip" +unzip "./Secp256k1-zkp-0.0.25.zip" +mv "./asmjs/secp256k1-zkp.js" "./temp/scripts/secp256k1-zkp-0.0.25.js" +wget "https://github.com/NicolasFlamel1/BLAKE2b-WASM-Wrapper/releases/download/v0.0.2/BLAKE2b-0.0.2.zip" +unzip "./BLAKE2b-0.0.2.zip" +mv "./asmjs/BLAKE2b.js" "./temp/scripts/BLAKE2b-0.0.2.js" +wget "https://github.com/NicolasFlamel1/Ed25519-WASM-Wrapper/releases/download/v0.0.22/Ed25519-0.0.22.zip" +unzip "./Ed25519-0.0.22.zip" +mv "./asmjs/Ed25519.js" "./temp/scripts/Ed25519-0.0.22.js" +wget "https://github.com/NicolasFlamel1/X25519-WASM-Wrapper/releases/download/v0.0.22/X25519-0.0.22.zip" +unzip "./X25519-0.0.22.zip" +mv "./asmjs/X25519.js" "./temp/scripts/X25519-0.0.22.js" +wget "https://github.com/NicolasFlamel1/SMAZ-WASM-Wrapper/releases/download/v0.0.30/SMAZ-0.0.30.zip" +unzip "./SMAZ-0.0.30.zip" +mv "./asmjs/SMAZ.js" "./temp/scripts/SMAZ-0.0.30.js" + +# Get version +VERSION=$(grep -Po "(?<=VERSION_NUMBER = \").*(?=\";)" "./temp/backend/common.php") + +# Compile index.html +SERVER_NAME="mwcwallet.com" HTTPS="on" NO_FILE_VERSIONS="" NO_FILE_CHECKSUMS="" NO_MINIFIED_FILES="" HTTP_SERVER_ADDRESS="https://mwcwallet.com" TOR_SERVER_ADDRESS="http://mwcwalletmiq3gdkmfbqlytxunvlxyli4m6zrqozk7xjc353ewqb6bad.onion" php "./mwcwallet.com-master/public_html/index.html" > "./temp/index.html" +sed -i "//d" "./temp/index.html" +sed -i "//d" "./temp/index.html" +sed -i "//d" "./temp/index.html" +sed -i "//d" "./temp/index.html" + +# Compile styles +SERVER_NAME="mwcwallet.com" HTTPS="on" NO_FILE_VERSIONS="" NO_FILE_CHECKSUMS="" NO_MINIFIED_FILES="" HTTP_SERVER_ADDRESS="https://mwcwallet.com" TOR_SERVER_ADDRESS="http://mwcwalletmiq3gdkmfbqlytxunvlxyli4m6zrqozk7xjc353ewqb6bad.onion" php "./mwcwallet.com-master/public_html/fonts/btc/btc.css" > "./temp/fonts/btc/btc.css" +SERVER_NAME="mwcwallet.com" HTTPS="on" NO_FILE_VERSIONS="" NO_FILE_CHECKSUMS="" NO_MINIFIED_FILES="" HTTP_SERVER_ADDRESS="https://mwcwallet.com" TOR_SERVER_ADDRESS="http://mwcwalletmiq3gdkmfbqlytxunvlxyli4m6zrqozk7xjc353ewqb6bad.onion" php "./mwcwallet.com-master/public_html/fonts/eth/eth.css" > "./temp/fonts/eth/eth.css" +SERVER_NAME="mwcwallet.com" HTTPS="on" NO_FILE_VERSIONS="" NO_FILE_CHECKSUMS="" NO_MINIFIED_FILES="" HTTP_SERVER_ADDRESS="https://mwcwallet.com" TOR_SERVER_ADDRESS="http://mwcwalletmiq3gdkmfbqlytxunvlxyli4m6zrqozk7xjc353ewqb6bad.onion" php "./mwcwallet.com-master/public_html/fonts/font_awesome/font_awesome.css" > "./temp/fonts/font_awesome/font_awesome.css" +SERVER_NAME="mwcwallet.com" HTTPS="on" NO_FILE_VERSIONS="" NO_FILE_CHECKSUMS="" NO_MINIFIED_FILES="" HTTP_SERVER_ADDRESS="https://mwcwallet.com" TOR_SERVER_ADDRESS="http://mwcwalletmiq3gdkmfbqlytxunvlxyli4m6zrqozk7xjc353ewqb6bad.onion" php "./mwcwallet.com-master/public_html/fonts/grin/grin.css" > "./temp/fonts/grin/grin.css" +SERVER_NAME="mwcwallet.com" HTTPS="on" NO_FILE_VERSIONS="" NO_FILE_CHECKSUMS="" NO_MINIFIED_FILES="" HTTP_SERVER_ADDRESS="https://mwcwallet.com" TOR_SERVER_ADDRESS="http://mwcwalletmiq3gdkmfbqlytxunvlxyli4m6zrqozk7xjc353ewqb6bad.onion" php "./mwcwallet.com-master/public_html/fonts/mwc/mwc.css" > "./temp/fonts/mwc/mwc.css" +SERVER_NAME="mwcwallet.com" HTTPS="on" NO_FILE_VERSIONS="" NO_FILE_CHECKSUMS="" NO_MINIFIED_FILES="" HTTP_SERVER_ADDRESS="https://mwcwallet.com" TOR_SERVER_ADDRESS="http://mwcwalletmiq3gdkmfbqlytxunvlxyli4m6zrqozk7xjc353ewqb6bad.onion" php "./mwcwallet.com-master/public_html/fonts/open_sans/open_sans.css" > "./temp/fonts/open_sans/open_sans.css" +SERVER_NAME="mwcwallet.com" HTTPS="on" NO_FILE_VERSIONS="" NO_FILE_CHECKSUMS="" NO_MINIFIED_FILES="" HTTP_SERVER_ADDRESS="https://mwcwallet.com" TOR_SERVER_ADDRESS="http://mwcwalletmiq3gdkmfbqlytxunvlxyli4m6zrqozk7xjc353ewqb6bad.onion" php "./mwcwallet.com-master/public_html/styles/section.css" > "./temp/styles/section.css" +SERVER_NAME="mwcwallet.com" HTTPS="on" NO_FILE_VERSIONS="" NO_FILE_CHECKSUMS="" NO_MINIFIED_FILES="" HTTP_SERVER_ADDRESS="https://mwcwallet.com" TOR_SERVER_ADDRESS="http://mwcwalletmiq3gdkmfbqlytxunvlxyli4m6zrqozk7xjc353ewqb6bad.onion" php "./mwcwallet.com-master/public_html/styles/unlocked.css" > "./temp/styles/unlocked.css" + +# Compile scripts +SERVER_NAME="mwcwallet.com" HTTPS="on" NO_FILE_VERSIONS="" NO_FILE_CHECKSUMS="" NO_MINIFIED_FILES="" HTTP_SERVER_ADDRESS="https://mwcwallet.com" TOR_SERVER_ADDRESS="http://mwcwalletmiq3gdkmfbqlytxunvlxyli4m6zrqozk7xjc353ewqb6bad.onion" php "./mwcwallet.com-master/public_html/scripts/camera_worker.js" > "./temp/scripts/camera_worker.js" +SERVER_NAME="mwcwallet.com" HTTPS="on" NO_FILE_VERSIONS="" NO_FILE_CHECKSUMS="" NO_MINIFIED_FILES="" HTTP_SERVER_ADDRESS="https://mwcwallet.com" TOR_SERVER_ADDRESS="http://mwcwalletmiq3gdkmfbqlytxunvlxyli4m6zrqozk7xjc353ewqb6bad.onion" php "./mwcwallet.com-master/public_html/scripts/output_worker.js" > "./temp/scripts/output_worker.js" +SERVER_NAME="mwcwallet.com" HTTPS="on" NO_FILE_VERSIONS="" NO_FILE_CHECKSUMS="" NO_MINIFIED_FILES="" HTTP_SERVER_ADDRESS="https://mwcwallet.com" TOR_SERVER_ADDRESS="http://mwcwalletmiq3gdkmfbqlytxunvlxyli4m6zrqozk7xjc353ewqb6bad.onion" php "./mwcwallet.com-master/public_html/scripts/slate_worker.js" > "./temp/scripts/slate_worker.js" + +# Inline images +sed -i "s#href=\"\./images/mask_images/mask_image\.svg\"#href=\"data:image/svg+xml;base64,`cat "./mwcwallet.com-master/public_html/images/mask_images/mask_image.svg" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#src=\"\./images/countries/america\.svg\"#src=\"data:image/svg+xml;base64,`cat "./mwcwallet.com-master/public_html/images/countries/america.svg" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#src=\"\./images/app_icons/app_icon\.svg\"#src=\"data:image/svg+xml;base64,`cat "./mwcwallet.com-master/public_html/images/app_icons/app_icon.svg" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/touch_icons/touch_icon-57x57\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/touch_icons/touch_icon-57x57.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/touch_icons/touch_icon-76x76\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/touch_icons/touch_icon-76x76.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/touch_icons/touch_icon-114x114\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/touch_icons/touch_icon-114x114.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/touch_icons/touch_icon-120x120\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/touch_icons/touch_icon-120x120.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/touch_icons/touch_icon-144x144\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/touch_icons/touch_icon-144x144.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/touch_icons/touch_icon-152x152\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/touch_icons/touch_icon-152x152.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/touch_icons/touch_icon-167x167\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/touch_icons/touch_icon-167x167.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/touch_icons/touch_icon-180x180\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/touch_icons/touch_icon-180x180.png" | openssl base64 -A`\"#g" "./temp/index.html" +sed -i "s#href=\"\./favicon\.ico\"#href=\"data:image/x-icon;base64,`cat "./mwcwallet.com-master/public_html/favicon.ico" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/app_icons/app_icon-16x16\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/app_icons/app_icon-16x16.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/app_icons/app_icon-24x24\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/app_icons/app_icon-24x24.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/app_icons/app_icon-32x32\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/app_icons/app_icon-32x32.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/app_icons/app_icon-48x48\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/app_icons/app_icon-48x48.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/app_icons/app_icon-64x64\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/app_icons/app_icon-64x64.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/app_icons/app_icon-114x114\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/app_icons/app_icon-114x114.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/app_icons/app_icon-120x120\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/app_icons/app_icon-120x120.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/app_icons/app_icon-128x128\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/app_icons/app_icon-128x128.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/app_icons/app_icon-144x144\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/app_icons/app_icon-144x144.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/app_icons/app_icon-152x152\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/app_icons/app_icon-152x152.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/app_icons/app_icon-180x180\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/app_icons/app_icon-180x180.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/app_icons/app_icon-192x192\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/app_icons/app_icon-192x192.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/app_icons/app_icon-256x256\.png\"#href=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/app_icons/app_icon-256x256.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#href=\"\./images/app_icons/app_icon\.svg\"#href=\"data:image/svg+xml;base64,`cat "./mwcwallet.com-master/public_html/images/app_icons/app_icon.svg" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#content=\"\./images/tile_images/tile_image-70x70\.png\"#content=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/tile_images/tile_image-70x70.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#content=\"\./images/tile_images/tile_image-150x150\.png\"#content=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/tile_images/tile_image-150x150.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#content=\"\./images/tile_images/tile_image-310x150\.png\"#content=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/tile_images/tile_image-310x150.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#content=\"\./images/tile_images/tile_image-310x310\.png\"#content=\"data:image/png;base64,`cat "./mwcwallet.com-master/public_html/images/tile_images/tile_image-310x310.png" | openssl base64 -A`\"#" "./temp/index.html" +sed -i "s#url(\"\./images/logo_big\.svg\")#url(\"data:image/svg+xml;base64,`cat "./mwcwallet.com-master/public_html/images/logo_big.svg" | openssl base64 -A`\")#" "./temp/index.html" +sed -i "s#url(\"\./images/logo_small\.svg\")#url(\"data:image/svg+xml;base64,`cat "./mwcwallet.com-master/public_html/images/logo_small.svg" | openssl base64 -A`\")#" "./temp/index.html" +sed -i "s#url(\"\.\./images/circle\.svg\")#url(\"data:image/svg+xml;base64,`cat "./mwcwallet.com-master/public_html/images/circle.svg" | openssl base64 -A`\")#" "./temp/styles/section.css" +sed -i "s#url(\"\.\./images/down_arrow\.svg\")#url(\"data:image/svg+xml;base64,`cat "./mwcwallet.com-master/public_html/images/down_arrow.svg" | openssl base64 -A`\")#" "./temp/styles/section.css" +sed -i "s#url(\"\.\./images/logo_small\.svg\")#url(\"data:image/svg+xml;base64,`cat "./mwcwallet.com-master/public_html/images/logo_small.svg" | openssl base64 -A`\")#" "./temp/styles/unlocked.css" +sed -i "s#url(\"\.\./images/whale\.svg\")#url(\"data:image/svg+xml;base64,`cat "./mwcwallet.com-master/public_html/images/whale.svg" | openssl base64 -A`\")#" "./temp/styles/unlocked.css" +sed -i "s#url(\"\.\./images/ledger\.svg\")#url(\"data:image/svg+xml;base64,`cat "./mwcwallet.com-master/public_html/images/ledger.svg" | openssl base64 -A`\")#" "./temp/styles/unlocked.css" +sed -i "s#url(\"\.\./images/usb\.svg\")#url(\"data:image/svg+xml;base64,`cat "./mwcwallet.com-master/public_html/images/usb.svg" | openssl base64 -A`\")#" "./temp/styles/unlocked.css" +sed -i "s#url(\"\.\./images/bluetooth\.svg\")#url(\"data:image/svg+xml;base64,`cat "./mwcwallet.com-master/public_html/images/bluetooth.svg" | openssl base64 -A`\")#" "./temp/styles/unlocked.css" +sed -i "s#\"\.\" + getResource(StartupImagesCreator\.LOGO_FILE_LOCATION)#\"data:image/svg+xml;base64,`cat "./mwcwallet.com-master/public_html/images/logo_small.svg" | openssl base64 -A`\"#" "./temp/scripts/startup_images_creator.js" + +# Inline shaders +sed -i "s#\"\.\" + getResource(Logo\.VERTEX_SHADER_FILE_LOCATION)#\"data:text/plain;base64,`cat "./mwcwallet.com-master/public_html/shaders/logo.vert" | openssl base64 -A`\"#" "./temp/scripts/logo.js" +sed -i "s#\"\.\" + getResource(Logo\.FRAGMENT_SHADER_FILE_LOCATION)#\"data:text/plain;base64,`cat "./mwcwallet.com-master/public_html/shaders/logo.frag" | openssl base64 -A`\"#" "./temp/scripts/logo.js" + +# Inline models +sed -i -f - "./temp/scripts/logo.js" << EOF +s#"\." + getResource(Logo\.MODEL_FILE_LOCATION)#"data:application/json;base64,`cat "./mwcwallet.com-master/public_html/models/mwc.json" | openssl base64 -A`"# +EOF + +# Inline fonts +sed -i "s#url(\"\.\./\.\./fonts/btc/btc\.woff\")#url(\"data:font/woff;base64,`cat "./mwcwallet.com-master/public_html/fonts/btc/btc.woff" | openssl base64 -A`\")#" "./temp/fonts/btc/btc.css" +sed -i "s#url(\"\.\./\.\./fonts/btc/btc\.woff2\")#url(\"data:font/woff2;base64,`cat "./mwcwallet.com-master/public_html/fonts/btc/btc.woff2" | openssl base64 -A`\")#" "./temp/fonts/btc/btc.css" +sed -i "s#url(\"\.\./\.\./fonts/eth/eth\.woff\")#url(\"data:font/woff;base64,`cat "./mwcwallet.com-master/public_html/fonts/eth/eth.woff" | openssl base64 -A`\")#" "./temp/fonts/eth/eth.css" +sed -i "s#url(\"\.\./\.\./fonts/eth/eth\.woff2\")#url(\"data:font/woff2;base64,`cat "./mwcwallet.com-master/public_html/fonts/eth/eth.woff2" | openssl base64 -A`\")#" "./temp/fonts/eth/eth.css" +sed -i "s#url(\"\.\./\.\./fonts/font_awesome/font_awesome-5\.15\.4\.woff\")#url(\"data:font/woff;base64,`cat "./mwcwallet.com-master/public_html/fonts/font_awesome/font_awesome-5.15.4.woff" | openssl base64 -A`\")#" "./temp/fonts/font_awesome/font_awesome.css" +sed -i "s#url(\"\.\./\.\./fonts/font_awesome/font_awesome-5\.15\.4\.woff2\")#url(\"data:font/woff2;base64,`cat "./mwcwallet.com-master/public_html/fonts/font_awesome/font_awesome-5.15.4.woff2" | openssl base64 -A`\")#" "./temp/fonts/font_awesome/font_awesome.css" +sed -i -f - "./temp/fonts/font_awesome/font_awesome.css" << EOF +s#url("\.\./\.\./fonts/font_awesome/font_awesome_solid-5\.15\.4\.woff")#url("data:font/woff;base64,`cat "./mwcwallet.com-master/public_html/fonts/font_awesome/font_awesome_solid-5.15.4.woff" | openssl base64 -A`")# +EOF +sed -i "s#url(\"\.\./\.\./fonts/font_awesome/font_awesome_solid-5\.15\.4\.woff2\")#url(\"data:font/woff2;base64,`cat "./mwcwallet.com-master/public_html/fonts/font_awesome/font_awesome_solid-5.15.4.woff2" | openssl base64 -A`\")#" "./temp/fonts/font_awesome/font_awesome.css" +sed -i "s#url(\"\.\./\.\./fonts/grin/grin\.woff\")#url(\"data:font/woff;base64,`cat "./mwcwallet.com-master/public_html/fonts/grin/grin.woff" | openssl base64 -A`\")#" "./temp/fonts/grin/grin.css" +sed -i "s#url(\"\.\./\.\./fonts/grin/grin\.woff2\")#url(\"data:font/woff2;base64,`cat "./mwcwallet.com-master/public_html/fonts/grin/grin.woff2" | openssl base64 -A`\")#" "./temp/fonts/grin/grin.css" +sed -i "s#url(\"\.\./\.\./fonts/mwc/mwc\.woff\")#url(\"data:font/woff;base64,`cat "./mwcwallet.com-master/public_html/fonts/mwc/mwc.woff" | openssl base64 -A`\")#" "./temp/fonts/mwc/mwc.css" +sed -i "s#url(\"\.\./\.\./fonts/mwc/mwc\.woff2\")#url(\"data:font/woff2;base64,`cat "./mwcwallet.com-master/public_html/fonts/mwc/mwc.woff2" | openssl base64 -A`\")#" "./temp/fonts/mwc/mwc.css" +sed -i "s#url(\"\.\./\.\./fonts/open_sans/open_sans-1\.10\.woff\")#url(\"data:font/woff;base64,`cat "./mwcwallet.com-master/public_html/fonts/open_sans/open_sans-1.10.woff" | openssl base64 -A`\")#" "./temp/fonts/open_sans/open_sans.css" +sed -i "s#url(\"\.\./\.\./fonts/open_sans/open_sans-1\.10\.woff2\")#url(\"data:font/woff2;base64,`cat "./mwcwallet.com-master/public_html/fonts/open_sans/open_sans-1.10.woff2" | openssl base64 -A`\")#" "./temp/fonts/open_sans/open_sans.css" + +# Inline styles +sed -i -e "//r ./temp/fonts/open_sans/open_sans.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/fonts/font_awesome/font_awesome.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/fonts/mwc/mwc.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/fonts/btc/btc.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/fonts/eth/eth.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/fonts/grin/grin.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/normalize.css-8.0.1.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/common.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/tetris.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/logo.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/application.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/unlocked.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/sections.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/section.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/settings_section.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/about_section.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/transaction_section.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/account_section.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/wallet_section.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/send_payment_section.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/log_section.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/message.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/install_app.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/cookie_acceptance.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/maintenance_notification.css" -e "//i " -e "//d" "./temp/index.html" +sed -i -e "//r ./temp/styles/language.css" -e "//i " -e "//d" "./temp/index.html" + +# Inline web workers +sed -i -e "/importScripts(\"\.\.\/scripts\/BLAKE2b-0\.0\.2\.js\");/r ./temp/scripts/BLAKE2b-0.0.2.js" -e "/importScripts(\"\.\.\/scripts\/BLAKE2b-0\.0\.2\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/Ed25519-0\.0\.22\.js\");/r ./temp/scripts/Ed25519-0.0.22.js" -e "/importScripts(\"\.\.\/scripts\/Ed25519-0\.0\.22\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/js-sha3-0\.8\.0\.js\");/r ./temp/scripts/js-sha3-0.8.0.js" -e "/importScripts(\"\.\.\/scripts\/js-sha3-0\.8\.0\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/js-sha256-0\.9\.0\.js\");/r ./temp/scripts/js-sha256-0.9.0.js" -e "/importScripts(\"\.\.\/scripts\/js-sha256-0\.9\.0\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/secp256k1-zkp-0\.0\.25\.js\");/r ./temp/scripts/secp256k1-zkp-0.0.25.js" -e "/importScripts(\"\.\.\/scripts\/secp256k1-zkp-0\.0\.25\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/SMAZ-0\.0\.30\.js\");/r ./temp/scripts/SMAZ-0.0.30.js" -e "/importScripts(\"\.\.\/scripts\/SMAZ-0\.0\.30\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/hi-base32-0\.5\.1\.js\");/r ./temp/scripts/hi-base32-0.5.1.js" -e "/importScripts(\"\.\.\/scripts\/hi-base32-0\.5\.1\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/bech32-2\.0\.0\.js\");/r ./temp/scripts/bech32-2.0.0.js" -e "/importScripts(\"\.\.\/scripts\/bech32-2\.0\.0\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/base58\.js\");/r ./temp/scripts/base58.js" -e "/importScripts(\"\.\.\/scripts\/base58\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/bignumber.js-9\.0\.2\.js\");/r ./temp/scripts/bignumber.js-9.0.2.js" -e "/importScripts(\"\.\.\/scripts\/bignumber.js-9\.0\.2\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/common\.js\");/r ./temp/scripts/common.js" -e "/importScripts(\"\.\.\/scripts\/common\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/consensus\.js\");/r ./temp/scripts/consensus.js" -e "/importScripts(\"\.\.\/scripts\/consensus\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/bit_reader\.js\");/r ./temp/scripts/bit_reader.js" -e "/importScripts(\"\.\.\/scripts\/bit_reader\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/bit_writer\.js\");/r ./temp/scripts/bit_writer.js" -e "/importScripts(\"\.\.\/scripts\/bit_writer\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/crypto\.js\");/r ./temp/scripts/crypto.js" -e "/importScripts(\"\.\.\/scripts\/crypto\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/tor\.js\");/r ./temp/scripts/tor.js" -e "/importScripts(\"\.\.\/scripts\/tor\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/mqs\.js\");/r ./temp/scripts/mqs.js" -e "/importScripts(\"\.\.\/scripts\/mqs\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/slatepack\.js\");/r ./temp/scripts/slatepack.js" -e "/importScripts(\"\.\.\/scripts\/slatepack\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/uuid\.js\");/r ./temp/scripts/uuid.js" -e "/importScripts(\"\.\.\/scripts\/uuid\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/hash\.js\");/r ./temp/scripts/hash.js" -e "/importScripts(\"\.\.\/scripts\/hash\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/slate\.js\");/r ./temp/scripts/slate.js" -e "/importScripts(\"\.\.\/scripts\/slate\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/slate_participant\.js\");/r ./temp/scripts/slate_participant.js" -e "/importScripts(\"\.\.\/scripts\/slate_participant\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/slate_input\.js\");/r ./temp/scripts/slate_input.js" -e "/importScripts(\"\.\.\/scripts\/slate_input\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/slate_output\.js\");/r ./temp/scripts/slate_output.js" -e "/importScripts(\"\.\.\/scripts\/slate_output\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/slate_kernel\.js\");/r ./temp/scripts/slate_kernel.js" -e "/importScripts(\"\.\.\/scripts\/slate_kernel\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/identifier\.js\");/r ./temp/scripts/identifier.js" -e "/importScripts(\"\.\.\/scripts\/identifier\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/output\.js\");/r ./temp/scripts/output.js" -e "/importScripts(\"\.\.\/scripts\/output\.js\");/d" "./temp/scripts/slate_worker.js" +sed -i "/" "./temp/index.html" +sed -i "s/Slate\.WORKER_FILE_LOCATION/window[\"URL\"].createObjectURL(new Blob([document\.getElementById(\"slate_worker\")[\"textContent\"]], {\"type\": \"application\/javascript\"}))/" "./temp/scripts/slate.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/BLAKE2b-0\.0\.2\.js\");/r ./temp/scripts/BLAKE2b-0.0.2.js" -e "/importScripts(\"\.\.\/scripts\/BLAKE2b-0\.0\.2\.js\");/d" "./temp/scripts/output_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/secp256k1-zkp-0\.0\.25\.js\");/r ./temp/scripts/secp256k1-zkp-0.0.25.js" -e "/importScripts(\"\.\.\/scripts\/secp256k1-zkp-0\.0\.25\.js\");/d" "./temp/scripts/output_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/bignumber.js-9\.0\.2\.js\");/r ./temp/scripts/bignumber.js-9.0.2.js" -e "/importScripts(\"\.\.\/scripts\/bignumber.js-9\.0\.2\.js\");/d" "./temp/scripts/output_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/common\.js\");/r ./temp/scripts/common.js" -e "/importScripts(\"\.\.\/scripts\/common\.js\");/d" "./temp/scripts/output_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/crypto\.js\");/r ./temp/scripts/crypto.js" -e "/importScripts(\"\.\.\/scripts\/crypto\.js\");/d" "./temp/scripts/output_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/identifier\.js\");/r ./temp/scripts/identifier.js" -e "/importScripts(\"\.\.\/scripts\/identifier\.js\");/d" "./temp/scripts/output_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/proof_builder\.js\");/r ./temp/scripts/proof_builder.js" -e "/importScripts(\"\.\.\/scripts\/proof_builder\.js\");/d" "./temp/scripts/output_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/legacy_proof_builder\.js\");/r ./temp/scripts/legacy_proof_builder.js" -e "/importScripts(\"\.\.\/scripts\/legacy_proof_builder\.js\");/d" "./temp/scripts/output_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/new_proof_builder\.js\");/r ./temp/scripts/new_proof_builder.js" -e "/importScripts(\"\.\.\/scripts\/new_proof_builder\.js\");/d" "./temp/scripts/output_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/view_proof_builder\.js\");/r ./temp/scripts/view_proof_builder.js" -e "/importScripts(\"\.\.\/scripts\/view_proof_builder\.js\");/d" "./temp/scripts/output_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/output\.js\");/r ./temp/scripts/output.js" -e "/importScripts(\"\.\.\/scripts\/output\.js\");/d" "./temp/scripts/output_worker.js" +sed -i "/" "./temp/index.html" +sed -i "s/Output\.WORKER_FILE_LOCATION/window[\"URL\"].createObjectURL(new Blob([document\.getElementById(\"output_worker\")[\"textContent\"]], {\"type\": \"application\/javascript\"}))/" "./temp/scripts/output.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/camera\.js\");/r ./temp/scripts/camera.js" -e "/importScripts(\"\.\.\/scripts\/camera\.js\");/d" "./temp/scripts/camera_worker.js" +sed -i -e "/importScripts(\"\.\.\/scripts\/jsQR-1\.4\.0\.js\");/r ./temp/scripts/jsQR-1.4.0.js" -e "/importScripts(\"\.\.\/scripts\/jsQR-1\.4\.0\.js\");/d" "./temp/scripts/camera_worker.js" +sed -i "/" "./temp/index.html" +sed -i "s/Camera\.WORKER_FILE_LOCATION/window[\"URL\"].createObjectURL(new Blob([document\.getElementById(\"camera_worker\")[\"textContent\"]], {\"type\": \"application\/javascript\"}))/" "./temp/scripts/camera.js" + +# Inline scripts +sed -i -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/" -e "/