Coder Social home page Coder Social logo

androidbinary's Introduction

androidbinary

Build Status GoDoc

Android binary file parser

High Level API

Parse APK files

package main

import (
	"github.com/shogo82148/androidbinary/apk"
)

func main() {
	pkg, _ := apk.OpenFile("your-android-app.apk")
	defer pkg.Close()

	icon, _ := pkg.Icon(nil) // returns the icon of APK as image.Image
	pkgName := pkg.PackageName() // returns the package name

	resConfigEN := &androidbinary.ResTableConfig{
		Language: [2]uint8{uint8('e'), uint8('n')},
	}
	appLabel, _ = pkg.Label(resConfigEN) // get app label for en translation
}

Low Level API

Parse XML binary

package main

import (
	"encoding/xml"

	"github.com/shogo82148/androidbinary"
	"github.com/shogo82148/androidbinary/apk"
)

func main() {
	f, _ := os.Open("AndroidManifest.xml")
	xml, _ := androidbinary.NewXMLFile(f)
	reader := xml.Reader()

	// read XML from reader
	var manifest apk.Manifest
	data, _ := ioutil.ReadAll(reader)
	xml.Unmarshal(data, &manifest)
}

Parse Resource files

package main

import (
	"fmt"
	"github.com/shogo82148/androidbinary"
)

func main() {
	f, _ := os.Open("resources.arsc")
	rsc, _ := androidbinary.NewTableFile(f)
	resource, _ := rsc.GetResource(androidbinary.ResID(0xCAFEBABE), nil)
	fmt.Println(resource)
}

License

This software is released under the MIT License, see LICENSE.

androidbinary's People

Contributors

codeskyblue avatar dependabot-preview[bot] avatar dependabot[bot] avatar github-actions[bot] avatar gitig avatar radare avatar shogo82148 avatar tonywang avatar turtletrampom avatar zinego avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

androidbinary's Issues

support more image format

some apk icon image format is .webp,but not supported
use golang.org/x/image This repository holds supplementary Go image libraries.

How to open an .aab package?

An error occurred when I opened an aab package file: Openfile err:File "resources.arsc" not found.
Can it open the latest Android APP format——aab file.

How to range a TableFile?

Thank you for this amazing lib. I'm using it for apk analyzing in Go.

How can I range the *TableFile after NewTableFile() a resources.arsc ?

For example, I want to get all strings in string.xml, but do not know the exact ResID.

readStringPool fun has some bug

readStringPool fun has some bug

for i, start := range stringStarts {
var str string
var err error
sr.Seek(int64(sp.Header.StringStart+start), os.SEEK_SET)
if (sp.Header.Flags & UTF8_FLAG) == 0 {
fmt.Println("---- UTF16 ----")
str, err = readUTF16(sr)
} else {
str, err = readUTF8(sr)

        fmt.Println("---- UTF8 ---- :", str)
    }
    if err != nil {
        return nil, err
    }
    sp.Strings[i] = str
}

and
readUTF8 fun
fmt.Println("size:", size)
buf := make([]uint8, size)


printf:

size: 12
---- UTF8 ---- : error_layou // lost "t"
size: 12
---- UTF8 ---- : warning_ico // lost "n"

password

The encrypted APK cannot be parsed.And throw an error:"failed to read AndroidManifest.xml: zip: checksum error".

Got panic while parse pkg if it's AndroidManifest.xml has some problem.

ldfroezja.apk

panic: runtime error: index out of range [4294967167] with length 565

goroutine 22 [running]:
github.com/shogo82148/androidbinary.(*ResStringPool).GetString(...)
	/go/pkg/mod/github.com/shogo82148/[email protected]/common.go:119
github.com/shogo82148/androidbinary.(*XMLFile).GetString(...)
	/go/pkg/mod/github.com/shogo82148/[email protected]/xml.go:168
github.com/shogo82148/androidbinary.(*XMLFile).addNamespacePrefix(0x881b40?, 0x46ec90?, 0xc0?)
	/go/pkg/mod/github.com/shogo82148/[email protected]/xml.go:215 +0x5e
github.com/shogo82148/androidbinary.(*XMLFile).readEndElement(0xc00013fe30, 0xc00046ec90)
	/go/pkg/mod/github.com/shogo82148/[email protected]/xml.go:299 +0x10a
github.com/shogo82148/androidbinary.(*XMLFile).readChunk(0xc00013fe30, {0x8816c0?, 0xc0001b91a0}, 0x133e0)
	/go/pkg/mod/github.com/shogo82148/[email protected]/xml.go:157 +0x167
github.com/shogo82148/androidbinary.NewXMLFile({0x8816c0?, 0xc0001b91a0})
	/go/pkg/mod/github.com/shogo82148/[email protected]/xml.go:108 +0x14c
github.com/shogo82148/androidbinary/apk.(*Apk).parseManifest(0xc0001e4000)
	/go/pkg/mod/github.com/shogo82148/[email protected]/apk/apk.go:162 +0x125
github.com/shogo82148/androidbinary/apk.OpenZipReader({0x882000?, 0xc000012a68?}, 0x0?)
	/go/pkg/mod/github.com/shogo82148/[email protected]/apk/apk.go:61 +0x85

I am not familiar with the Android package. I just stumbled upon this panic, but there is no additional information on what happened.
If I find more information, I will keep you updated.

support axml icon parse

some apk's icon are axml, not a png or image file, could you help to build the svg file or png file

here are two apks, the icon are formed by axml, here is a.apk axml file content(a.zip/res/9TA.xml)

<?xml version="1.0" encoding="UTF-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@0x7F080623"></background>
    <foreground android:drawable="@0x7F080624"></foreground>
</adaptive-icon>

@0x7F080623 and @0x7F080624 are also axml file and here is the content, but i can not find @0x43D80000 or other resource from the resources.arsc

@0x7F080623

<?xml version="1.0" encoding="UTF-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="@0x0000C801"
    android:width="@0x0000C801" android:viewportWidth="@0x43D80000"
    android:viewportHeight="@0x43D80000">
    <path android:fillColor="@0x7F0602C3" android:pathData="M0,0h432v432h-432z"></path>
</vector>
@0x7F080624

<?xml version="1.0" encoding="UTF-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="@0x0000C801"
    android:width="@0x0000C801" android:viewportWidth="@0x43D80000"
    android:viewportHeight="@0x43D80000">
    <path android:fillColor="@0xFF000000"
        android:pathData="M122.6,190.6c-0.5,0 -1,-0.1 -1.4,-0.4c-0.3,-0.4 -0.5,-0.9 -0.4,-1.5v-49.4c-0.1,-0.5 0.1,-1 0.4,-1.4c0.4,-0.3 0.9,-0.5 1.4,-0.4h5.4c1,-0.1 1.9,0.6 2.1,1.6l0.5,1.9c1.6,-1.5 3.4,-2.7 5.4,-3.4c2,-0.8 4.2,-1.3 6.4,-1.3c4.4,-0.2 8.7,1.8 11.3,5.3c2.8,3.5 4.2,8.3 4.2,14.2c0.1,3.7 -0.6,7.4 -2.1,10.7c-1.2,2.8 -3.2,5.3 -5.7,7.1c-2.4,1.7 -5.3,2.5 -8.2,2.5c-2,0 -4,-0.3 -5.8,-1c-1.7,-0.6 -3.3,-1.5 -4.7,-2.7v16.2c0.1,0.5 -0.1,1 -0.4,1.4c-0.4,0.3 -0.9,0.5 -1.4,0.4L122.6,190.6zM138.9,168c2.8,0 4.8,-0.9 6.1,-2.8c1.3,-1.9 2,-4.9 2,-8.8c0,-4 -0.6,-7.1 -1.9,-8.9s-3.4,-2.8 -6.2,-2.8c-2.6,0 -5.1,0.7 -7.3,2v19.5C133.8,167.3 136.3,168 138.9,168L138.9,168z"></path>
    <path android:fillColor="@0xFF000000"
        android:pathData="M166.8,175.4c-0.9,0.2 -1.7,-0.4 -1.9,-1.3c0,-0.2 0,-0.4 0,-0.6v-34.2c-0.1,-0.5 0.1,-1.1 0.4,-1.5c0.4,-0.3 0.9,-0.5 1.4,-0.4h5.4c1,-0.1 1.9,0.6 2.1,1.6l1,4c1.6,-1.9 3.5,-3.4 5.6,-4.6c1.7,-0.9 3.7,-1.4 5.6,-1.4h1c0.5,-0.1 1.1,0.1 1.5,0.4c0.3,0.4 0.5,0.9 0.4,1.4v6.3c0,0.5 -0.1,1 -0.4,1.4c-0.4,0.3 -0.9,0.5 -1.4,0.4c-0.4,0 -0.8,0 -1.4,-0.1c-0.6,-0.1 -1.2,-0.1 -2.1,-0.1c-1.4,0 -2.8,0.2 -4.2,0.5c-1.4,0.3 -2.8,0.7 -4.2,1.2v24.9c0,0.5 -0.1,1 -0.4,1.4c-0.4,0.3 -0.9,0.5 -1.5,0.4L166.8,175.4z"></path>
    <path android:fillColor="@0xFF000000"
        android:pathData="M199.6,131.6c-1.7,0.1 -3.3,-0.5 -4.6,-1.6c-2.3,-2.4 -2.3,-6.1 0,-8.5c2.7,-2.1 6.4,-2.1 9,0c2.3,2.4 2.3,6.1 0,8.5C202.9,131.1 201.2,131.7 199.6,131.6zM196,175.4c-0.5,0 -1,-0.1 -1.4,-0.4c-0.3,-0.4 -0.5,-0.9 -0.4,-1.4v-34.2c-0.1,-0.5 0.1,-1.1 0.4,-1.5c0.4,-0.3 0.9,-0.5 1.4,-0.4h7.2c0.8,-0.2 1.7,0.3 1.9,1.2c0.1,0.2 0.1,0.5 0,0.7v34.2c0,0.5 -0.1,1 -0.4,1.4c-0.4,0.3 -0.9,0.5 -1.4,0.4H196z"></path>
    <path android:fillColor="@0xFF000000"
        android:pathData="M215.8,175.4c-0.9,0.1 -1.7,-0.5 -1.9,-1.3c0,-0.2 0,-0.4 0,-0.5v-34.2c-0.1,-0.5 0.1,-1.1 0.4,-1.5c0.4,-0.3 0.9,-0.4 1.4,-0.4h5.4c1,-0.1 1.9,0.6 2.1,1.6l0.6,2c2.2,-1.5 4.6,-2.7 7.1,-3.7c2.1,-0.7 4.3,-1.1 6.5,-1.1c4.5,0 7.6,1.6 9.4,4.8c2.2,-1.5 4.6,-2.8 7.2,-3.6c2.2,-0.7 4.6,-1.1 6.9,-1.1c3.5,0 6.2,1 8.1,2.9s2.9,4.6 2.9,8.1v26.2c0,0.5 -0.1,1 -0.4,1.4c-0.4,0.3 -0.9,0.5 -1.5,0.4h-7.1c-0.9,0.2 -1.7,-0.4 -1.9,-1.3c0,-0.2 0,-0.4 0,-0.5v-23.8c0,-3.4 -1.5,-5.1 -4.5,-5.1c-2.8,0 -5.6,0.7 -8.1,1.9v26.9c0,0.5 -0.1,1 -0.4,1.4c-0.4,0.3 -0.9,0.5 -1.5,0.4h-7.1c-0.9,0.1 -1.7,-0.4 -1.9,-1.3c0,-0.2 0,-0.4 0,-0.5v-23.8c0,-3.4 -1.5,-5.1 -4.5,-5.1c-2.9,0 -5.7,0.7 -8.2,2v26.8c0,0.5 -0.1,1 -0.4,1.4c-0.4,0.3 -0.9,0.5 -1.5,0.4L215.8,175.4z"></path>
    <path android:fillColor="@0xFF000000"
        android:pathData="M297.2,176.7c-6.1,0 -10.6,-1.4 -14.3,-5.2c-2.4,-2.5 -4.7,-7.1 -4.7,-14.9c0,-6.4 2,-11.1 5.3,-14.6c3.3,-3.5 8.3,-5.2 12.9,-5.2c5.9,0 9.3,1.4 12,4c2,2.1 3.1,4.8 3.1,7.7c0.1,1.8 -0.2,3.7 -1,5.4c-0.5,1 -1.2,2 -2.1,2.7c-4.4,4 -12.9,3.8 -15.8,3.6l-4.7,-0.7c0.3,3.3 1.2,5.8 3.2,7.3c2,1.5 4,2 8.2,2c2.9,-0.1 5.8,-0.6 8.6,-1.4c0.2,-0.1 0.5,-0.1 0.7,-0.2c0.2,0 0.5,0 0.7,0c0.4,0.1 0.9,0.5 0.9,1.6v3.4c0.1,0.6 -0.1,1.2 -0.3,1.7c-0.3,0.4 -0.8,0.7 -1.3,0.9C304.8,176 301,176.7 297.2,176.7zM301.8,148.9c0,-3.6 -2.6,-4.7 -5.7,-4.7c-2,-0.1 -4,0.7 -5.5,2.2c-1.5,1.9 -2.4,4.1 -2.5,6.5c3.2,0.6 6.4,0.7 9.5,0.4C299.8,152.9 301.8,151.8 301.8,148.9L301.8,148.9z"></path>
    <path android:fillColor="@0xFF000000"
        android:pathData="M251.2,252.8c-6.4,0 -11.2,-1.5 -15.1,-5.5c-2.6,-2.6 -5,-7.5 -5,-15.7c0,-6.7 2.1,-11.8 5.6,-15.5c3.5,-3.7 8.7,-5.5 13.7,-5.5c6.2,0 9.9,1.4 12.7,4.3c2.1,2.2 3.3,5.1 3.3,8.1c0.1,2 -0.2,3.9 -1.1,5.7c-0.5,1.1 -1.3,2.1 -2.2,2.9c-4.6,4.2 -13.7,4 -16.7,3.8l-5,-0.8c0.3,3.4 1.3,6.2 3.4,7.7c2.1,1.5 4.2,2.1 8.6,2.1c3,-0.1 6.1,-0.6 8.9,-1.4l0.8,-0.2c0.2,0 0.5,0 0.7,0c0.4,0.1 0.9,0.5 0.9,1.7v3.6c0.1,0.6 -0.1,1.2 -0.3,1.8c-0.4,0.4 -0.8,0.8 -1.4,0.9C259.2,252 255.2,252.8 251.2,252.8zM256,223.5c0,-3.8 -2.7,-4.9 -6,-4.9c-2.2,-0.1 -4.3,0.8 -5.8,2.4c-1.6,2 -2.5,4.4 -2.7,6.9c0,0 5.9,1.1 10.1,0.4C253.9,227.8 256,226.5 256,223.5L256,223.5z"></path>
    <path android:fillColor="@0xFF000000"
        android:pathData="M137.3,251.4c-0.4,0 -0.9,-0.1 -1.3,-0.2c-0.3,-0.1 -0.6,-0.4 -0.9,-0.6c-0.3,-0.4 -0.5,-0.8 -0.7,-1.2l-13.3,-34.9c-0.2,-0.4 -0.3,-0.8 -0.4,-1.1c-0.1,-0.3 -0.2,-0.6 -0.2,-0.9c0,-0.8 0.5,-1.2 1.6,-1.2h7.9c0.7,0 1.3,0.1 1.9,0.5c0.5,0.4 0.8,1 0.9,1.6l8.1,27.7l8.3,-27.7c0.1,-0.6 0.4,-1.2 0.9,-1.6c0.6,-0.4 1.2,-0.5 1.9,-0.5h7.7c1.1,0 1.6,0.4 1.6,1.2c0,0.3 -0.1,0.6 -0.2,0.9s-0.2,0.7 -0.4,1.1L147,249.3c-0.2,0.4 -0.4,0.8 -0.7,1.2c-0.2,0.3 -0.5,0.5 -0.8,0.6c-0.4,0.2 -0.9,0.2 -1.3,0.2L137.3,251.4z"></path>
    <path android:fillColor="@0xFF000000"
        android:pathData="M171.5,205.3c-1.8,0.1 -3.5,-0.5 -4.8,-1.7c-2.4,-2.5 -2.4,-6.5 0,-8.9c2.8,-2.2 6.8,-2.2 9.5,0c2.4,2.5 2.4,6.5 0,8.9C174.9,204.7 173.2,205.3 171.5,205.3zM167.6,251.4c-0.9,0.2 -1.8,-0.4 -2,-1.3c0,-0.2 0,-0.4 0,-0.7v-36.1c-0.1,-0.6 0.1,-1.1 0.5,-1.5c0.4,-0.3 1,-0.5 1.5,-0.4h7.7c0.9,-0.2 1.8,0.3 2,1.2c0.1,0.3 0.1,0.6 0,0.8v36.1c0,0.5 -0.1,1.1 -0.4,1.5c-0.4,0.4 -1,0.5 -1.5,0.5L167.6,251.4z"></path>
    <path android:fillColor="@0xFF000000"
        android:pathData="M201.1,252.3c-3.2,0.1 -6.3,-0.9 -8.8,-2.6c-2.6,-1.8 -4.6,-4.4 -5.8,-7.3c-1.4,-3.4 -2.1,-7.1 -2,-10.7c0,-6.5 1.6,-11.6 4.7,-15.5c2.9,-3.8 7.5,-6 12.2,-5.9c3.9,-0.1 7.7,1.2 10.6,3.6v-18.3c-0.1,-0.6 0.1,-1.1 0.5,-1.5c0.4,-0.3 1,-0.5 1.5,-0.4h7.6c0.5,-0.1 1.1,0.1 1.5,0.4c0.3,0.4 0.5,1 0.4,1.5l-0.1,54.1c0,0.5 -0.1,1.1 -0.4,1.5c-0.4,0.4 -1,0.5 -1.5,0.5h-6.3c-0.5,0 -1,-0.1 -1.5,-0.4c-0.4,-0.4 -0.7,-0.8 -0.8,-1.3l-0.5,-1.8C209.5,250.8 205.4,252.4 201.1,252.3zM204.9,243.8c2.6,0 5.1,-0.8 7.2,-2.2v-20.7c-2.4,-1.4 -5.1,-2 -7.8,-2c-2.5,-0.2 -4.9,1 -6.2,3.1c-1.4,2.1 -2.1,5.2 -2.1,9.3s0.7,7.3 2.2,9.3C199.7,242.8 201.9,243.8 204.9,243.8L204.9,243.8z"></path>
    <path android:fillColor="@0xFF000000"
        android:pathData="M291.6,252.7c-6.2,0 -11,-1.9 -14.5,-5.6c-3.5,-3.8 -5.3,-8.9 -5.3,-15.6c0,-6.7 1.8,-11.8 5.3,-15.5c3.5,-3.8 8.4,-5.6 14.6,-5.6c6.3,0 11,1.9 14.5,5.6c3.5,3.7 5.3,8.9 5.3,15.5c0,6.7 -1.8,11.9 -5.3,15.6C302.7,250.8 297.9,252.7 291.6,252.7zM291.6,244c5.5,0 8.3,-4.2 8.3,-12.4s-2.7,-12.4 -8.3,-12.4c-5.5,0 -8.3,4.1 -8.3,12.3C283.4,239.8 286.1,243.9 291.6,244L291.6,244z"></path>
    <path android:fillColor="@0xFF000000"
        android:pathData="M292.8,289.9c-21.1,14.9 -51.5,22.6 -77.5,22.1c-34.8,-0.5 -68,-14 -93.4,-37.8c-1.9,-1.8 -0.1,-4.2 2.2,-2.8c26.4,16.1 59.5,26.2 93.7,26.8c24.7,0.4 49.2,-4.2 72.1,-13.3C293.5,283.5 296.3,287.4 292.8,289.9z"
        android:fillType="1"></path>
    <path android:fillColor="@0xFF000000"
        android:pathData="M301.7,280.2c-2.6,-3.5 -17.6,-2 -24.4,-1.3c-2,0.2 -2.3,-1.6 -0.5,-2.9c12.1,-8.2 31.6,-5.4 33.8,-2.5c2.2,2.9 -1,22.4 -12.4,31.5c-1.8,1.4 -3.4,0.6 -2.6,-1.3C298.4,297.6 304.3,283.6 301.7,280.2z"
        android:fillType="1"></path>
</vector>

can not get icon. image: unknown format, File "" not found

err says icon file not found or error image format

for example:

com.nokia.z
File "" not found

com.google.android.apps.nbu.files
File "%!s(uint32=2131689475)" not found

com.sonyericsson.music
image: unknown format, this error is common in 5% of apks.

Add NewAPK api

I want to make a pr for your library.

This pr contains some func.

apk := NewAPK("some.apk")
apk.Icon() # return image.Image
apk.PackageName() # return string of package name
apk.MainActivity() # return acitivty which is necessary to launch app with adb shell am start -n

Any suggestions?

extrace apk icon, encouter image: unknown format

My requirement is to extract the icon file from the apk file

Here is the code:

func ExtractIcon() {
	apkPath := "/Users/selwyn/Desktop/taptap_2.68.4-mkt.100000_sem.apk"

	pkg, err := apk.OpenFile(apkPath)
	if err != nil {
		panic(err)
	}
	defer pkg.Close()

	icon, err := pkg.Icon(nil) // returns the icon of APK as image.Image
	if err != nil {
		panic(err)
	}
	fmt.Println(icon)
}

image: unknown format error show;
Here is the apk file download link:https://d2.tapurl.com/latest/sem-360ss_cn03syyx2_id235106

How can i solve thie problem,thx

Got panic when parse some apk

wandoujia-wandoujia_web.zip

file extension need change from .zip to .apk

When use apk.OpenFile("wandoujia-wandoujia_web.apk") got panic

λ go test -v
=== RUN   TestGetIcon
runtime: VirtualAlloc of 4294967296 bytes failed with errno=1455
fatal error: runtime: cannot map pages in arena address space

runtime stack:
runtime.throw(0x6ee5f7, 0x30)
        C:/Go/src/runtime/panic.go:566 +0x9c
runtime.sysMap(0xc042800000, 0x100000000, 0xb17d01, 0x83f8f8)
        C:/Go/src/runtime/mem_windows.go:116 +0x12c
runtime.(*mheap).sysAlloc(0x824ae0, 0x100000000, 0x81f540)
        C:/Go/src/runtime/malloc.go:407 +0x381
runtime.(*mheap).grow(0x824ae0, 0x80000, 0x0)
        C:/Go/src/runtime/mheap.go:726 +0x69
runtime.(*mheap).allocSpanLocked(0x824ae0, 0x80000, 0x4000)
        C:/Go/src/runtime/mheap.go:630 +0x4f9
runtime.(*mheap).alloc_m(0x824ae0, 0x80000, 0x100000000, 0xb0fe60)
        C:/Go/src/runtime/mheap.go:515 +0xee
runtime.(*mheap).alloc.func1()
        C:/Go/src/runtime/mheap.go:579 +0x52
runtime.systemstack(0xb0fe68)
        C:/Go/src/runtime/asm_amd64.s:314 +0xb5
runtime.(*mheap).alloc(0x824ae0, 0x80000, 0x10100000000, 0x3a)
        C:/Go/src/runtime/mheap.go:580 +0xa7
runtime.largeAlloc(0xfffffffe, 0x910001, 0xc00000003a)
        C:/Go/src/runtime/malloc.go:774 +0x9a
runtime.mallocgc.func1()
        C:/Go/src/runtime/malloc.go:669 +0x45
runtime.systemstack(0xc04201aa00)
        C:/Go/src/runtime/asm_amd64.s:298 +0x7e
runtime.mstart()
        C:/Go/src/runtime/proc.go:1079

goroutine 18 [running]:
runtime.systemstack_switch()
        C:/Go/src/runtime/asm_amd64.s:252 fp=0xc042031660 sp=0xc042031658
runtime.mallocgc(0xfffffffe, 0x67b520, 0x83bd01, 0x674a80)
        C:/Go/src/runtime/malloc.go:670 +0x94b fp=0xc042031700 sp=0xc042031660
runtime.makeslice(0x67b520, 0x7fffffff, 0x7fffffff, 0x0, 0xc042308000, 0x3959)
        C:/Go/src/runtime/slice.go:57 +0x82 fp=0xc042031758 sp=0xc042031700
github.com/shogo82148/androidbinary.readUTF16(0xc04235a0f0, 0xc042308000, 0x3959, 0x0, 0x0)
        D:/GoWorkdir/src/github.com/shogo82148/androidbinary/common.go:159 +0x74 fp=0xc0420317e8 sp=0xc042031758
github.com/shogo82148/androidbinary.readStringPool(0xc04235a0f0, 0xc04235a0f0, 0x8049a0, 0x83bde0)
        D:/GoWorkdir/src/github.com/shogo82148/androidbinary/common.go:134 +0x542 fp=0xc0420318c0 sp=0xc0420317e8
github.com/shogo82148/androidbinary.(*TableFile).readChunk(0xc04237c020, 0x7feea0, 0xc04235a060, 0xc, 0xc04235a0c0, 0xc04237c030, 0x0)
        D:/GoWorkdir/src/github.com/shogo82148/androidbinary/table.go:256 +0x240 fp=0xc042031940 sp=0xc0420318c0
github.com/shogo82148/androidbinary.NewTableFile(0x7fea20, 0xc04235a030, 0xe, 0xc0425c2000, 0x1df504)
        D:/GoWorkdir/src/github.com/shogo82148/androidbinary/table.go:188 +0x1a3 fp=0xc0420319b0 sp=0xc042031940
github.com/shogo82148/androidbinary/apk.(*Apk).parseResources(0xc0420f41c0, 0x0, 0x0)
        D:/GoWorkdir/src/github.com/shogo82148/androidbinary/apk/apk.go:144 +0xe6 fp=0xc042031a30 sp=0xc0420319b0
github.com/shogo82148/androidbinary/apk.OpenZipReader(0x7ff460, 0xc042068090, 0x77e1e9, 0x0, 0x0, 0x0)
        D:/GoWorkdir/src/github.com/shogo82148/androidbinary/apk/apk.go:66 +0x131 fp=0xc042031a80 sp=0xc042031a30
github.com/shogo82148/androidbinary/apk.OpenFile(0x6e449d, 0x10, 0x0, 0x0, 0x0)
        D:/GoWorkdir/src/github.com/shogo82148/androidbinary/apk/apk.go:46 +0x147 fp=0xc042031ac8 sp=0xc042031a80
github.com/shogo82148/androidbinary/apk.TestGetIcon(0xc04207c180)
        D:/GoWorkdir/src/github.com/shogo82148/androidbinary/apk/apk_test.go:10 +0x52 fp=0xc042031f58 sp=0xc042031ac8
testing.tRunner(0xc04207c180, 0x705848)
        C:/Go/src/testing/testing.go:610 +0x88 fp=0xc042031f80 sp=0xc042031f58
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:2086 +0x1 fp=0xc042031f88 sp=0xc042031f80
created by testing.(*T).Run
        C:/Go/src/testing/testing.go:646 +0x2f3

goroutine 1 [chan receive]:
testing.(*T).Run(0xc04207c0c0, 0x6e26ab, 0xb, 0x705848, 0xc0420bbd10)
        C:/Go/src/testing/testing.go:647 +0x31d
testing.RunTests.func1(0xc04207c0c0)
        C:/Go/src/testing/testing.go:793 +0x74
testing.tRunner(0xc04207c0c0, 0xc0420bbe20)
        C:/Go/src/testing/testing.go:610 +0x88
testing.RunTests(0x705910, 0x817380, 0x1, 0x1, 0x40e0c9)
        C:/Go/src/testing/testing.go:799 +0x320
testing.(*M).Run(0xc0420bbee8, 0xc042045330)
        C:/Go/src/testing/testing.go:743 +0x8c
main.main()
        github.com/shogo82148/androidbinary/apk/_test/_testmain.go:54 +0xcd
exit status 2
FAIL    github.com/shogo82148/androidbinary/apk 1.949s

seems readUTF16 read a too large string

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.