apk

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: Apache-2.0, MIT Imports: 9 Imported by: 1

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manifest

type Manifest struct {
	XMLName                   xml.Name `xml:"manifest"`
	Android                   string   `xml:"android,attr,omitempty"`
	VersionCode               string   `xml:"versionCode,attr,omitempty"`
	VersionName               string   `xml:"versionName,attr,omitempty"`
	CompileSdkVersion         string   `xml:"compileSdkVersion,attr,omitempty"`
	CompileSdkVersionCodename string   `xml:"compileSdkVersionCodename,attr,omitempty"`
	Package                   string   `xml:"package,attr,omitempty"`
	PlatformBuildVersionCode  string   `xml:"platformBuildVersionCode,attr,omitempty"`
	PlatformBuildVersionName  string   `xml:"platformBuildVersionName,attr,omitempty"`
	UsesSdk                   struct {
		MinSdkVersion    string `xml:"minSdkVersion,attr,omitempty"`
		TargetSdkVersion string `xml:"targetSdkVersion,attr,omitempty"`
	} `xml:"uses-sdk,omitempty"`
	UsesPermission []struct {
		Name string `xml:"name,attr,omitempty"`
	} `xml:"uses-permission,omitempty"`
	UsesFeature []struct {
		Name     string `xml:"name,attr,omitempty"`
		Required bool   `xml:"required,attr,omitempty"`
	} `xml:"uses-feature,omitempty"`
	Application ManifestApplication `xml:"application"`
}

Manifest implements https://developer.android.com/guide/topics/manifest/manifest-element

func (Manifest) MainActivity

func (m Manifest) MainActivity() *ManifestActivity

type ManifestActivity

type ManifestActivity struct {
	Label               string               `xml:"label,attr,omitempty"`
	Name                string               `xml:"name,attr,omitempty"`
	LaunchMode          string               `xml:"launchMode,attr,omitempty"`
	ScreenOrientation   string               `xml:"screenOrientation,attr,omitempty"`
	ConfigChanges       string               `xml:"configChanges,attr,omitempty"`
	WindowSoftInputMode string               `xml:"windowSoftInputMode,attr,omitempty"`
	Theme               string               `xml:"theme,attr,omitempty"`
	Exported            bool                 `xml:"exported,attr,omitempty"`
	IntentFilter        ManifestIntentFilter `xml:"intent-filter"`
}

ManifestActivity implements https://developer.android.com/guide/topics/manifest/activity-element

type ManifestApplication

type ManifestApplication struct {
	Theme                 string             `xml:"theme,attr,omitempty"`
	Label                 string             `xml:"label,attr,omitempty"`
	Icon                  string             `xml:"icon,attr,omitempty"`
	Name                  string             `xml:"name,attr,omitempty"`
	AllowBackup           bool               `xml:"allowBackup,attr,omitempty"`
	SupportsRtl           bool               `xml:"supportsRtl,attr,omitempty"`
	NetworkSecurityConfig string             `xml:"networkSecurityConfig,attr,omitempty"`
	RoundIcon             string             `xml:"roundIcon,attr,omitempty"`
	AppComponentFactory   string             `xml:"appComponentFactory,attr,omitempty"`
	Activity              []ManifestActivity `xml:"activity,omitempty"`
	MetaData              []ManifestMetadata `xml:"meta-data,omitempty"`
	Service               []ManifestService  `xml:"service,omitempty"`
	Provider              []ManifestProvider `xml:"provider,omitempty"`
	Receiver              struct {
		Name     string `xml:"name,attr,omitempty"`
		Exported bool   `xml:"exported,attr,omitempty"`
	} `xml:"receiver,omitempty"`
}

ManifestApplication implements https://developer.android.com/guide/topics/manifest/application-element

type ManifestIntentFilter

type ManifestIntentFilter struct {
	Action struct {
		Name string `xml:"name,attr,omitempty"`
	} `xml:"action"`
	Category struct {
		Name string `xml:"name,attr,omitempty"`
	} `xml:"category"`
}

ManifestIntentFilter implements https://developer.android.com/guide/topics/manifest/intent-filter-element

type ManifestMetadata

type ManifestMetadata struct {
	Name     string `xml:"name,attr,omitempty"`
	Value    string `xml:"value,attr,omitempty"`
	Resource string `xml:"resource,attr,omitempty"`
}

ManifestMetadata implements https://developer.android.com/guide/topics/manifest/meta-data-element0

type ManifestProvider

type ManifestProvider struct {
	Name                string               `xml:"name,attr,omitempty"`
	Exported            bool                 `xml:"exported,attr,omitempty"`
	Authorities         string               `xml:"authorities,attr,omitempty"`
	GrantURIPermissions bool                 `xml:"grantUriPermissions,attr,omitempty"`
	InitOrder           string               `xml:"initOrder,attr,omitempty"`
	DirectBootAware     bool                 `xml:"directBootAware,attr,omitempty"`
	MetaData            ManifestMetadata     `xml:"meta-data,omitempty"`
	IntentFilter        ManifestIntentFilter `xml:"intent-filter"`
}

ManifestProvider implements https://developer.android.com/guide/topics/manifest/provider-element

type ManifestService

type ManifestService struct {
	Name                  string               `xml:"name,attr,omitempty"`
	StopWithTask          bool                 `xml:"stopWithTask,attr,omitempty"`
	Process               string               `xml:"process,attr,omitempty"`
	IsolatedProcess       bool                 `xml:"isolatedProcess,attr,omitempty"`
	Exported              bool                 `xml:"exported,attr,omitempty"`
	Description           string               `xml:"description,attr,omitempty"`
	DirectBootAware       bool                 `xml:"directBootAware,attr,omitempty"`
	ForegroundServiceType string               `xml:"foregroundServiceType,attr,omitempty"`
	Enabled               bool                 `xml:"enabled,attr,omitempty"`
	Permission            string               `xml:"permission,attr,omitempty"`
	MetaData              []ManifestMetadata   `xml:"meta-data,omitempty"`
	IntentFilter          ManifestIntentFilter `xml:"intent-filter"`
}

ManifestService implements https://developer.android.com/guide/topics/manifest/service-element

type Package

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

func Open

func Open(path string) (*Package, error)
Example
package main

import (
	"fmt"

	"moul.io/pkgman/pkg/apk"
)

func main() {
	pkg, err := apk.Open("path/to/apk")
	if err != nil {
		panic(err)
	}
	defer pkg.Close()

	fmt.Printf("Loaded APK: %v\n", pkg)
}
Output:

func (*Package) Close

func (p *Package) Close() error

func (Package) File

func (p Package) File(name string) *zip.File

func (Package) FileBytes

func (p Package) FileBytes(name string) ([]byte, error)

func (Package) Files

func (p Package) Files() []*zip.File

func (Package) Manifest

func (p Package) Manifest() (*Manifest, error)

func (Package) ManifestJSON

func (p Package) ManifestJSON() (string, error)

func (Package) ManifestXML

func (p Package) ManifestXML() (string, error)

Jump to

Keyboard shortcuts

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