Search This thread
# FYT-Firmware-Workbench

Scripts intended to mount the FYT UIS7862 firmware, make modifications and reassemble it back
They can retrieve the firmware from specified location and after modification, they can put the firmware into another specified location

Files:

1-) config.ini = A file to setup parameters, paths for the original firmware and patched firmware, temp directory to work with firmware files and mount point to edit the firmware

2-) import_original.sh = Retrieves the files .0 .1 .2 and .3 from the location specified in config.ini

3-) import_patched.sh = Retrieves the same files that 'import_original.sh' but from the patched location specified in the config.ini (normally a firmware that you've already patched before)

4-) unpack.sh = Unpack the imported firmware and create the mount moints (as specified in the config.ini file) to work with the firmware

5-) tweaker.sh = Allows change Locale, Language, Country and allows enabling ADB and OTG (if hardware supports it)

6-) repack.sh = Unmount the modified firmware from the mount points, delete the mount points, assembly the new ZIP file and move it to the patched directory as specified in config.ini

7-) clean_local.sh = This script will unmount the firmware and delete it, it will also delete temporary files. as its name says, it cleans the dir !



N'joy it !
 

Attachments

  • FYT-Firmware-Workbench.zip
    43.9 MB · Views: 189
Last edited:

surfer63

Senior Member
May 4, 2010
4,374
1,935
Zwolle
hvdwolf.github.io
Did you already try to flash it? I seed that you sign with the test keys but does that now work on the 7862?
On the previous architectures the recovery did not allow self signed zips.
 

surfer63

Senior Member
May 4, 2010
4,374
1,935
Zwolle
hvdwolf.github.io
Hi,

I tried your tools. Nice work.

I first did the "import_original.sh" and then the "unpack.sh". I did use this on a RPi4 running Debian Linux. All my Linux machines are currently RPi boxes and I use my headless server RPi4 for most stuff I do myself on images. (Next to that I have a Chromebook running Linux as well, but that one doesn't allow me to mount images in the linux sandbox.)

In the unpack.sh I get errors after brotli on the resizing of all the images:
Bash:
**********************************************
 
 Processing 'system' image ...
 
BROTLI -- Handling system.new.dat.br...
Converting system.new.dat file into system.img file
When tring the "Converting .." is where it goes wrong without error message. The sdat2img is using "#!/usr/bin/env python" which, on an python3 only system gives "/usr/bin/env: ‘python’: No such file or directory"
When I change the call to "python3 sdat2img.py <etcetera>" it works. It might be better to use something like
Code:
if [ `which python` ]; then
    ./tools/sdat2img.py
elif [ `which python3`]; then
    python3 ./tools/sdat2img.py
else
    printf "\n\nNo python found!!\n\n"
    exit 1
fi
Otherwise your created dat file is 0 bytes (simply an echo of 0 bytes to a new file), then giving corrupt empty images of 128 MB when trying to resize them.

And about the resizing/shrinking of the images: Why do you do that?
Simply leave the img as is and mount it read-write, not read-only.
Please use
Code:
mount -t ext4 -o loop,rw $unzippedPath$i.img $MOUNTPOINT/$i
and then simply copy (as root) your stuff in or make the modifications directly (as root). After unmounting you can immediately repack and brotli-compress it again. No extra intermediate steps necessary.

****
And some other remarks (actually a bit of nit-picking, please don't feel offended. I think you did a great job):
You use and pack a 64bit jdk with it, which is of course very convenient in most cases but doesn't work on my ARM raspberry pi.
I would put something in the shell script like
Bash:
echo "Singning '${FIRMWAREZIPFILENAME}' file..."
if [ -n `which java` ]; then
    # Not found. Use packed version and hope it is a 64bit system
    tools/jdk64/bin/java -jar tools/SignApkv2.jar <etcetera>
else
    # Use system version
    java -jar <etcetera>
fi

You also use
Bash:
echo " "
echo "READY !!!."
echo " "
Why not use
Code:
printf "\n\nREADY !!!\n\n"
 
Don't feel offended at all fellow, that's normal you're improving the scripts so suit your needs, that's normal, and your code (above) seems much more adapted than mine, I packed a 64bit java 8 cause java 11 does not sign the ZIP, (or at least I didn't reach the sign correctly)

Y have a giltab at home with that projects (FYT, TS10 etc....) y you want to participate and pull-request your changes, os help me improving that scripts, you're welcome and I'll send you the link via PM
 
  • Like
Reactions: hanichl

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    # FYT-Firmware-Workbench

    Scripts intended to mount the FYT UIS7862 firmware, make modifications and reassemble it back
    They can retrieve the firmware from specified location and after modification, they can put the firmware into another specified location

    Files:

    1-) config.ini = A file to setup parameters, paths for the original firmware and patched firmware, temp directory to work with firmware files and mount point to edit the firmware

    2-) import_original.sh = Retrieves the files .0 .1 .2 and .3 from the location specified in config.ini

    3-) import_patched.sh = Retrieves the same files that 'import_original.sh' but from the patched location specified in the config.ini (normally a firmware that you've already patched before)

    4-) unpack.sh = Unpack the imported firmware and create the mount moints (as specified in the config.ini file) to work with the firmware

    5-) tweaker.sh = Allows change Locale, Language, Country and allows enabling ADB and OTG (if hardware supports it)

    6-) repack.sh = Unmount the modified firmware from the mount points, delete the mount points, assembly the new ZIP file and move it to the patched directory as specified in config.ini

    7-) clean_local.sh = This script will unmount the firmware and delete it, it will also delete temporary files. as its name says, it cleans the dir !



    N'joy it !
    1
    Yes it works well, of course I flashed a modified 6315_1 befor make this post. You can trust the scripts, take a look at the tweaker.sh who allow you to modify some settings, Locale,Region, Coutry, and more to come !
    1
    Don't feel offended at all fellow, that's normal you're improving the scripts so suit your needs, that's normal, and your code (above) seems much more adapted than mine, I packed a 64bit java 8 cause java 11 does not sign the ZIP, (or at least I didn't reach the sign correctly)

    Y have a giltab at home with that projects (FYT, TS10 etc....) y you want to participate and pull-request your changes, os help me improving that scripts, you're welcome and I'll send you the link via PM
    1
    Will add and arm64 java 8 and detect the proc architecture by scripts to select the right java