Skip to content

Commit

Permalink
Merge pull request #46 from tonywang/feature/support-uses-permission
Browse files Browse the repository at this point in the history
Add uses-permission support
  • Loading branch information
shogo82148 authored Dec 18, 2020
2 parents 8ef62a6 + 30691d3 commit 85e23a6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
19 changes: 13 additions & 6 deletions apk/apkxml.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,19 @@ type UsesSDK struct {
Max androidbinary.Int32 `xml:"http://schemas.android.com/apk/res/android maxSdkVersion,attr"`
}

// UsesPermission is user grant the system permission.
type UsesPermission struct {
Name androidbinary.String `xml:"http://schemas.android.com/apk/res/android name,attr"`
Max androidbinary.Int32 `xml:"http://schemas.android.com/apk/res/android maxSdkVersion,attr"`
}

// 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"`
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"`
}
6 changes: 6 additions & 0 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ func ExampleNewXMLFile() {
// </application>
// <instrumentation android:name="" android:targetPackage="" android:handleProfiling="false" android:functionalTest="false"></instrumentation>
// <uses-sdk android:minSdkVersion="0" android:targetSdkVersion="0" android:maxSdkVersion="0"></uses-sdk>
// <uses-permission android:name="android.permission.CAMERA" android:maxSdkVersion="0"></uses-permission>
// <uses-permission android:name="android.permission.WAKE_LOCK" android:maxSdkVersion="0"></uses-permission>
// <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="0"></uses-permission>
// <uses-permission android:name="android.permission.INTERNET" android:maxSdkVersion="0"></uses-permission>
// <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" android:maxSdkVersion="0"></uses-permission>
// <uses-permission android:name="android.permission.RECORD_AUDIO" android:maxSdkVersion="0"></uses-permission>
// </Manifest>
}

Expand Down

0 comments on commit 85e23a6

Please sign in to comment.