rustfoil
rustfoil copied to clipboard
Rustfoil generates extra characters
When running rustfoil with the --compression off flag, it generates the TINFOIL header plus extra characters outside of the main brackets. After manually adding what I need to (themes and retro ROMs sections), I then use the encrypt.py script provided on the tinfoil.io website using the public.key and using its (python's) zstd compression, Tinfoil will not pick it up. Oddly enough, using just the plain text file originally created by rustfoil (and manually adding my extra sections) it works fine with Tinfoil. Now I can manually remove those extra characters in Notepad++ then compress/encrypt and Tinfoil picks it up just fine. So what I am getting at, what is writing the TINFOIL header and is it needed, as well as the (Mostly) NUL characters, (I assume padding maybe?) and are they needed. Bonus feature request: can we also get some line returns so it isn't all one line?
Hey @TheExpertNoob,
These extra characters you speaking about are part of Tinfoils official spec, when i made Rustfoil (nearly 3 years from now) i meanly oriented myself at what Tingen did at the time (see https://github.com/eXhumer/pyTinGen) which also followed this spec.
Writing the Tinfoil header is needed when enabling compression and or encryption as the spec is just needed when either of those are used (tinfoil needs a certain flag to know what compression is used and if encryption is used) but Rustfoil always writes that header cause there is really no reason to not write it, when i made Rustfoil i had not in mind that some people might want to modify the file afterwards for currently unsupported features such as Themes and retro ROMs.
I personally also do not see much use in a formatted json response.
If you tell me what Tinfoil expects for retro roms and Themes (like what i need to add to the index json) im happy to natively implement it in Rustfoil tho 😃