apk

package
v0.0.0-...-51829f3 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityAction

type ActivityAction struct {
	Name binary.String `xml:"http://schemas.android.com/apk/res/android name,attr"`
}

ActivityAction is an action of an activity.

type ActivityCategory

type ActivityCategory struct {
	Name binary.String `xml:"http://schemas.android.com/apk/res/android name,attr"`
}

ActivityCategory is a category of an activity.

type ActivityIntentFilter

type ActivityIntentFilter struct {
	Actions    []ActivityAction   `xml:"action"`
	Categories []ActivityCategory `xml:"category"`
}

ActivityIntentFilter is an binary.Int32ent filter of an activity.

type Apk

type Apk struct {
	// contains filtered or unexported fields
}

Apk is an application package file for android.

func Open

func Open(filename string) (apk *Apk, err error)

OpenFile will open the file specified by filename and return Apk

func OpenZipReader

func OpenZipReader(r io.ReaderAt, size int64) (*Apk, error)

OpenZipReader has same arguments like zip.NewReader

func (*Apk) Close

func (k *Apk) Close() error

Close is avaliable only if apk is created with OpenFile

func (*Apk) Icon

func (k *Apk) Icon(resConfig *binary.ResTableConfig) (image.Image, error)

Icon returns the icon image of the APK.

func (*Apk) Label

func (k *Apk) Label(resConfig *binary.ResTableConfig) (s string, err error)

Label returns the label of the APK.

func (*Apk) MainActivity

func (k *Apk) MainActivity() (activity string, err error)

MainActivity returns the name of the main activity.

func (*Apk) Manifest

func (k *Apk) Manifest() Manifest

Manifest returns the manifest of the APK.

func (*Apk) PackageName

func (k *Apk) PackageName() string

PackageName returns the package name of the APK.

type AppActivity

type AppActivity struct {
	Theme             binary.String          `xml:"http://schemas.android.com/apk/res/android theme,attr"`
	Name              binary.String          `xml:"http://schemas.android.com/apk/res/android name,attr"`
	Label             binary.String          `xml:"http://schemas.android.com/apk/res/android label,attr"`
	ScreenOrientation binary.String          `xml:"http://schemas.android.com/apk/res/android screenOrientation,attr"`
	IntentFilters     []ActivityIntentFilter `xml:"intent-filter"`
}

AppActivity is an activity in an application.

type AppActivityAlias

type AppActivityAlias struct {
	Name           binary.String          `xml:"http://schemas.android.com/apk/res/android name,attr"`
	Label          binary.String          `xml:"http://schemas.android.com/apk/res/android label,attr"`
	TargetActivity binary.String          `xml:"http://schemas.android.com/apk/res/android targetActivity,attr"`
	IntentFilters  []ActivityIntentFilter `xml:"intent-filter"`
}

AppActivityAlias https://developer.android.com/guide/topics/manifest/activity-alias-element

type Application

type Application struct {
	AllowTaskReparenting  binary.Bool        `xml:"http://schemas.android.com/apk/res/android allowTaskReparenting,attr"`
	AllowBackup           binary.Bool        `xml:"http://schemas.android.com/apk/res/android allowBackup,attr"`
	BackupAgent           binary.String      `xml:"http://schemas.android.com/apk/res/android backupAgent,attr"`
	Debuggable            binary.Bool        `xml:"http://schemas.android.com/apk/res/android debuggable,attr"`
	Description           binary.String      `xml:"http://schemas.android.com/apk/res/android description,attr"`
	Enabled               binary.Bool        `xml:"http://schemas.android.com/apk/res/android enabled,attr"`
	HasCode               binary.Bool        `xml:"http://schemas.android.com/apk/res/android hasCode,attr"`
	HardwareAccelerated   binary.Bool        `xml:"http://schemas.android.com/apk/res/android hardwareAccelerated,attr"`
	Icon                  binary.String      `xml:"http://schemas.android.com/apk/res/android icon,attr"`
	KillAfterRestore      binary.Bool        `xml:"http://schemas.android.com/apk/res/android killAfterRestore,attr"`
	LargeHeap             binary.Bool        `xml:"http://schemas.android.com/apk/res/android largeHeap,attr"`
	Label                 binary.String      `xml:"http://schemas.android.com/apk/res/android label,attr"`
	ManageSpaceActivity   binary.String      `xml:"http://schemas.android.com/apk/res/android manageSpaceActivity,attr"`
	Name                  binary.String      `xml:"http://schemas.android.com/apk/res/android name,attr"`
	Permission            binary.String      `xml:"http://schemas.android.com/apk/res/android permission,attr"`
	Persistent            binary.Bool        `xml:"http://schemas.android.com/apk/res/android persistent,attr"`
	Process               binary.String      `xml:"http://schemas.android.com/apk/res/android process,attr"`
	RestoreAnyVersion     binary.Bool        `xml:"http://schemas.android.com/apk/res/android restoreAnyVersion,attr"`
	RequiredAccountType   binary.String      `xml:"http://schemas.android.com/apk/res/android requiredAccountType,attr"`
	RestrictedAccountType binary.String      `xml:"http://schemas.android.com/apk/res/android restrictedAccountType,attr"`
	SupportsRtl           binary.Bool        `xml:"http://schemas.android.com/apk/res/android supportsRtl,attr"`
	TaskAffinity          binary.String      `xml:"http://schemas.android.com/apk/res/android taskAffinity,attr"`
	TestOnly              binary.Bool        `xml:"http://schemas.android.com/apk/res/android testOnly,attr"`
	Theme                 binary.String      `xml:"http://schemas.android.com/apk/res/android theme,attr"`
	UIOptions             binary.String      `xml:"http://schemas.android.com/apk/res/android uiOptions,attr"`
	VMSafeMode            binary.Bool        `xml:"http://schemas.android.com/apk/res/android vmSafeMode,attr"`
	Activities            []AppActivity      `xml:"activity"`
	ActivityAliases       []AppActivityAlias `xml:"activity-alias"`
	MetaData              []MetaData         `xml:"meta-data"`
}

Application is an application in an APK.

type Instrumentation

type Instrumentation struct {
	Name            binary.String `xml:"http://schemas.android.com/apk/res/android name,attr"`
	Target          binary.String `xml:"http://schemas.android.com/apk/res/android targetPackage,attr"`
	HandleProfiling binary.Bool   `xml:"http://schemas.android.com/apk/res/android handleProfiling,attr"`
	FunctionalTest  binary.Bool   `xml:"http://schemas.android.com/apk/res/android functionalTest,attr"`
}

Instrumentation is an application instrumentation code.

type Manifest

type Manifest struct {
	Package                   binary.String    `xml:"package,attr"`
	CompileSDKVersion         binary.Int32     `xml:"http://schemas.android.com/apk/res/android compileSdkVersion,attr"`
	CompileSDKVersionCodename binary.String    `xml:"http://schemas.android.com/apk/res/android compileSdkVersionCodename,attr"`
	VersionCode               binary.Int32     `xml:"http://schemas.android.com/apk/res/android versionCode,attr"`
	VersionName               binary.String    `xml:"http://schemas.android.com/apk/res/android versionName,attr"`
	App                       Application      `xml:"application"`
	Instrument                Instrumentation  `xml:"instrumentation"`
	SDK                       UsesSDK          `xml:"uses-sdk"`
	UsesPermissions           []UsesPermission `xml:"uses-permission"`
}

Manifest is a manifest of an APK.

type MetaData

type MetaData struct {
	Name  binary.String `xml:"http://schemas.android.com/apk/res/android name,attr"`
	Value binary.String `xml:"http://schemas.android.com/apk/res/android value,attr"`
}

MetaData is a metadata in an application.

type UsesPermission

type UsesPermission struct {
	Name binary.String `xml:"http://schemas.android.com/apk/res/android name,attr"`
	Max  binary.Int32  `xml:"http://schemas.android.com/apk/res/android maxSdkVersion,attr"`
}

UsesPermission is user grant the system permission.

type UsesSDK

type UsesSDK struct {
	Min    binary.Int32 `xml:"http://schemas.android.com/apk/res/android minSdkVersion,attr"`
	Target binary.Int32 `xml:"http://schemas.android.com/apk/res/android targetSdkVersion,attr"`
	Max    binary.Int32 `xml:"http://schemas.android.com/apk/res/android maxSdkVersion,attr"`
}

UsesSDK is target SDK version.

Jump to

Keyboard shortcuts

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