ApkInfGo

package module
v0.0.0-...-81e6a63 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2017 License: MIT Imports: 8 Imported by: 0

README

ApkInfGo

Golang parser for android apk files. It extracts version information, package name, etc.

##Example

package main

import "fmt"
import "github.com/Mr4Mike4/ApkInfGo"

func main() {
	aapt := "d:\\Android\\sdk\\build-tools\\24.0.0\\aapt.exe"
    keytool := "c:\\Program Files\\Java\\jdk1.8.0_92\\bin\\keytool.exe"

    // without information on the certificate
	//apk := ApkInfGo.ApkInfo(app).File("d:\\downloads\\file.apk")

	apk := ApkInfGo.ApkInfo(app).CertKeyTool(keytool).File("d:\\downloads\\file.apk")
	fmt.Printf("%q\n", *apk)

	apks := ApkInfGo.ApkInfo(app).CertKeyTool(keytool).Folder("d:\\downloads", true)
	if apks != nil {
		for _, file := range *apks {
			fmt.Printf("%q\n", file)
		}
		fmt.Printf("Count - %d\n", len(*apks))
	}

	cert := ApkInfGo.ApkCertificate(keytool).File("d:\\downloads\\file.apk")
    fmt.Printf("%q\n", *cert)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApkCertSt

type ApkCertSt struct {
	CertMD5       string
	CertSHA1      string
	CertSHA256    string
	SignAlgorithm string
	FilePath      string
}

type ApkInfoSt

type ApkInfoSt struct {
	Name               string
	VersionCode        uint32
	VersionName        string
	Label              string
	Icon               string
	SdkVersion         uint16
	TargetSdkVersion   uint16
	NativeCode         string
	FileSize           int64
	FilePath           string
	Cert               ApkCertSt
	LaunchableActivity string
}

type Conf

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

func ApkInfo

func ApkInfo(aaptApp string) *Conf

func (*Conf) CertKeyTool

func (c *Conf) CertKeyTool(keytoolApp string) *Conf

func (*Conf) File

func (c *Conf) File(apk string) *ApkInfoSt

func (*Conf) Folder

func (c *Conf) Folder(dirname string, recurcive bool) *[]ApkInfoSt

type ConfCert

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

func ApkCertificate

func ApkCertificate(keytoolApp string) *ConfCert

func (*ConfCert) File

func (c *ConfCert) File(apk string) *ApkCertSt

Jump to

Keyboard shortcuts

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