Skip to content

Commit

Permalink
Merge pull request #85 from oskarwojciski/add-compile-sdk-data
Browse files Browse the repository at this point in the history
Parse compile SDK properties from manifest
  • Loading branch information
shogo82148 committed Dec 8, 2023
2 parents 863f0c4 + 3e74d4d commit 0e4d82b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions apk/apkxml.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.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"`
Instrument Instrumentation `xml:"instrumentation"`
SDK UsesSDK `xml:"uses-sdk"`
UsesPermissions []UsesPermission `xml:"uses-permission"`
}
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func ExampleNewXMLFile() {
enc.Encode(v)

// Output:
// <Manifest package="net.sorablue.shogo.FWMeasure" xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="テスト版">
// <Manifest package="net.sorablue.shogo.FWMeasure" xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="0" android:compileSdkVersionCodename="" android:versionCode="1" android:versionName="テスト版">
// <application android:allowTaskReparenting="false" android:allowBackup="false" android:backupAgent="" android:debuggable="false" android:description="" android:enabled="false" android:hasCode="false" android:hardwareAccelerated="false" android:icon="@0x7F020000" android:killAfterRestore="false" android:largeHeap="false" android:label="@0x7F040000" android:logo="" android:manageSpaceActivity="" android:name="" android:permission="" android:persistent="false" android:process="" android:restoreAnyVersion="false" android:requiredAccountType="" android:restrictedAccountType="" android:supportsRtl="false" android:taskAffinity="" android:testOnly="false" android:theme="" android:uiOptions="" android:vmSafeMode="false">
// <activity android:theme="" android:name="FWMeasureActivity" android:label="" android:screenOrientation="0">
// <intent-filter>
Expand Down

0 comments on commit 0e4d82b

Please sign in to comment.