Software Development FYT Firmware Workbench 2.0

Search This thread

ahmed123

Senior Member
Jan 14, 2006
78
4
check this one please

Wow, awesome that was super fast. Was expecting it next week at some point. The person doing this for me is out of town til Friday so will give this a try on Friday and report back.

Out of curiosity, did you discover what’s different in this January firmware compared to the already working October firmware that was throwing them errors on your tools?

Thank you 🙏
 
Wow, awesome that was super fast. Was expecting it next week at some point. The person doing this for me is out of town til Friday so will give this a try on Friday and report back.

Out of curiosity, did you discover what’s different in this January firmware compared to the already working October firmware that was throwing them errors on your tools?

Thank you 🙏
No, really didn't check for diffs, only check if unpack / repack works, please advice if you flash with new firmware, if flash fails due to signature please advice and I'll update the signature procedure (Maybe Teyes has its own signature method ?)
 
  • Like
Reactions: ahmed123

ahmed123

Senior Member
Jan 14, 2006
78
4
No, really didn't check for diffs, only check if unpack / repack works, please advice if you flash with new firmware, if flash fails due to signature please advice and I'll update the signature procedure (Maybe Teyes has its own signature method ?)

Sure, I will let you know on Friday once I can get it tested :) Thank you.
 

cryptyk

Senior Member
Jul 2, 2007
881
4,001
Hey @mar
No, really didn't check for diffs, only check if unpack / repack works, please advice if you flash with new firmware, if flash fails due to signature please advice and I'll update the signature procedure (Maybe Teyes has its own signature method ?)
Hey @mariodantas
Trying this out, but it looks like there's a java version now included in the tools which doesn't work on my system. I have a different set of system libraries.

Can you let me know what version of the jdk is required for this to run to I can install that version on my system? Specifically looking at the line in repack.sh:
Code:
tools/jdk64/bin/java -jar tools/SignApkv2.jar -w -v tools/testkey.x509.pem tools/testkey.pk8 $TMPFOLDER/${FIRMWAREZIPFILENAME}_unsigned $TMPFOLDER/$FIRMWAREZIPFILENAME

If I use your bundled version of java, I get:
Code:
./java: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./java)

If I remove the path from that line and use my own installed verison of java, I get:
Code:
Exception in thread "main" java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder

Thanks!
 

surfer63

Senior Member
May 4, 2010
4,746
2,269
Zwolle
github.com
Hey @mar

Hey @mariodantas
Trying this out, but it looks like there's a java version now included in the tools which doesn't work on my system. I have a different set of system libraries.

Can you let me know what version of the jdk is required for this to run to I can install that version on my system? Specifically looking at the line in repack.sh:
Code:
tools/jdk64/bin/java -jar tools/SignApkv2.jar -w -v tools/testkey.x509.pem tools/testkey.pk8 $TMPFOLDER/${FIRMWAREZIPFILENAME}_unsigned $TMPFOLDER/$FIRMWAREZIPFILENAME

If I use your bundled version of java, I get:
Code:
./java: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./java)

If I remove the path from that line and use my own installed verison of java, I get:
Code:
Exception in thread "main" java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder

Thanks!
The downloadable version of SignApkv2.jar is for java 8.
What is the glibc version on your system and what kind of system are you running?

However, if I now download the FYT Firmware workbench there is no "tools/jdk64/bin/java" anymore. :unsure:

Depending on your version of java you can compile it yourself but you need to do a number of steps to compile it on java versions of 9 and higher.
The java8 version uses the sun.security modules and these should not be used anymore.
Actually it is terribly complicated. I compiled it once for java 11 but I lost both my notes and the jar.

Of course you can also install one of the Android SDKs and use apksigner from the Android SDK.
 

cryptyk

Senior Member
Jul 2, 2007
881
4,001
The downloadable version of SignApkv2.jar is for java 8.
What is the glibc version on your system and what kind of system are you running?

However, if I now download the FYT Firmware workbench there is no "tools/jdk64/bin/java" anymore. :unsure:

Depending on your version of java you can compile it yourself but you need to do a number of steps to compile it on java versions of 9 and higher.
The java8 version uses the sun.security modules and these should not be used anymore.
Actually it is terribly complicated. I compiled it once for java 11 but I lost both my notes and the jar.

Of course you can also install one of the Android SDKs and use apksigner from the Android SDK.
This is helpful. I think I can use this to figure out the path forward.
The updated version has the jdk bundled (in this post):
 
  • Like
Reactions: surfer63

cryptyk

Senior Member
Jul 2, 2007
881
4,001
Ok got this working with the January firmware by installing Java 8 on the box and pointing repack.sh to that version. @ahmed123 - sent you the firmware so you can try to install it.
 
  • Like
Reactions: ahmed123

surfer63

Senior Member
May 4, 2010
4,746
2,269
Zwolle
github.com
This is helpful. I think I can use this to figure out the path forward.
The updated version has the jdk bundled (in this post):
Thank you. I now see it. I am used to finding updates in the first post, not by seaching through the other posts.

@mariodantas Can you please change the changelog description "2.0 Introduces a different ZIP signature method" in post #1 link to that post #26? :)
 
  • Like
Reactions: marchnz
Thank you. I now see it. I am used to finding updates in the first post, not by seaching through the other posts.

@mariodantas Can you please change the changelog description "2.0 Introduces a different ZIP signature method" in post #1 link to that post #26? :)
@surfer63 the post 26 uses the older sign methos that's supported by t'eyes, not the "2.0 introduces a different ZIP signature method" this last one is in my post #1, the FW-TEYES uses the old signature method., I'll clearify this in the Thread
 
  • Like
Reactions: surfer63

ahmed123

Senior Member
Jan 14, 2006
78
4
Ok got this working with the January firmware by installing Java 8 on the box and pointing repack.sh to that version. @ahmed123 - sent you the firmware so you can try to install it.

I tried it and it started installing but then got error saying:

Check Update package signature error and not allow installing update, please use legal system.

:unsure:
 
In the post #1 the attached file is FFW v2.0, which includes new zip signature method that is compatible with all kernels after 2022-07-18.

The error "please use legal system" does not appear anymore but....... I see that the chinese released a new lsec6315update and haven't tried it already (the latest one capable of flashing FFW v2.0 signed ZIPs is 2072 Kb)

Maybe they've enforced the signature method again ?, I don't know !, have to try to put the answer here
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    thx @surfer63

    edit unpack.sh :
    python3 ./tools/sdat2img.py $unzippedPath$i.transfer.list $unzippedPath$i.new.dat $unzippedPath$i.img > /dev/null 2>&1

    edit repack.sh :
    python3 ./tools/img2sdat.py $unzippedPath$i.new -v 4 -o $unzippedPath -p $i #> /dev/null 2>&1

    @mariodantas: The sdat2img.py and img2sdat.py are quite old and not testing for python2 or python3.
    The simplest way to adapt that is in your unpack.sh script and not in the python files, by using something like:

    Bash:
            echo "$(tput setaf 6)Converting $i.new.dat file into $i.img file$(tput setaf 7)"
            if  [ ! -e /usr/bin/python3 ]
            then
                # No python3 binary found. We have python2
                ./tools/sdat2img.py $unzippedPath$i.transfer.list $unzippedPath$i.new.dat $unzippedPath$i.img > /dev/null 2>&1
            else
                # Yes. python3 exists. Use it
                python3 ./tools/sdat2img.py $unzippedPath$i.transfer.list $unzippedPath$i.new.dat $unzippedPath$i.img > /dev/null 2>&1
            fi
            rm $unzippedPath$i.new.dat

    and then do the same for the img2sdat line.
    You can of course do the same in python using the sys.sys_info tuple, but that is less simple. And you need to adapt the shebang line.
    2
    What did you change to make it work?
    thx @surfer63

    edit unpack.sh :
    python3 ./tools/sdat2img.py $unzippedPath$i.transfer.list $unzippedPath$i.new.dat $unzippedPath$i.img > /dev/null 2>&1

    edit repack.sh :
    python3 ./tools/img2sdat.py $unzippedPath$i.new -v 4 -o $unzippedPath -p $i #> /dev/null 2>&1
    1
    Is it possible to install a pre rooted firmware for the CC3 if someone has already patched the firmware?

    i will receive the CC3 in maybe two weeks and would love to have root. But i have no Linux or Linux skills so far.

    Regards
    Yes, rooting is part of the kernel and the boot image inside that kernel.
    so you could take a rooted 6315_1.zip
    1
    Thanks @surfer63 will implement !
  • 5
    # FYT-Firmware-Workbench

    PLEASE DO NOT USE WITH T'EYES CC3 FIRMWARE

    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 packed and signed 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 ZIP file 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 = (autorun after import*) 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-) inject_mods = Copies all contents of "_mods" folder into system partition, like gps.conf or even bootanimation, up to you to creat the same folder structure with your own files to inject

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

    :cool: 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 local workbench !


    N'joy it !

    [CHANGELOG]

    2.0 Introduces a different ZIP signature method

    1.0 Initial release
    3
    thx @surfer63

    edit unpack.sh :
    python3 ./tools/sdat2img.py $unzippedPath$i.transfer.list $unzippedPath$i.new.dat $unzippedPath$i.img > /dev/null 2>&1

    edit repack.sh :
    python3 ./tools/img2sdat.py $unzippedPath$i.new -v 4 -o $unzippedPath -p $i #> /dev/null 2>&1

    @mariodantas: The sdat2img.py and img2sdat.py are quite old and not testing for python2 or python3.
    The simplest way to adapt that is in your unpack.sh script and not in the python files, by using something like:

    Bash:
            echo "$(tput setaf 6)Converting $i.new.dat file into $i.img file$(tput setaf 7)"
            if  [ ! -e /usr/bin/python3 ]
            then
                # No python3 binary found. We have python2
                ./tools/sdat2img.py $unzippedPath$i.transfer.list $unzippedPath$i.new.dat $unzippedPath$i.img > /dev/null 2>&1
            else
                # Yes. python3 exists. Use it
                python3 ./tools/sdat2img.py $unzippedPath$i.transfer.list $unzippedPath$i.new.dat $unzippedPath$i.img > /dev/null 2>&1
            fi
            rm $unzippedPath$i.new.dat

    and then do the same for the img2sdat line.
    You can of course do the same in python using the sys.sys_info tuple, but that is less simple. And you need to adapt the shebang line.
    2
    What did you change to make it work?
    thx @surfer63

    edit unpack.sh :
    python3 ./tools/sdat2img.py $unzippedPath$i.transfer.list $unzippedPath$i.new.dat $unzippedPath$i.img > /dev/null 2>&1

    edit repack.sh :
    python3 ./tools/img2sdat.py $unzippedPath$i.new -v 4 -o $unzippedPath -p $i #> /dev/null 2>&1
    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
    Thanks @surfer63 will implement !