12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- package aapt
- type Aapt struct {
- binPath string
- }
- type AppInfo struct {
- PackageName string
- VersionName string
- VersionCode int
- MinSDKVersion int
- TargetSDKVersion int
- UsesAndroidPermission []string
- UsesCustomPermission []string
- LaunchActivity []string
- AppLabel map[string]string
- MetaData map[string]string
- IsSplitBase bool
- Debuggable bool
- TestOnly bool
- NativeCode map[string]struct{}
- }
- type Resources struct {
-
- Array map[string][][2]string
-
- String map[string][][2]string
- }
- func (aapt Aapt) BinPath() string {
- return aapt.binPath
- }
- func (aapt Aapt) XmlStringsManifest(apkFile string) ([]byte, error) {
- cmd := []string{"xmlstrings", apkFile, "AndroidManifest.xml"}
- return aapt.RunSync("dump", cmd...)
- }
- func (aapt Aapt) removeFilesFrom(apkAarJar string, files ...string) ([]byte, error) {
- return aapt.RunSync("r", append([]string{apkAarJar}, files...)...)
- }
- func (aapt Aapt) RemoveSignature(zipFile string) ([]byte, error) {
- sign, err := findApkSignature(zipFile)
- if err != nil {
- return nil, err
- }
- return aapt.removeFilesFrom(zipFile, sign...)
- }
- func (aapt Aapt) DumpAppInfo(apkFile string) ([]byte, error) {
- return aapt.RunSync("dump", "--include-meta-data", "badging", apkFile)
- }
- func (aapt Aapt) DumpResources(apkFile string) ([]byte, error) {
- return aapt.RunSync("dump", "--values", "resources", apkFile)
- }
- func (aapt Aapt) Version() ([]byte, error) {
- return aapt.RunSync("version")
- }
|