From 3d35059aba47aa6c932415c7b3bf6330df3a8aeb Mon Sep 17 00:00:00 2001 From: matt <10769515+whosmatt@users.noreply.github.com> Date: Wed, 2 Aug 2023 16:15:25 +0200 Subject: [PATCH] added support for UV-K6, K5(8) and UV-5R Plus --- README.md | 2 +- index.html | 8 ++++++-- js/init.js | 10 ++++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) 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