apk

package
v0.4.17 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package apk handles APK parsing, metadata extraction, and signature verification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractCertificate

func ExtractCertificate(path string) (*x509.Certificate, error)

ExtractCertificate extracts the signing certificate from an APK file. Returns the x509 certificate used to sign the APK.

Types

type APKInfo

type APKInfo struct {
	// Package identifier (e.g., "com.example.app")
	PackageID string

	// Version information
	VersionName string
	VersionCode int64

	// SDK versions
	MinSDK    int32
	TargetSDK int32

	// App metadata
	Label string // App name

	// Native architectures (e.g., ["arm64-v8a", "armeabi-v7a"])
	Architectures []string

	// Android permissions (e.g., ["android.permission.INTERNET", "android.permission.CAMERA"])
	Permissions []string

	// Required device features declared by the manifest.
	Features []string

	// Certificate SHA-256 fingerprint (hex encoded, lowercase)
	CertFingerprint string

	// Icon PNG bytes (nil if not found or extraction failed)
	Icon []byte

	// File information
	FilePath string
	FileSize int64
	SHA256   string
}

APKInfo contains extracted metadata from an APK file.

func Parse

func Parse(path string) (*APKInfo, error)

Parse extracts metadata from an APK file.

func (*APKInfo) HasGoogleDependency

func (a *APKInfo) HasGoogleDependency() bool

HasGoogleDependency checks if the APK might have Google Play dependencies based on the package ID patterns.

func (*APKInfo) IsArm64

func (a *APKInfo) IsArm64() bool

IsArm64 returns true if the APK supports arm64-v8a architecture.

func (*APKInfo) IsWatch added in v0.4.13

func (a *APKInfo) IsWatch() bool

IsWatch returns true if the APK declares the standard Android watch device feature used by Wear OS applications.

func (*APKInfo) String

func (a *APKInfo) String() string

String returns a human-readable summary of the APK.

type ResConfig

type ResConfig = androidbinary.ResTableConfig

ResConfig represents a resource configuration for localization.

Jump to

Keyboard shortcuts

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