From a3c09d12dd5f77c557d1bc6e184d9d27afe2ac12 Mon Sep 17 00:00:00 2001 From: oskarwojciski Date: Thu, 7 Dec 2023 12:37:25 +0100 Subject: [PATCH 1/2] Parse compile sdk properties from manifest --- apk/apkxml.go | 16 +++++++++------- example_test.go | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/apk/apkxml.go b/apk/apkxml.go index 47598c8..99fec6d 100644 --- a/apk/apkxml.go +++ b/apk/apkxml.go @@ -100,11 +100,13 @@ type UsesPermission struct { // Manifest is a manifest of an APK. type Manifest struct { - Package androidbinary.String `xml:"package,attr"` - VersionCode androidbinary.Int32 `xml:"http://schemas.android.com/apk/res/android versionCode,attr"` - VersionName androidbinary.String `xml:"http://schemas.android.com/apk/res/android versionName,attr"` - App Application `xml:"application"` - Instrument Instrumentation `xml:"instrumentation"` - SDK UsesSDK `xml:"uses-sdk"` - UsesPermissions []UsesPermission `xml:"uses-permission"` + Package androidbinary.String `xml:"package,attr"` + CompileSDKVersion androidbinary.Int32 `xml:"http://schemas.android.com/apk/res/android compileSdkVersion,attr"` + CompileSDKVersionCodename androidbinary.Int32 `xml:"http://schemas.android.com/apk/res/android compileSdkVersionCodename,attr"` + VersionCode androidbinary.Int32 `xml:"http://schemas.android.com/apk/res/android versionCode,attr"` + VersionName androidbinary.String `xml:"http://schemas.android.com/apk/res/android versionName,attr"` + App Application `xml:"application"` + Instrument Instrumentation `xml:"instrumentation"` + SDK UsesSDK `xml:"uses-sdk"` + UsesPermissions []UsesPermission `xml:"uses-permission"` } diff --git a/example_test.go b/example_test.go index 5134ad1..cf6b65f 100644 --- a/example_test.go +++ b/example_test.go @@ -25,7 +25,7 @@ func ExampleNewXMLFile() { enc.Encode(v) // Output: - // + // // // // From 3e74d4d59b38b75e80109ed8579e83dfd3df8529 Mon Sep 17 00:00:00 2001 From: oskarwojciski Date: Thu, 7 Dec 2023 12:41:14 +0100 Subject: [PATCH 2/2] Change CompileSDKVersionCodename data type --- apk/apkxml.go | 2 +- example_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apk/apkxml.go b/apk/apkxml.go index 99fec6d..abc6a1d 100644 --- a/apk/apkxml.go +++ b/apk/apkxml.go @@ -102,7 +102,7 @@ type UsesPermission struct { type Manifest struct { Package androidbinary.String `xml:"package,attr"` CompileSDKVersion androidbinary.Int32 `xml:"http://schemas.android.com/apk/res/android compileSdkVersion,attr"` - CompileSDKVersionCodename androidbinary.Int32 `xml:"http://schemas.android.com/apk/res/android compileSdkVersionCodename,attr"` + CompileSDKVersionCodename androidbinary.String `xml:"http://schemas.android.com/apk/res/android compileSdkVersionCodename,attr"` VersionCode androidbinary.Int32 `xml:"http://schemas.android.com/apk/res/android versionCode,attr"` VersionName androidbinary.String `xml:"http://schemas.android.com/apk/res/android versionName,attr"` App Application `xml:"application"` diff --git a/example_test.go b/example_test.go index cf6b65f..84b4c8f 100644 --- a/example_test.go +++ b/example_test.go @@ -25,7 +25,7 @@ func ExampleNewXMLFile() { enc.Encode(v) // Output: - // + // // // //