Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/avast/apkparser
APK manifest & resources parsing in Golang.
https://github.com/avast/apkparser
android apk apkparser parser
Last synced: 1 day ago
JSON representation
APK manifest & resources parsing in Golang.
- Host: GitHub
- URL: https://github.com/avast/apkparser
- Owner: avast
- License: lgpl-3.0
- Created: 2017-12-06T09:30:39.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-07-29T09:26:25.000Z (7 months ago)
- Last Synced: 2025-02-01T05:11:46.976Z (9 days ago)
- Topics: android, apk, apkparser, parser
- Language: Go
- Homepage:
- Size: 126 KB
- Stars: 131
- Watchers: 29
- Forks: 21
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# apkparser
[![GoDoc](https://godoc.org/github.com/avast/apkparser?status.svg)](https://godoc.org/github.com/avast/apkparser)
[![Build Status](https://travis-ci.org/avast/apkparser.svg?branch=master)](https://travis-ci.org/avast/apkparser)APK AndroidManifest.xml and resources.arsc parsing.
**Works with Go 1.9 or higher.**
Documentation on [GoDoc](https://godoc.org/github.com/avast/apkparser)
go get github.com/avast/apkparser
## ZipReader
Because Android can handle even broken ZIP archives, this packages has it's own zip reader,
based on archive/zip.## axml2xml
A tool to extract AndroidManifest.xml and verify APK signature is also part of this repo.go get github.com/avast/apkparser
go install github.com/avast/apkparser/axml2xml
./axml2xml -v application.apk## Example
```go
package mainimport (
"encoding/xml"
"fmt"
"github.com/avast/apkparser"
"os"
)func main() {
enc := xml.NewEncoder(os.Stdout)
enc.Indent("", "\t")
zipErr, resErr, manErr := apkparser.ParseApk(os.Args[1], enc)
if zipErr != nil {
fmt.Fprintf(os.Stderr, "Failed to open the APK: %s", zipErr.Error())
os.Exit(1)
return
}if resErr != nil {
fmt.Fprintf(os.Stderr, "Failed to parse resources: %s", resErr.Error())
}
if manErr != nil {
fmt.Fprintf(os.Stderr, "Failed to parse AndroidManifest.xml: %s", manErr.Error())
os.Exit(1)
return
}
fmt.Println()
}
```