aota

package module
v0.0.0-...-273f154 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 16 Imported by: 0

README

aota

A multithreaded Android OTA installer, written in Go.

Download self-hosted releases from the latest commit (stripped using go build -ldflags="-s -w")

Usage

On Linux, Mac, and pretty much everything else:

./aota -a value or ./aota --arg value

On Windows:

.\aota.exe -a value or .\aota.exe --arg value

--input <required: path to OTA.zip or payload.bin>
--out <optional: path to output folder>
--extract <optional: comma,separated,partition,list>
--cap <optional: memory limit in bytes for buffering install operations, anything above 64MiB is pointless>
--jobs <optional: limit or increase the number of Go processes that can spawn>
--debug <optional: no value, just shows debug logs when used>

For example, to extract boot, dtbo, and vendor_boot from raven-ota.zip:

aota -i raven-ota.zip -e boot,dtbo,vendor_boot

It can parse your payload.bin directly, or it can temporarily extract it from an OTA.zip file.

About

Inspired by https://github.com/cyxx/extract_android_ota_payload.

Forked from https://github.com/tobyxdd/android-ota-payload-extractor.

Further inspired by https://github.com/ssut/payload-dumper-go.

Just like the original project by tobyxdd (inspired by cyxx), the goal of aota is to provide stable and high performance OTA payload parsing so that you can utilize the data within. For example, most users will want to extract the boot image from an OTA update so that they can install Magisk without a custom recovery. tobyxdd laid the groundwork so I could skip the part where I reinvent a wheel again, but aota has more than just one goal!

The main driver for creating this fork was to multithread the OTA extraction process so that full OTA extractions would take less time to finish on multi-core systems. Eventually I was told about payload-dumper-go which already achieved this goal, and I was already at the middle point between the slowness of the old project and the high speed of that project just by spawning one goroutine per install operation and allowing any free CPU core to finish ops that aren't blocking. So I took a hint on replacing the xz package and pre-extracting the payload to disk from ZIP files, replaced the bzip2 package, and did some logic magic to gain a whopping 3 seconds over payload-dumper-go. I was achieving 1min13s on a 16x AMD EPYC with 32GB of RAM (which was particularly unbusy) versus 1min16s on the same system.

Due to the nature of app environments within Android, it's been rather difficult to test aota in an accurate manner on my Pixel 6 Pro. But after some further bugfixes, if I use a payload.bin directly and already have the space allocated for the partition images (simulating a streamed install but without the networking), aota is now reaching 1min19s on the Pixel 6 Pro within Termux! There's no certainty in which CPU core will be executing a given install operation, so it can vary mildly, but it hasn't gone above 1min33s yet during my own testing. I miss the 1min16s mark that I reached before on this same phone, but it's hard to argue with the improvements across the board.

I will likely update this about section as time goes on, but I can at least state the main goal of aota now that I've reached my desired performance (with exception to the bug running on real Android with timings):

aota is taking all of this logic and converting it into a Go package so any program can make use of it. Import it into your Go code, compile it as a shared library so it can be linked to other languages, or make use of the aota cmd wrapper that implements every feature.


If you do something cool or interesting with aota, I may link it here!


appOTA

appOTA - the open source Android Plus Project OTA server

appOTA was created as a reverse-engineering effort of hentaiOS Updater to allow it to be used in appOS and other distributions of Android.

appOTA uses aota to parse and manipulate OTA payloads before serving them to the Updater app. It is intended to serve OTAs to AOSP's update_engine service.

appOS and appOTA are not yet available to consumers, check back shortly!


Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OtaMetadata_OtaType_name = map[int32]string{
		0: "UNKNOWN",
		1: "AB",
		2: "BLOCK",
		3: "BRICK",
	}
	OtaMetadata_OtaType_value = map[string]int32{
		"UNKNOWN": 0,
		"AB":      1,
		"BLOCK":   2,
		"BRICK":   3,
	}
)

Enum value maps for OtaMetadata_OtaType.

View Source
var (
	InstallOperation_Type_name = map[int32]string{
		0:  "REPLACE",
		1:  "REPLACE_BZ",
		2:  "MOVE",
		3:  "BSDIFF",
		4:  "SOURCE_COPY",
		5:  "SOURCE_BSDIFF",
		8:  "REPLACE_XZ",
		6:  "ZERO",
		7:  "DISCARD",
		10: "BROTLI_BSDIFF",
		9:  "PUFFDIFF",
		11: "ZUCCHINI",
		12: "LZ4DIFF_BSDIFF",
		13: "LZ4DIFF_PUFFDIFF",
	}
	InstallOperation_Type_value = map[string]int32{
		"REPLACE":          0,
		"REPLACE_BZ":       1,
		"MOVE":             2,
		"BSDIFF":           3,
		"SOURCE_COPY":      4,
		"SOURCE_BSDIFF":    5,
		"REPLACE_XZ":       8,
		"ZERO":             6,
		"DISCARD":          7,
		"BROTLI_BSDIFF":    10,
		"PUFFDIFF":         9,
		"ZUCCHINI":         11,
		"LZ4DIFF_BSDIFF":   12,
		"LZ4DIFF_PUFFDIFF": 13,
	}
)

Enum value maps for InstallOperation_Type.

View Source
var (
	CowMergeOperation_Type_name = map[int32]string{
		0: "COW_COPY",
		1: "COW_XOR",
		2: "COW_REPLACE",
	}
	CowMergeOperation_Type_value = map[string]int32{
		"COW_COPY":    0,
		"COW_XOR":     1,
		"COW_REPLACE": 2,
	}
)

Enum value maps for CowMergeOperation_Type.

Functions

This section is empty.

Types

type ApexInfo

type ApexInfo struct {
	PackageName      *string `protobuf:"bytes,1,opt,name=package_name,json=packageName,proto3,oneof" json:"package_name,omitempty"`
	Version          *int64  `protobuf:"varint,2,opt,name=version,proto3,oneof" json:"version,omitempty"`
	IsCompressed     *bool   `protobuf:"varint,3,opt,name=is_compressed,json=isCompressed,proto3,oneof" json:"is_compressed,omitempty"`
	DecompressedSize *int64  `protobuf:"varint,4,opt,name=decompressed_size,json=decompressedSize,proto3,oneof" json:"decompressed_size,omitempty"`
	// Used in OTA
	SourceVersion *int64 `protobuf:"varint,5,opt,name=source_version,json=sourceVersion,proto3,oneof" json:"source_version,omitempty"`
	// contains filtered or unexported fields
}

func (*ApexInfo) Descriptor deprecated

func (*ApexInfo) Descriptor() ([]byte, []int)

Deprecated: Use ApexInfo.ProtoReflect.Descriptor instead.

func (*ApexInfo) GetDecompressedSize

func (x *ApexInfo) GetDecompressedSize() int64

func (*ApexInfo) GetIsCompressed

func (x *ApexInfo) GetIsCompressed() bool

func (*ApexInfo) GetPackageName

func (x *ApexInfo) GetPackageName() string

func (*ApexInfo) GetSourceVersion

func (x *ApexInfo) GetSourceVersion() int64

func (*ApexInfo) GetVersion

func (x *ApexInfo) GetVersion() int64

func (*ApexInfo) ProtoMessage

func (*ApexInfo) ProtoMessage()

func (*ApexInfo) ProtoReflect

func (x *ApexInfo) ProtoReflect() protoreflect.Message

func (*ApexInfo) Reset

func (x *ApexInfo) Reset()

func (*ApexInfo) String

func (x *ApexInfo) String() string

type ApexMetadata

type ApexMetadata struct {
	ApexInfo []*ApexInfo `protobuf:"bytes,1,rep,name=apex_info,json=apexInfo,proto3" json:"apex_info,omitempty"`
	// contains filtered or unexported fields
}

Just a container to hold repeated apex_info, so that we can easily serialize a list of apex_info to string.

func (*ApexMetadata) Descriptor deprecated

func (*ApexMetadata) Descriptor() ([]byte, []int)

Deprecated: Use ApexMetadata.ProtoReflect.Descriptor instead.

func (*ApexMetadata) GetApexInfo

func (x *ApexMetadata) GetApexInfo() []*ApexInfo

func (*ApexMetadata) ProtoMessage

func (*ApexMetadata) ProtoMessage()

func (*ApexMetadata) ProtoReflect

func (x *ApexMetadata) ProtoReflect() protoreflect.Message

func (*ApexMetadata) Reset

func (x *ApexMetadata) Reset()

func (*ApexMetadata) String

func (x *ApexMetadata) String() string

type CowMergeOperation

type CowMergeOperation struct {
	Type      *CowMergeOperation_Type `protobuf:"varint,1,opt,name=type,proto3,enum=chromeos_update_engine.CowMergeOperation_Type,oneof" json:"type,omitempty"`
	SrcExtent *Extent                 `protobuf:"bytes,2,opt,name=src_extent,json=srcExtent,proto3,oneof" json:"src_extent,omitempty"`
	DstExtent *Extent                 `protobuf:"bytes,3,opt,name=dst_extent,json=dstExtent,proto3,oneof" json:"dst_extent,omitempty"`
	// For COW_XOR, source location might be unaligned, so this field is in range
	// [0, block_size), representing how much should the src_extent shift toward
	// larger block number. If this field is non-zero, then src_extent will
	// include 1 extra block in the end, as the merge op actually references the
	// first |src_offset| bytes of that extra block. For example, if |dst_extent|
	// is [10, 15], |src_offset| is 500, then src_extent might look like [25, 31].
	// Note that |src_extent| contains 1 extra block than the |dst_extent|.
	SrcOffset *uint32 `protobuf:"varint,4,opt,name=src_offset,json=srcOffset,proto3,oneof" json:"src_offset,omitempty"`
	// contains filtered or unexported fields
}

Hints to VAB snapshot to skip writing some blocks if these blocks are identical to the ones on the source image. The src & dst extents for each CowMergeOperation should be contiguous, and they're a subset of an OTA InstallOperation. During merge time, we need to follow the pre-computed sequence to avoid read after write, similar to the inplace update schema.

func (*CowMergeOperation) Descriptor deprecated

func (*CowMergeOperation) Descriptor() ([]byte, []int)

Deprecated: Use CowMergeOperation.ProtoReflect.Descriptor instead.

func (*CowMergeOperation) GetDstExtent

func (x *CowMergeOperation) GetDstExtent() *Extent

func (*CowMergeOperation) GetSrcExtent

func (x *CowMergeOperation) GetSrcExtent() *Extent

func (*CowMergeOperation) GetSrcOffset

func (x *CowMergeOperation) GetSrcOffset() uint32

func (*CowMergeOperation) GetType

func (*CowMergeOperation) ProtoMessage

func (*CowMergeOperation) ProtoMessage()

func (*CowMergeOperation) ProtoReflect

func (x *CowMergeOperation) ProtoReflect() protoreflect.Message

func (*CowMergeOperation) Reset

func (x *CowMergeOperation) Reset()

func (*CowMergeOperation) String

func (x *CowMergeOperation) String() string

type CowMergeOperation_Type

type CowMergeOperation_Type int32
const (
	CowMergeOperation_COW_COPY    CowMergeOperation_Type = 0 // identical blocks
	CowMergeOperation_COW_XOR     CowMergeOperation_Type = 1 // used when src/dst blocks are highly similar
	CowMergeOperation_COW_REPLACE CowMergeOperation_Type = 2 // Raw replace operation
)

func (CowMergeOperation_Type) Descriptor

func (CowMergeOperation_Type) Enum

func (CowMergeOperation_Type) EnumDescriptor deprecated

func (CowMergeOperation_Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use CowMergeOperation_Type.Descriptor instead.

func (CowMergeOperation_Type) Number

func (CowMergeOperation_Type) String

func (x CowMergeOperation_Type) String() string

func (CowMergeOperation_Type) Type

type DeltaArchiveManifest

type DeltaArchiveManifest struct {

	// (At time of writing) usually 4096
	BlockSize *uint32 `protobuf:"varint,3,opt,name=block_size,json=blockSize,proto3,oneof" json:"block_size,omitempty"`
	// If signatures are present, the offset into the blobs, generally
	// tacked onto the end of the file, and the length. We use an offset
	// rather than a bool to allow for more flexibility in future file formats.
	// If either is absent, it means signatures aren't supported in this
	// file.
	SignaturesOffset *uint64 `protobuf:"varint,4,opt,name=signatures_offset,json=signaturesOffset,proto3,oneof" json:"signatures_offset,omitempty"`
	SignaturesSize   *uint64 `protobuf:"varint,5,opt,name=signatures_size,json=signaturesSize,proto3,oneof" json:"signatures_size,omitempty"`
	// The minor version, also referred as "delta version", of the payload.
	// Minor version 0 is full payload, everything else is delta payload.
	MinorVersion *uint32 `protobuf:"varint,12,opt,name=minor_version,json=minorVersion,proto3,oneof" json:"minor_version,omitempty"`
	// Only present in major version >= 2. List of partitions that will be
	// updated, in the order they will be updated. This field replaces the
	// |install_operations|, |kernel_install_operations| and the
	// |{old,new}_{kernel,rootfs}_info| fields used in major version = 1. This
	// array can have more than two partitions if needed, and they are identified
	// by the partition name.
	Partitions []*PartitionUpdate `protobuf:"bytes,13,rep,name=partitions,proto3" json:"partitions,omitempty"`
	// The maximum timestamp of the OS allowed to apply this payload.
	// Can be used to prevent downgrading the OS.
	MaxTimestamp *int64 `protobuf:"varint,14,opt,name=max_timestamp,json=maxTimestamp,proto3,oneof" json:"max_timestamp,omitempty"`
	// Metadata related to all dynamic partitions.
	DynamicPartitionMetadata *DynamicPartitionMetadata `` /* 142-byte string literal not displayed */
	// If the payload only updates a subset of partitions on the device.
	PartialUpdate *bool `protobuf:"varint,16,opt,name=partial_update,json=partialUpdate,proto3,oneof" json:"partial_update,omitempty"`
	// Information on compressed APEX to figure out how much space is required for
	// their decompression
	ApexInfo []*ApexInfo `protobuf:"bytes,17,rep,name=apex_info,json=apexInfo,proto3" json:"apex_info,omitempty"`
	// Security patch level of the device, usually in the format of
	// yyyy-mm-dd
	SecurityPatchLevel *string `protobuf:"bytes,18,opt,name=security_patch_level,json=securityPatchLevel,proto3,oneof" json:"security_patch_level,omitempty"`
	// contains filtered or unexported fields
}

func (*DeltaArchiveManifest) Descriptor deprecated

func (*DeltaArchiveManifest) Descriptor() ([]byte, []int)

Deprecated: Use DeltaArchiveManifest.ProtoReflect.Descriptor instead.

func (*DeltaArchiveManifest) GetApexInfo

func (x *DeltaArchiveManifest) GetApexInfo() []*ApexInfo

func (*DeltaArchiveManifest) GetBlockSize

func (x *DeltaArchiveManifest) GetBlockSize() uint32

func (*DeltaArchiveManifest) GetDynamicPartitionMetadata

func (x *DeltaArchiveManifest) GetDynamicPartitionMetadata() *DynamicPartitionMetadata

func (*DeltaArchiveManifest) GetMaxTimestamp

func (x *DeltaArchiveManifest) GetMaxTimestamp() int64

func (*DeltaArchiveManifest) GetMinorVersion

func (x *DeltaArchiveManifest) GetMinorVersion() uint32

func (*DeltaArchiveManifest) GetPartialUpdate

func (x *DeltaArchiveManifest) GetPartialUpdate() bool

func (*DeltaArchiveManifest) GetPartitions

func (x *DeltaArchiveManifest) GetPartitions() []*PartitionUpdate

func (*DeltaArchiveManifest) GetSecurityPatchLevel

func (x *DeltaArchiveManifest) GetSecurityPatchLevel() string

func (*DeltaArchiveManifest) GetSignaturesOffset

func (x *DeltaArchiveManifest) GetSignaturesOffset() uint64

func (*DeltaArchiveManifest) GetSignaturesSize

func (x *DeltaArchiveManifest) GetSignaturesSize() uint64

func (*DeltaArchiveManifest) ProtoMessage

func (*DeltaArchiveManifest) ProtoMessage()

func (*DeltaArchiveManifest) ProtoReflect

func (x *DeltaArchiveManifest) ProtoReflect() protoreflect.Message

func (*DeltaArchiveManifest) Reset

func (x *DeltaArchiveManifest) Reset()

func (*DeltaArchiveManifest) String

func (x *DeltaArchiveManifest) String() string

type DeviceState

type DeviceState struct {

	// device name. i.e. ro.product.device; if the field has multiple values, it
	// means the ota package supports multiple devices. This usually happens when
	// we use the same image to support multiple skus.
	Device []string `protobuf:"bytes,1,rep,name=device,proto3" json:"device,omitempty"`
	// device fingerprint. Up to R build, the value reads from
	// ro.build.fingerprint.
	Build []string `protobuf:"bytes,2,rep,name=build,proto3" json:"build,omitempty"`
	// A value that specify a version of the android build.
	BuildIncremental string `protobuf:"bytes,3,opt,name=build_incremental,json=buildIncremental,proto3" json:"build_incremental,omitempty"`
	// The timestamp when the build is generated.
	Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// The version of the currently-executing Android system.
	SdkLevel string `protobuf:"bytes,5,opt,name=sdk_level,json=sdkLevel,proto3" json:"sdk_level,omitempty"`
	// A value indicating the security patch level of a build.
	SecurityPatchLevel string `protobuf:"bytes,6,opt,name=security_patch_level,json=securityPatchLevel,proto3" json:"security_patch_level,omitempty"`
	// The detailed state of each partition. For partial updates or devices with
	// mixed build of partitions, some of the above fields may left empty. And the
	// client will rely on the information of specific partitions to target the
	// update.
	PartitionState []*PartitionState `protobuf:"bytes,7,rep,name=partition_state,json=partitionState,proto3" json:"partition_state,omitempty"`
	// contains filtered or unexported fields
}

The build information on the device. The bytes of the running images are thus inferred from the device state. For more information of the meaning of each subfield, check https://source.android.com/compatibility/android-cdd#3_2_2_build_parameters

func (*DeviceState) Descriptor deprecated

func (*DeviceState) Descriptor() ([]byte, []int)

Deprecated: Use DeviceState.ProtoReflect.Descriptor instead.

func (*DeviceState) GetBuild

func (x *DeviceState) GetBuild() []string

func (*DeviceState) GetBuildIncremental

func (x *DeviceState) GetBuildIncremental() string

func (*DeviceState) GetDevice

func (x *DeviceState) GetDevice() []string

func (*DeviceState) GetPartitionState

func (x *DeviceState) GetPartitionState() []*PartitionState

func (*DeviceState) GetSdkLevel

func (x *DeviceState) GetSdkLevel() string

func (*DeviceState) GetSecurityPatchLevel

func (x *DeviceState) GetSecurityPatchLevel() string

func (*DeviceState) GetTimestamp

func (x *DeviceState) GetTimestamp() int64

func (*DeviceState) ProtoMessage

func (*DeviceState) ProtoMessage()

func (*DeviceState) ProtoReflect

func (x *DeviceState) ProtoReflect() protoreflect.Message

func (*DeviceState) Reset

func (x *DeviceState) Reset()

func (*DeviceState) String

func (x *DeviceState) String() string

type DynamicPartitionGroup

type DynamicPartitionGroup struct {

	// Name of the group.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Maximum size of the group. The sum of sizes of all partitions in the group
	// must not exceed the maximum size of the group.
	Size *uint64 `protobuf:"varint,2,opt,name=size,proto3,oneof" json:"size,omitempty"`
	// A list of partitions that belong to the group.
	PartitionNames []string `protobuf:"bytes,3,rep,name=partition_names,json=partitionNames,proto3" json:"partition_names,omitempty"`
	// contains filtered or unexported fields
}

func (*DynamicPartitionGroup) Descriptor deprecated

func (*DynamicPartitionGroup) Descriptor() ([]byte, []int)

Deprecated: Use DynamicPartitionGroup.ProtoReflect.Descriptor instead.

func (*DynamicPartitionGroup) GetName

func (x *DynamicPartitionGroup) GetName() string

func (*DynamicPartitionGroup) GetPartitionNames

func (x *DynamicPartitionGroup) GetPartitionNames() []string

func (*DynamicPartitionGroup) GetSize

func (x *DynamicPartitionGroup) GetSize() uint64

func (*DynamicPartitionGroup) ProtoMessage

func (*DynamicPartitionGroup) ProtoMessage()

func (*DynamicPartitionGroup) ProtoReflect

func (x *DynamicPartitionGroup) ProtoReflect() protoreflect.Message

func (*DynamicPartitionGroup) Reset

func (x *DynamicPartitionGroup) Reset()

func (*DynamicPartitionGroup) String

func (x *DynamicPartitionGroup) String() string

type DynamicPartitionMetadata

type DynamicPartitionMetadata struct {

	// All updatable groups present in |partitions| of this DeltaArchiveManifest.
	//   - If an updatable group is on the device but not in the manifest, it is
	//     not updated. Hence, the group will not be resized, and partitions cannot
	//     be added to or removed from the group.
	//   - If an updatable group is in the manifest but not on the device, the group
	//     is added to the device.
	Groups []*DynamicPartitionGroup `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"`
	// Whether dynamic partitions have snapshots during the update. If this is
	// set to true, the update_engine daemon creates snapshots for all dynamic
	// partitions if possible. If this is unset, the update_engine daemon MUST
	// NOT create snapshots for dynamic partitions.
	SnapshotEnabled *bool `protobuf:"varint,2,opt,name=snapshot_enabled,json=snapshotEnabled,proto3,oneof" json:"snapshot_enabled,omitempty"`
	// If this is set to false, update_engine should not use VABC regardless. If
	// this is set to true, update_engine may choose to use VABC if device
	// supports it, but not guaranteed.
	// VABC stands for Virtual AB Compression
	VabcEnabled *bool `protobuf:"varint,3,opt,name=vabc_enabled,json=vabcEnabled,proto3,oneof" json:"vabc_enabled,omitempty"`
	// The compression algorithm used by VABC. Available ones are "gz", "brotli".
	// See system/core/fs_mgr/libsnapshot/cow_writer.cpp for available options,
	// as this parameter is ultimated forwarded to libsnapshot's CowWriter
	VabcCompressionParam *string `` /* 129-byte string literal not displayed */
	// COW version used by VABC. The represents the major version in the COW
	// header
	CowVersion *uint32 `protobuf:"varint,5,opt,name=cow_version,json=cowVersion,proto3,oneof" json:"cow_version,omitempty"`
	// A collection of knobs to tune Virtual AB Compression
	VabcFeatureSet *VABCFeatureSet `protobuf:"bytes,6,opt,name=vabc_feature_set,json=vabcFeatureSet,proto3,oneof" json:"vabc_feature_set,omitempty"`
	// contains filtered or unexported fields
}

Metadata related to all dynamic partitions.

func (*DynamicPartitionMetadata) Descriptor deprecated

func (*DynamicPartitionMetadata) Descriptor() ([]byte, []int)

Deprecated: Use DynamicPartitionMetadata.ProtoReflect.Descriptor instead.

func (*DynamicPartitionMetadata) GetCowVersion

func (x *DynamicPartitionMetadata) GetCowVersion() uint32

func (*DynamicPartitionMetadata) GetGroups

func (*DynamicPartitionMetadata) GetSnapshotEnabled

func (x *DynamicPartitionMetadata) GetSnapshotEnabled() bool

func (*DynamicPartitionMetadata) GetVabcCompressionParam

func (x *DynamicPartitionMetadata) GetVabcCompressionParam() string

func (*DynamicPartitionMetadata) GetVabcEnabled

func (x *DynamicPartitionMetadata) GetVabcEnabled() bool

func (*DynamicPartitionMetadata) GetVabcFeatureSet

func (x *DynamicPartitionMetadata) GetVabcFeatureSet() *VABCFeatureSet

func (*DynamicPartitionMetadata) ProtoMessage

func (*DynamicPartitionMetadata) ProtoMessage()

func (*DynamicPartitionMetadata) ProtoReflect

func (x *DynamicPartitionMetadata) ProtoReflect() protoreflect.Message

func (*DynamicPartitionMetadata) Reset

func (x *DynamicPartitionMetadata) Reset()

func (*DynamicPartitionMetadata) String

func (x *DynamicPartitionMetadata) String() string

type Extent

type Extent struct {
	StartBlock *uint64 `protobuf:"varint,1,opt,name=start_block,json=startBlock,proto3,oneof" json:"start_block,omitempty"`
	NumBlocks  *uint64 `protobuf:"varint,2,opt,name=num_blocks,json=numBlocks,proto3,oneof" json:"num_blocks,omitempty"`
	// contains filtered or unexported fields
}

func (*Extent) Descriptor deprecated

func (*Extent) Descriptor() ([]byte, []int)

Deprecated: Use Extent.ProtoReflect.Descriptor instead.

func (*Extent) GetNumBlocks

func (x *Extent) GetNumBlocks() uint64

func (*Extent) GetStartBlock

func (x *Extent) GetStartBlock() uint64

func (*Extent) ProtoMessage

func (*Extent) ProtoMessage()

func (*Extent) ProtoReflect

func (x *Extent) ProtoReflect() protoreflect.Message

func (*Extent) Reset

func (x *Extent) Reset()

func (*Extent) String

func (x *Extent) String() string

type InstallOpStep

type InstallOpStep struct {
	Op  int
	Iop *InstallOpsPartition
}

type InstallOperation

type InstallOperation struct {
	Type InstallOperation_Type `protobuf:"varint,1,opt,name=type,proto3,enum=chromeos_update_engine.InstallOperation_Type" json:"type,omitempty"`
	// Only minor version 6 or newer support 64 bits |data_offset| and
	// |data_length|, older client will read them as uint32.
	// The offset into the delta file (after the protobuf)
	// where the data (if any) is stored
	DataOffset *uint64 `protobuf:"varint,2,opt,name=data_offset,json=dataOffset,proto3,oneof" json:"data_offset,omitempty"`
	// The length of the data in the delta file
	DataLength *uint64 `protobuf:"varint,3,opt,name=data_length,json=dataLength,proto3,oneof" json:"data_length,omitempty"`
	// Ordered list of extents that are read from (if any) and written to.
	SrcExtents []*Extent `protobuf:"bytes,4,rep,name=src_extents,json=srcExtents,proto3" json:"src_extents,omitempty"`
	// Byte length of src, equal to the number of blocks in src_extents *
	// block_size. It is used for BSDIFF and SOURCE_BSDIFF, because we need to
	// pass that external program the number of bytes to read from the blocks we
	// pass it.  This is not used in any other operation.
	SrcLength  *uint64   `protobuf:"varint,5,opt,name=src_length,json=srcLength,proto3,oneof" json:"src_length,omitempty"`
	DstExtents []*Extent `protobuf:"bytes,6,rep,name=dst_extents,json=dstExtents,proto3" json:"dst_extents,omitempty"`
	// Byte length of dst, equal to the number of blocks in dst_extents *
	// block_size. Used for BSDIFF and SOURCE_BSDIFF, but not in any other
	// operation.
	DstLength *uint64 `protobuf:"varint,7,opt,name=dst_length,json=dstLength,proto3,oneof" json:"dst_length,omitempty"`
	// Optional SHA 256 hash of the blob associated with this operation.
	// This is used as a primary validation for http-based downloads and
	// as a defense-in-depth validation for https-based downloads. If
	// the operation doesn't refer to any blob, this field will have
	// zero bytes.
	DataSha256Hash []byte `protobuf:"bytes,8,opt,name=data_sha256_hash,json=dataSha256Hash,proto3,oneof" json:"data_sha256_hash,omitempty"`
	// Indicates the SHA 256 hash of the source data referenced in src_extents at
	// the time of applying the operation. If present, the update_engine daemon
	// MUST read and verify the source data before applying the operation.
	SrcSha256Hash []byte `protobuf:"bytes,9,opt,name=src_sha256_hash,json=srcSha256Hash,proto3,oneof" json:"src_sha256_hash,omitempty"`
	// contains filtered or unexported fields
}

func (*InstallOperation) Descriptor deprecated

func (*InstallOperation) Descriptor() ([]byte, []int)

Deprecated: Use InstallOperation.ProtoReflect.Descriptor instead.

func (*InstallOperation) GetDataLength

func (x *InstallOperation) GetDataLength() uint64

func (*InstallOperation) GetDataOffset

func (x *InstallOperation) GetDataOffset() uint64

func (*InstallOperation) GetDataSha256Hash

func (x *InstallOperation) GetDataSha256Hash() []byte

func (*InstallOperation) GetDstExtents

func (x *InstallOperation) GetDstExtents() []*Extent

func (*InstallOperation) GetDstLength

func (x *InstallOperation) GetDstLength() uint64

func (*InstallOperation) GetSrcExtents

func (x *InstallOperation) GetSrcExtents() []*Extent

func (*InstallOperation) GetSrcLength

func (x *InstallOperation) GetSrcLength() uint64

func (*InstallOperation) GetSrcSha256Hash

func (x *InstallOperation) GetSrcSha256Hash() []byte

func (*InstallOperation) GetType

func (*InstallOperation) ProtoMessage

func (*InstallOperation) ProtoMessage()

func (*InstallOperation) ProtoReflect

func (x *InstallOperation) ProtoReflect() protoreflect.Message

func (*InstallOperation) Reset

func (x *InstallOperation) Reset()

func (*InstallOperation) String

func (x *InstallOperation) String() string

type InstallOperation_Type

type InstallOperation_Type int32
const (
	InstallOperation_REPLACE    InstallOperation_Type = 0 // Replace destination extents w/ attached data.
	InstallOperation_REPLACE_BZ InstallOperation_Type = 1 // Replace destination extents w/ attached bzipped data.
	// Deprecated: Marked as deprecated in aota.proto.
	InstallOperation_MOVE InstallOperation_Type = 2 // Move source extents to target extents.
	// Deprecated: Marked as deprecated in aota.proto.
	InstallOperation_BSDIFF InstallOperation_Type = 3 // The data is a bsdiff binary diff.
	// On minor version 2 or newer, these operations are supported:
	InstallOperation_SOURCE_COPY   InstallOperation_Type = 4 // Copy from source to target partition
	InstallOperation_SOURCE_BSDIFF InstallOperation_Type = 5 // Like BSDIFF, but read from source partition
	// On minor version 3 or newer and on major version 2 or newer, these
	// operations are supported:
	InstallOperation_REPLACE_XZ InstallOperation_Type = 8 // Replace destination extents w/ attached xz data.
	// On minor version 4 or newer, these operations are supported:
	InstallOperation_ZERO          InstallOperation_Type = 6  // Write zeros in the destination.
	InstallOperation_DISCARD       InstallOperation_Type = 7  // Discard the destination blocks, reading as undefined.
	InstallOperation_BROTLI_BSDIFF InstallOperation_Type = 10 // Like SOURCE_BSDIFF, but compressed with brotli.
	// On minor version 5 or newer, these operations are supported:
	InstallOperation_PUFFDIFF InstallOperation_Type = 9 // The data is in puffdiff format.
	// On minor version 8 or newer, these operations are supported:
	InstallOperation_ZUCCHINI InstallOperation_Type = 11
	// On minor version 9 or newer, these operations are supported:
	InstallOperation_LZ4DIFF_BSDIFF   InstallOperation_Type = 12
	InstallOperation_LZ4DIFF_PUFFDIFF InstallOperation_Type = 13
)

func (InstallOperation_Type) Descriptor

func (InstallOperation_Type) Enum

func (InstallOperation_Type) EnumDescriptor deprecated

func (InstallOperation_Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use InstallOperation_Type.Descriptor instead.

func (InstallOperation_Type) Number

func (InstallOperation_Type) String

func (x InstallOperation_Type) String() string

func (InstallOperation_Type) Type

type InstallOps

type InstallOps struct {
	Map     []*InstallOpsPartition //Used to map a raw operation step to a partition
	Ops     []*InstallOperation    //Buffered install operation steps
	Steps   []InstallOpStep        //Ordered index mapping of install operations
	Session *InstallOpsSession     //Tracks an ongoing installation

	Payload    *Payload //The raw payload holding these ops
	BlockSize  uint64   //The size to zero-pad install operations to
	BaseOffset uint64   //Offset of install data after header
	// contains filtered or unexported fields
}

func NewInstallOps

func NewInstallOps(payload *Payload, outDir string) (*InstallOps, error)

func (*InstallOps) Run

func (iops *InstallOps) Run()

type InstallOpsPartition

type InstallOpsPartition struct {
	sync.Mutex //Locks writes to the extracted file

	Name string
	Ops  int
	Size uint64
	File *os.File
}

type InstallOpsSession

type InstallOpsSession struct {
	sync.Mutex //Locks changes to stats to prevent stat confusion

	Threads sync.WaitGroup //Threads remaining
}

type InstallSession

type InstallSession struct {
	Payloads []*Payload
	Usage    InstallSessionUsage
	Debug    bool
	// contains filtered or unexported fields
}

func NewInstallSession

func NewInstallSession(input string, extract []string, outDir string) (*InstallSession, error)

func NewInstallSessionMulti

func NewInstallSessionMulti(input, extract []string, outDir string) (*InstallSession, error)

func (*InstallSession) AddPayload

func (is *InstallSession) AddPayload(in string, extract []string, outDir string) (err error)

func (*InstallSession) Close

func (is *InstallSession) Close()

func (*InstallSession) Install

func (is *InstallSession) Install()

func (*InstallSession) IsClosed

func (is *InstallSession) IsClosed() bool

func (*InstallSession) IsInstalling

func (is *InstallSession) IsInstalling() bool

func (*InstallSession) SetDebug

func (is *InstallSession) SetDebug(b bool)

func (*InstallSession) SetMemoryLimit

func (is *InstallSession) SetMemoryLimit(i uint64)

type InstallSessionUsage

type InstallSessionUsage struct {
	sync.Mutex
	// contains filtered or unexported fields
}

type OtaMetadata

type OtaMetadata struct {
	Type OtaMetadata_OtaType `protobuf:"varint,1,opt,name=type,proto3,enum=chromeos_update_engine.OtaMetadata_OtaType" json:"type,omitempty"`
	// True if we need to wipe after the update.
	Wipe bool `protobuf:"varint,2,opt,name=wipe,proto3" json:"wipe,omitempty"`
	// True if the timestamp of the post build is older than the pre build.
	Downgrade bool `protobuf:"varint,3,opt,name=downgrade,proto3" json:"downgrade,omitempty"`
	// A map of name:content of property files, e.g. ota-property-files.
	PropertyFiles map[string]string `` /* 188-byte string literal not displayed */
	// The required device state in order to install the package.
	Precondition *DeviceState `protobuf:"bytes,5,opt,name=precondition,proto3" json:"precondition,omitempty"`
	// The expected device state after the update.
	Postcondition *DeviceState `protobuf:"bytes,6,opt,name=postcondition,proto3" json:"postcondition,omitempty"`
	// True if the ota that updates a device to support dynamic partitions, where
	// the source build doesn't support it.
	RetrofitDynamicPartitions bool `` /* 139-byte string literal not displayed */
	// The required size of the cache partition, only valid for non-A/B update.
	RequiredCache int64 `protobuf:"varint,8,opt,name=required_cache,json=requiredCache,proto3" json:"required_cache,omitempty"`
	// True iff security patch level downgrade is permitted on this OTA.
	SplDowngrade bool `protobuf:"varint,9,opt,name=spl_downgrade,json=splDowngrade,proto3" json:"spl_downgrade,omitempty"`
	// contains filtered or unexported fields
}

The metadata of an OTA package. It contains the information of the package and prerequisite to install the update correctly.

func (*OtaMetadata) Descriptor deprecated

func (*OtaMetadata) Descriptor() ([]byte, []int)

Deprecated: Use OtaMetadata.ProtoReflect.Descriptor instead.

func (*OtaMetadata) GetDowngrade

func (x *OtaMetadata) GetDowngrade() bool

func (*OtaMetadata) GetPostcondition

func (x *OtaMetadata) GetPostcondition() *DeviceState

func (*OtaMetadata) GetPrecondition

func (x *OtaMetadata) GetPrecondition() *DeviceState

func (*OtaMetadata) GetPropertyFiles

func (x *OtaMetadata) GetPropertyFiles() map[string]string

func (*OtaMetadata) GetRequiredCache

func (x *OtaMetadata) GetRequiredCache() int64

func (*OtaMetadata) GetRetrofitDynamicPartitions

func (x *OtaMetadata) GetRetrofitDynamicPartitions() bool

func (*OtaMetadata) GetSplDowngrade

func (x *OtaMetadata) GetSplDowngrade() bool

func (*OtaMetadata) GetType

func (x *OtaMetadata) GetType() OtaMetadata_OtaType

func (*OtaMetadata) GetWipe

func (x *OtaMetadata) GetWipe() bool

func (*OtaMetadata) ProtoMessage

func (*OtaMetadata) ProtoMessage()

func (*OtaMetadata) ProtoReflect

func (x *OtaMetadata) ProtoReflect() protoreflect.Message

func (*OtaMetadata) Reset

func (x *OtaMetadata) Reset()

func (*OtaMetadata) String

func (x *OtaMetadata) String() string

type OtaMetadata_OtaType

type OtaMetadata_OtaType int32
const (
	OtaMetadata_UNKNOWN OtaMetadata_OtaType = 0
	OtaMetadata_AB      OtaMetadata_OtaType = 1
	OtaMetadata_BLOCK   OtaMetadata_OtaType = 2
	OtaMetadata_BRICK   OtaMetadata_OtaType = 3
)

func (OtaMetadata_OtaType) Descriptor

func (OtaMetadata_OtaType) Enum

func (OtaMetadata_OtaType) EnumDescriptor deprecated

func (OtaMetadata_OtaType) EnumDescriptor() ([]byte, []int)

Deprecated: Use OtaMetadata_OtaType.Descriptor instead.

func (OtaMetadata_OtaType) Number

func (OtaMetadata_OtaType) String

func (x OtaMetadata_OtaType) String() string

func (OtaMetadata_OtaType) Type

type PartitionInfo

type PartitionInfo struct {
	Size *uint64 `protobuf:"varint,1,opt,name=size,proto3,oneof" json:"size,omitempty"`
	Hash []byte  `protobuf:"bytes,2,opt,name=hash,proto3,oneof" json:"hash,omitempty"`
	// contains filtered or unexported fields
}

func (*PartitionInfo) Descriptor deprecated

func (*PartitionInfo) Descriptor() ([]byte, []int)

Deprecated: Use PartitionInfo.ProtoReflect.Descriptor instead.

func (*PartitionInfo) GetHash

func (x *PartitionInfo) GetHash() []byte

func (*PartitionInfo) GetSize

func (x *PartitionInfo) GetSize() uint64

func (*PartitionInfo) ProtoMessage

func (*PartitionInfo) ProtoMessage()

func (*PartitionInfo) ProtoReflect

func (x *PartitionInfo) ProtoReflect() protoreflect.Message

func (*PartitionInfo) Reset

func (x *PartitionInfo) Reset()

func (*PartitionInfo) String

func (x *PartitionInfo) String() string

type PartitionState

type PartitionState struct {
	PartitionName string   `protobuf:"bytes,1,opt,name=partition_name,json=partitionName,proto3" json:"partition_name,omitempty"`
	Device        []string `protobuf:"bytes,2,rep,name=device,proto3" json:"device,omitempty"`
	Build         []string `protobuf:"bytes,3,rep,name=build,proto3" json:"build,omitempty"`
	// The version string of the partition. It's usually timestamp if present.
	// One known exception is the boot image, who uses the kmi version, e.g.
	// 5.4.42-android12-0
	Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

The build information of a particular partition on the device.

func (*PartitionState) Descriptor deprecated

func (*PartitionState) Descriptor() ([]byte, []int)

Deprecated: Use PartitionState.ProtoReflect.Descriptor instead.

func (*PartitionState) GetBuild

func (x *PartitionState) GetBuild() []string

func (*PartitionState) GetDevice

func (x *PartitionState) GetDevice() []string

func (*PartitionState) GetPartitionName

func (x *PartitionState) GetPartitionName() string

func (*PartitionState) GetVersion

func (x *PartitionState) GetVersion() string

func (*PartitionState) ProtoMessage

func (*PartitionState) ProtoMessage()

func (*PartitionState) ProtoReflect

func (x *PartitionState) ProtoReflect() protoreflect.Message

func (*PartitionState) Reset

func (x *PartitionState) Reset()

func (*PartitionState) String

func (x *PartitionState) String() string

type PartitionUpdate

type PartitionUpdate struct {

	// A platform-specific name to identify the partition set being updated. For
	// example, in Chrome OS this could be "ROOT" or "KERNEL".
	PartitionName string `protobuf:"bytes,1,opt,name=partition_name,json=partitionName,proto3" json:"partition_name,omitempty"`
	// Whether this partition carries a filesystem with post-install program that
	// must be run to finalize the update process. See also |postinstall_path| and
	// |filesystem_type|.
	RunPostinstall *bool `protobuf:"varint,2,opt,name=run_postinstall,json=runPostinstall,proto3,oneof" json:"run_postinstall,omitempty"`
	// The path of the executable program to run during the post-install step,
	// relative to the root of this filesystem. If not set, the default "postinst"
	// will be used. This setting is only used when |run_postinstall| is set and
	// true.
	PostinstallPath *string `protobuf:"bytes,3,opt,name=postinstall_path,json=postinstallPath,proto3,oneof" json:"postinstall_path,omitempty"`
	// The filesystem type as passed to the mount(2) syscall when mounting the new
	// filesystem to run the post-install program. If not set, a fixed list of
	// filesystems will be attempted. This setting is only used if
	// |run_postinstall| is set and true.
	FilesystemType *string `protobuf:"bytes,4,opt,name=filesystem_type,json=filesystemType,proto3,oneof" json:"filesystem_type,omitempty"`
	// If present, a list of signatures of the new_partition_info.hash signed with
	// different keys. If the update_engine daemon requires vendor-signed images
	// and has its public key installed, one of the signatures should be valid
	// for /postinstall to run.
	NewPartitionSignature []*Signatures_Signature `` /* 126-byte string literal not displayed */
	OldPartitionInfo      *PartitionInfo          `protobuf:"bytes,6,opt,name=old_partition_info,json=oldPartitionInfo,proto3,oneof" json:"old_partition_info,omitempty"`
	NewPartitionInfo      *PartitionInfo          `protobuf:"bytes,7,opt,name=new_partition_info,json=newPartitionInfo,proto3,oneof" json:"new_partition_info,omitempty"`
	// The list of operations to be performed to apply this PartitionUpdate. The
	// associated operation blobs (in operations[i].data_offset, data_length)
	// should be stored contiguously and in the same order.
	Operations []*InstallOperation `protobuf:"bytes,8,rep,name=operations,proto3" json:"operations,omitempty"`
	// Whether a failure in the postinstall step for this partition should be
	// ignored.
	PostinstallOptional *bool `protobuf:"varint,9,opt,name=postinstall_optional,json=postinstallOptional,proto3,oneof" json:"postinstall_optional,omitempty"`
	// The extent for data covered by verity hash tree.
	HashTreeDataExtent *Extent `` /* 126-byte string literal not displayed */
	// The extent to store verity hash tree.
	HashTreeExtent *Extent `protobuf:"bytes,11,opt,name=hash_tree_extent,json=hashTreeExtent,proto3,oneof" json:"hash_tree_extent,omitempty"`
	// The hash algorithm used in verity hash tree.
	HashTreeAlgorithm *string `protobuf:"bytes,12,opt,name=hash_tree_algorithm,json=hashTreeAlgorithm,proto3,oneof" json:"hash_tree_algorithm,omitempty"`
	// The salt used for verity hash tree.
	HashTreeSalt []byte `protobuf:"bytes,13,opt,name=hash_tree_salt,json=hashTreeSalt,proto3,oneof" json:"hash_tree_salt,omitempty"`
	// The extent for data covered by FEC.
	FecDataExtent *Extent `protobuf:"bytes,14,opt,name=fec_data_extent,json=fecDataExtent,proto3,oneof" json:"fec_data_extent,omitempty"`
	// The extent to store FEC.
	FecExtent *Extent `protobuf:"bytes,15,opt,name=fec_extent,json=fecExtent,proto3,oneof" json:"fec_extent,omitempty"`
	// The number of FEC roots (default should be 2).
	FecRoots *uint32 `protobuf:"varint,16,opt,name=fec_roots,json=fecRoots,proto3,oneof" json:"fec_roots,omitempty"`
	// Per-partition version used for downgrade detection, added
	// as an effort to support partial updates. For most partitions,
	// this is the build timestamp.
	Version *string `protobuf:"bytes,17,opt,name=version,proto3,oneof" json:"version,omitempty"`
	// A sorted list of CowMergeOperation. When writing cow, we can choose to
	// skip writing the raw bytes for these extents. During snapshot merge, the
	// bytes will read from the source partitions instead.
	MergeOperations []*CowMergeOperation `protobuf:"bytes,18,rep,name=merge_operations,json=mergeOperations,proto3" json:"merge_operations,omitempty"`
	// Estimated size for COW image. This is used by libsnapshot
	// as a hint. If set to 0, libsnapshot should use alternative
	// methods for estimating size.
	EstimateCowSize *uint64 `protobuf:"varint,19,opt,name=estimate_cow_size,json=estimateCowSize,proto3,oneof" json:"estimate_cow_size,omitempty"`
	// contains filtered or unexported fields
}

Describes the update to apply to a single partition.

func (*PartitionUpdate) Descriptor deprecated

func (*PartitionUpdate) Descriptor() ([]byte, []int)

Deprecated: Use PartitionUpdate.ProtoReflect.Descriptor instead.

func (*PartitionUpdate) GetEstimateCowSize

func (x *PartitionUpdate) GetEstimateCowSize() uint64

func (*PartitionUpdate) GetFecDataExtent

func (x *PartitionUpdate) GetFecDataExtent() *Extent

func (*PartitionUpdate) GetFecExtent

func (x *PartitionUpdate) GetFecExtent() *Extent

func (*PartitionUpdate) GetFecRoots

func (x *PartitionUpdate) GetFecRoots() uint32

func (*PartitionUpdate) GetFilesystemType

func (x *PartitionUpdate) GetFilesystemType() string

func (*PartitionUpdate) GetHashTreeAlgorithm

func (x *PartitionUpdate) GetHashTreeAlgorithm() string

func (*PartitionUpdate) GetHashTreeDataExtent

func (x *PartitionUpdate) GetHashTreeDataExtent() *Extent

func (*PartitionUpdate) GetHashTreeExtent

func (x *PartitionUpdate) GetHashTreeExtent() *Extent

func (*PartitionUpdate) GetHashTreeSalt

func (x *PartitionUpdate) GetHashTreeSalt() []byte

func (*PartitionUpdate) GetMergeOperations

func (x *PartitionUpdate) GetMergeOperations() []*CowMergeOperation

func (*PartitionUpdate) GetNewPartitionInfo

func (x *PartitionUpdate) GetNewPartitionInfo() *PartitionInfo

func (*PartitionUpdate) GetNewPartitionSignature

func (x *PartitionUpdate) GetNewPartitionSignature() []*Signatures_Signature

func (*PartitionUpdate) GetOldPartitionInfo

func (x *PartitionUpdate) GetOldPartitionInfo() *PartitionInfo

func (*PartitionUpdate) GetOperations

func (x *PartitionUpdate) GetOperations() []*InstallOperation

func (*PartitionUpdate) GetPartitionName

func (x *PartitionUpdate) GetPartitionName() string

func (*PartitionUpdate) GetPostinstallOptional

func (x *PartitionUpdate) GetPostinstallOptional() bool

func (*PartitionUpdate) GetPostinstallPath

func (x *PartitionUpdate) GetPostinstallPath() string

func (*PartitionUpdate) GetRunPostinstall

func (x *PartitionUpdate) GetRunPostinstall() bool

func (*PartitionUpdate) GetVersion

func (x *PartitionUpdate) GetVersion() string

func (*PartitionUpdate) ProtoMessage

func (*PartitionUpdate) ProtoMessage()

func (*PartitionUpdate) ProtoReflect

func (x *PartitionUpdate) ProtoReflect() protoreflect.Message

func (*PartitionUpdate) Reset

func (x *PartitionUpdate) Reset()

func (*PartitionUpdate) String

func (x *PartitionUpdate) String() string

type Payload

type Payload struct {
	sync.Mutex //Locks attempts to seek or read the consumer

	Temporary bool
	In        string
	Extract   []string
	Manifest  *DeltaArchiveManifest
	Metadata  *OtaMetadata

	BaseOffset uint64
	BlockSize  uint64
	Partitions []*PartitionUpdate

	Consumer         *PayloadConsumer
	MetadataConsumer io.ReadCloser
	Installer        *InstallOps
	InstallSession   *InstallSession
}

func NewPayloadFile

func NewPayloadFile(in string, extract []string, extractArchive bool) (*Payload, error)

func NewPayloadURL

func NewPayloadURL(in string, extract []string) (*Payload, error)

func (*Payload) Close

func (payload *Payload) Close() error

func (*Payload) Parse

func (payload *Payload) Parse() error

func (*Payload) ReadBytes

func (payload *Payload) ReadBytes(offset, length int64) ([]byte, error)

func (*Payload) String

func (payload *Payload) String() string

type PayloadConsumer

type PayloadConsumer struct {
	Seekable io.ReadSeekCloser
	Readable io.ReadCloser
}

func (PayloadConsumer) Close

func (pc PayloadConsumer) Close() error

func (PayloadConsumer) Read

func (pc PayloadConsumer) Read(p []byte) (int, error)

func (PayloadConsumer) Seek

func (pc PayloadConsumer) Seek(offset int64, whence int) (int64, error)

type Signatures

type Signatures struct {
	Signatures []*Signatures_Signature `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"`
	// contains filtered or unexported fields
}

func (*Signatures) Descriptor deprecated

func (*Signatures) Descriptor() ([]byte, []int)

Deprecated: Use Signatures.ProtoReflect.Descriptor instead.

func (*Signatures) GetSignatures

func (x *Signatures) GetSignatures() []*Signatures_Signature

func (*Signatures) ProtoMessage

func (*Signatures) ProtoMessage()

func (*Signatures) ProtoReflect

func (x *Signatures) ProtoReflect() protoreflect.Message

func (*Signatures) Reset

func (x *Signatures) Reset()

func (*Signatures) String

func (x *Signatures) String() string

type Signatures_Signature

type Signatures_Signature struct {

	// Deprecated: Marked as deprecated in aota.proto.
	Version *uint32 `protobuf:"varint,1,opt,name=version,proto3,oneof" json:"version,omitempty"`
	Data    []byte  `protobuf:"bytes,2,opt,name=data,proto3,oneof" json:"data,omitempty"`
	// The DER encoded signature size of EC keys is nondeterministic for
	// different input of sha256 hash. However, we need the size of the
	// serialized signatures protobuf string to be fixed before signing;
	// because this size is part of the content to be signed. Therefore, we
	// always pad the signature data to the maximum possible signature size of
	// a given key. And the payload verifier will truncate the signature to
	// its correct size based on the value of |unpadded_signature_size|.
	UnpaddedSignatureSize *uint32 `` /* 134-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Signatures_Signature) Descriptor deprecated

func (*Signatures_Signature) Descriptor() ([]byte, []int)

Deprecated: Use Signatures_Signature.ProtoReflect.Descriptor instead.

func (*Signatures_Signature) GetData

func (x *Signatures_Signature) GetData() []byte

func (*Signatures_Signature) GetUnpaddedSignatureSize

func (x *Signatures_Signature) GetUnpaddedSignatureSize() uint32

func (*Signatures_Signature) GetVersion deprecated

func (x *Signatures_Signature) GetVersion() uint32

Deprecated: Marked as deprecated in aota.proto.

func (*Signatures_Signature) ProtoMessage

func (*Signatures_Signature) ProtoMessage()

func (*Signatures_Signature) ProtoReflect

func (x *Signatures_Signature) ProtoReflect() protoreflect.Message

func (*Signatures_Signature) Reset

func (x *Signatures_Signature) Reset()

func (*Signatures_Signature) String

func (x *Signatures_Signature) String() string

type VABCFeatureSet

type VABCFeatureSet struct {
	Threaded    *bool `protobuf:"varint,1,opt,name=threaded,proto3,oneof" json:"threaded,omitempty"`
	BatchWrites *bool `protobuf:"varint,2,opt,name=batch_writes,json=batchWrites,proto3,oneof" json:"batch_writes,omitempty"`
	// contains filtered or unexported fields
}

func (*VABCFeatureSet) Descriptor deprecated

func (*VABCFeatureSet) Descriptor() ([]byte, []int)

Deprecated: Use VABCFeatureSet.ProtoReflect.Descriptor instead.

func (*VABCFeatureSet) GetBatchWrites

func (x *VABCFeatureSet) GetBatchWrites() bool

func (*VABCFeatureSet) GetThreaded

func (x *VABCFeatureSet) GetThreaded() bool

func (*VABCFeatureSet) ProtoMessage

func (*VABCFeatureSet) ProtoMessage()

func (*VABCFeatureSet) ProtoReflect

func (x *VABCFeatureSet) ProtoReflect() protoreflect.Message

func (*VABCFeatureSet) Reset

func (x *VABCFeatureSet) Reset()

func (*VABCFeatureSet) String

func (x *VABCFeatureSet) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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