diff --git a/README.md b/README.md index ea612a3..37114b5 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Introduction -Web-based client-side Quansheng UV-K5 firmware patcher written in Javascript and HTML using [Bootstrap 4.6.0](https://getbootstrap.com/docs/4.6/getting-started/introduction/), jQuery and parts of the [SB Admin 2 Theme](https://startbootstrap.com/theme/sb-admin-2). +Web-based client-side Quansheng firmware patcher written in Javascript and HTML using [Bootstrap 4.6.0](https://getbootstrap.com/docs/4.6/getting-started/introduction/), jQuery and parts of the [SB Admin 2 Theme](https://startbootstrap.com/theme/sb-admin-2). It is based on the discoveries by the many contributors in the [uvmod-kitchen](https://github.com/amnemonic/Quansheng_UV-K5_Firmware/tree/main/uvmod_kitchen) and implements the same functionality in a modular and flexible javascript structure. Visitors can generate a patched firmware image by selecting the desired patches. Patches modify the firmware on a binary level and can accept user input to customize variables. A custom base image can be supplied to allow support for mods that are compiled and linked directly into the firmware. diff --git a/index.html b/index.html index b4a606b..5ec45cd 100644 --- a/index.html +++ b/index.html @@ -8,8 +8,7 @@ - + @@ -140,6 +139,11 @@ Using stock v26 firmware +
diff --git a/js/init.js b/js/init.js index 4c37750..6987023 100644 --- a/js/init.js +++ b/js/init.js @@ -70,9 +70,15 @@ function patch() { .then((encoded_firmware) => { const unpacked_firmware = unpack(encoded_firmware); - const versionInfoString = new TextDecoder().decode(versionInfo.subarray(0, versionInfo.indexOf(0))); - log(`Detected firmware version: ${versionInfoString}`); + log(`Detected firmware version: ${new TextDecoder().decode(versionInfo.subarray(0, versionInfo.indexOf(0)))}`); + + // Adjust firmware version to allow cross flashing + const newVersionChar = document.getElementById("firmwareVersionSelect").value; + const newVersionCharCode = newVersionChar.charCodeAt(0); + versionInfo[0] = newVersionCharCode; + log(`Modified firmware version: ${new TextDecoder().decode(versionInfo.subarray(0, versionInfo.indexOf(0)))}`); + // Apply mods to unpacked firmware const patched_firmware = applyMods(unpacked_firmware); // Check size