olli991 / mib-std2-pq-zr-toolbox

Toolbox for MIB STD2 PQ/ZR Technisat/Preh units.
https://discord.gg/YU3rjatWjT
MIT License
467 stars 77 forks source link

Preserve original GEM before updating? #442

Open sdimovv opened 2 days ago

sdimovv commented 2 days ago

Describe the bug My unit is MST2_EU_SE_ZR_P0241T (2 SD cards). It is completely stock and has GEM 3.5. Since that version is incompatible with the MIB2 Toolbox, it will be replaced with GEM 4.11 during the installation.

I would like to preserve a copy of the old GEM jar for educational and research purposes.

To Reproduce N/A

Expected behavior MIB2 Toolbox installer dumps the original GEM jar on the SD card.

Screenshots N/A

Firmware (please complete the following information):

Additional context

I've looked at the 1.4.2 release. I was thinking of making the following changes to it:

diff --git a/install.sh b/install.sh
index d74caa0..a2967b6 100644
--- a/install.sh
+++ b/install.sh
@@ -95,6 +95,7 @@ if [ -d "$DESTINATION$ESD_FOLDER" ]; then
    #GEM_SIZE=$(ls -la "$DESTINATION/tsd/hmi/HMI/jar/GEM.jar" | awk '{print $5}' 2>/dev/null)
    #if [[ "$GEM_SIZE" = "187047" || "$GEM_SIZE" = "187234" || "$GEM_SIZE" = "242383" ]]; then
        echo "Updating GEM to version 4.11..."
+       cp -fv $DESTINATION/tsd/hmi/HMI/jar/GEM.jar $VOLUME/dump/GEM.jar
        if [[ -e "$VOLUME/toolbox/gem/cpu/onlineservices/1/default/tsd/bin/system/GEM.jar" ]]; then
            cp -fv $VOLUME/toolbox/gem/cpu/onlineservices/1/default/tsd/bin/system/GEM.jar $DESTINATION/tsd/hmi/HMI/jar/GEM.jar
            echo "GEM update is finished."
diff --git a/sigs_disk.txt b/sigs_disk.txt
index 538ead5..a1504f3 100644
--- a/sigs_disk.txt
+++ b/sigs_disk.txt
@@ -92,7 +92,7 @@
 437cec05b11ee16258eaa69d11d1ee3a  ./cpu/onlineservices/1/default/tsd/etc/persistence/esd/scripts/copy_skins.sh
 437cec05b11ee16258eaa69d11d1ee3a  ./toolbox/gem/cpu/onlineservices/1/default/tsd/etc/persistence/esd/scripts/copy_skins.sh
 442a2abd3a6f0330c0f47a0c3a7d7dd9  ./tools/compress-mcf.py
-4468d7700a52a8fb4d6cc32e4fd0e84e  ./install.sh
+2551d4ccdd9ea290655ef4d287d57620  ./install.sh
 45179ee42a7a8c0f91f3ac1399b323ef  ./cpu/onlineservices/1/default/tsd/etc/persistence/esd/scripts/dump_mapcfg.sh
 45179ee42a7a8c0f91f3ac1399b323ef  ./toolbox/gem/cpu/onlineservices/1/default/tsd/etc/persistence/esd/scripts/dump_mapcfg.sh
 454b1c8baf22eaa00dfaa7a567ba8ee1  ./toolbox/devesd/VW_V01_Nav_position_main.esd
diff --git a/sigs_sd.txt b/sigs_sd.txt
index 3afc125..c6f6076 100644
--- a/sigs_sd.txt
+++ b/sigs_sd.txt
@@ -91,7 +91,7 @@
 437cec05b11ee16258eaa69d11d1ee3a  ./cpu/onlineservices/1/default/tsd/etc/persistence/esd/scripts/copy_skins.sh
 437cec05b11ee16258eaa69d11d1ee3a  ./toolbox/gem/cpu/onlineservices/1/default/tsd/etc/persistence/esd/scripts/copy_skins.sh
 442a2abd3a6f0330c0f47a0c3a7d7dd9  ./tools/compress-mcf.py
-4468d7700a52a8fb4d6cc32e4fd0e84e  ./install.sh
+2551d4ccdd9ea290655ef4d287d57620  ./install.sh
 45179ee42a7a8c0f91f3ac1399b323ef  ./cpu/onlineservices/1/default/tsd/etc/persistence/esd/scripts/dump_mapcfg.sh
 45179ee42a7a8c0f91f3ac1399b323ef  ./toolbox/gem/cpu/onlineservices/1/default/tsd/etc/persistence/esd/scripts/dump_mapcfg.sh
 454b1c8baf22eaa00dfaa7a567ba8ee1  ./toolbox/devesd/VW_V01_Nav_position_main.esd

However, I have no way of testing if this will work before I run it on the unit.

EDIT: Another way would be to just dump the stock eMMC, however, as far as I know (do correct me if I am wrong), the only way to do this without toolbox being installed is to read it directly from the eMMC, which requires disassembling the unit and is something I would like to avoid.

olli991 commented 2 days ago

There is no need to preserve this file. If you want to go back to stock just reinstall your firmware. It's also only used in development. No real user would ever go into the GEM besides using the toolbox.

olli991 commented 2 days ago

All gems are also backwards compatible so it's like you want to preserver windows 98 because you PC came with it 😅

sdimovv commented 2 days ago

Thanks for the quick response.

Yes, I am aware I do not need to preserve it. I want to.

Theoretically speaking, would the changes in the patch I provided above work as expected and dump the original GEM onto the SD?

I am not familiar with the update-from-sd process, so I'm just speculating on the changes needed.

Thanks.

sdimovv commented 2 days ago

If you want to go back to stock just reinstall your firmware.

I cannot find a dump with the same firmware as mine, this is partially the reason why I want to dump it.

olli991 commented 2 days ago

Just use one from the same train. So every 02xx would be fine

sdimovv commented 2 days ago

The only 2xx i have found is an update to 253, but I've looked at the files it contains and it doesn't come with GEM. I suppose that's because 253 ships with 3.5 as well.

I've also googled for the jar itself but I'm unable to find it. As far as I can tell getting it from the dump is the only way to get it.

olli991 commented 2 days ago

The gem is in the firmware. It will be replaced when installing.

I'll not assist further on storing or saving a useless file which don't need to be restored and can be restored with firmware installation.