shogo82148 / androidbinary

Android binary file parser written in golang
MIT License
241 stars 79 forks source link

Fix issue9 #10

Closed shogo82148 closed 7 years ago

shogo82148 commented 7 years ago

Fix #9

shogo82148 commented 7 years ago

I have no panic but I can not get the icon of #9 . I'm checking the implementation now.

https://android.googlesource.com/platform/frameworks/base/+/master/libs/androidfw/ResourceTypes.cpp#3989

shogo82148 commented 7 years ago

Memo

It seems that I need to parseidmapEntries.

idmapentries are parsed here.

https://android.googlesource.com/platform/frameworks/base/+/master/libs/androidfw/ResourceTypes.cpp#354

codeskyblue commented 7 years ago

I'm going to Hokkaido tomorrow. ^_^

shogo82148 commented 7 years ago

Welcome to Japan!

package main

import (
        "image/png"
        "os"

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

func main() {
        pkg, err := apk.OpenFile("test.apk")
        if err != nil {
                panic(err)
        }

        icon, err := pkg.Icon(nil)
        if err != nil {
                panic(err)
        }

        png.Encode(os.Stdout, icon)
}

It seems to be working well. I'm going to review it again tomorrow, and then merge it.

codeskyblue commented 7 years ago

Great job