I created versions of this program that are meant to be run on users computers locally, this should be done for two reasons:
It allows the program to be portable, meaning that it does not require GitHub to work and can be run without an internet connection.
Though we can see the exact code being run (in recovery.yml), some users may view downloading a file created by a GitHub workflow as a security risk, as the code is being run on an external machine.
I made some further modification to the scripts, they are as follow:
It is generally not a good idea to include static binaries with a program (avbtool, magiskboot), my script downloads the programs directly from the appropriate source.
In script1.sh there is a line of code dd if=recovery.img of=r.img bs=4k count=$off iflag=count_bytes, however it is not needed as well as the use of the avbtool.
Rationale - The "dd" line shrinks the img file by removing the hash and footer, then the avbtool reinserts new ones at the end of the patching process. This is not needed because magiskboot can just patch the file in-place and the img will flash through Odin properly. This is good because it reduces the number of steps that the script needs to execute and reduces the reliance on additional programs such as the avbtool and opensll.
If you want to include the commands I removed in the local script for Linux, that is perfectly fine but note that the avbtool does not work on Windows, so if the hash and footer are removed they cannot be reinserted, as such the windows script must remain as is.
Lastly I added a simple explanation of how to use the local scripts in the README.md.
I created versions of this program that are meant to be run on users computers locally, this should be done for two reasons:
I made some further modification to the scripts, they are as follow:
dd if=recovery.img of=r.img bs=4k count=$off iflag=count_bytes
, however it is not needed as well as the use of the avbtool.Rationale - The "dd" line shrinks the img file by removing the hash and footer, then the avbtool reinserts new ones at the end of the patching process. This is not needed because magiskboot can just patch the file in-place and the img will flash through Odin properly. This is good because it reduces the number of steps that the script needs to execute and reduces the reliance on additional programs such as the avbtool and opensll.
If you want to include the commands I removed in the local script for Linux, that is perfectly fine but note that the avbtool does not work on Windows, so if the hash and footer are removed they cannot be reinserted, as such the windows script must remain as is.
Lastly I added a simple explanation of how to use the local scripts in the README.md.