Skip to content

Commit 0e4d82b

Browse files
authored
Merge pull request #85 from oskarwojciski/add-compile-sdk-data
Parse compile SDK properties from manifest
2 parents 863f0c4 + 3e74d4d commit 0e4d82b

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

apk/apkxml.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,13 @@ type UsesPermission struct {
100100

101101
// Manifest is a manifest of an APK.
102102
type Manifest struct {
103-
Package androidbinary.String `xml:"package,attr"`
104-
VersionCode androidbinary.Int32 `xml:"http://schemas.android.com/apk/res/android versionCode,attr"`
105-
VersionName androidbinary.String `xml:"http://schemas.android.com/apk/res/android versionName,attr"`
106-
App Application `xml:"application"`
107-
Instrument Instrumentation `xml:"instrumentation"`
108-
SDK UsesSDK `xml:"uses-sdk"`
109-
UsesPermissions []UsesPermission `xml:"uses-permission"`
103+
Package androidbinary.String `xml:"package,attr"`
104+
CompileSDKVersion androidbinary.Int32 `xml:"http://schemas.android.com/apk/res/android compileSdkVersion,attr"`
105+
CompileSDKVersionCodename androidbinary.String `xml:"http://schemas.android.com/apk/res/android compileSdkVersionCodename,attr"`
106+
VersionCode androidbinary.Int32 `xml:"http://schemas.android.com/apk/res/android versionCode,attr"`
107+
VersionName androidbinary.String `xml:"http://schemas.android.com/apk/res/android versionName,attr"`
108+
App Application `xml:"application"`
109+
Instrument Instrumentation `xml:"instrumentation"`
110+
SDK UsesSDK `xml:"uses-sdk"`
111+
UsesPermissions []UsesPermission `xml:"uses-permission"`
110112
}

example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func ExampleNewXMLFile() {
2525
enc.Encode(v)
2626

2727
// Output:
28-
// <Manifest package="net.sorablue.shogo.FWMeasure" xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="テスト版">
28+
// <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="テスト版">
2929
// <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">
3030
// <activity android:theme="" android:name="FWMeasureActivity" android:label="" android:screenOrientation="0">
3131
// <intent-filter>

0 commit comments

Comments
 (0)