goappimagetool

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DOWNLOAD_URL = "https://github.com/AppImage/type2-runtime/releases/download/continuous"

Download location of the AppImage engine binaries.

Variables

This section is empty.

Functions

func AppendToFile

func AppendToFile(src string, dest string)

Appends the source file to the destination file.

func CalculateMD5

func CalculateMD5(path string) []byte

Calculates the MD5 hash over the complete .AppImage executable. Conforms to the AppImage spec.

func CalculateSha256

func CalculateSha256(path string) []byte

Calculates a sha256 hash from a given file. Hashes the entire content.

func Check

func Check(err error)

If an error supplied it panics printing the error.

func CreateAppImage

func CreateAppImage(appDirPath string, appImageEnginePath string, pgp *PGPMaterial)

Creates an app image from an AppDir.

appDirPath = directory which you want to turn into an AppImage. Make sure that it follows the AppImage spec.

appImageEnginePath = file of the AppImage engine. Use `DownloadAppImageEngine` function if you don't have an AppImage Engine ready yet.

pgp = The pgp key to sign the AppImage. It's optional. If you don't want to sign your AppImage, supply an empty struct.

func CreateSquashFSFromFolder

func CreateSquashFSFromFolder(srcFolder string, outputFileName string) string

Creates a squashfs file from a supplied folder and saves it to `outputFileName`

func DirSize

func DirSize(path string) (int64, error)

Calculates the size in bytes for a given directory path including all contents.

func DownloadAppImageEngine

func DownloadAppImageEngine(arch string) string

Downloads the AppImage Engine from the official source and returns the location of the downloaded file.

func GenerateSigningKey

func GenerateSigningKey(name string, email string, passphrase string) (secretKey string, publicKey string, err error)

Creates a pgp key pair using RSA 4096 bit encryption. The armored public key and private key are written to two separate files called public.asc and private.asc.

func MakeExecutable

func MakeExecutable(path string) error

Sets the permission bits for the given file to 755.

func OverwriteSection

func OverwriteSection(path string, section string, content []byte) error

Used to overwrite sections of elf files.

Path is the location of the elf file. Section is the name of the section you want to overwrite (e.g. .sign_key) Content is what you want to write into the section

func SignSha256

func SignSha256(hash []byte, pgp PGPMaterial) ([]byte, error)

Signs the byte array using the supplied private key.

func UpdateMD5

func UpdateMD5(path string, hash []byte) error

Overwrites the .digest_md5 section in the AppImage Engine elf binary.

func UpdateSha256

func UpdateSha256(path string, hash []byte) error

Overwrites the .sha256_sig section in the AppImage Engine elf binary.

func UpdateSigKey

func UpdateSigKey(path string, pgp PGPMaterial) error

Updates the .AppImage elf binary by writing the public key into the .sig_key field.

Types

type PGPMaterial

type PGPMaterial struct {
	Passphrase        string
	PrivateKeyArmored string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL