apkxml.go 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. package apk
  2. import "git.bvbej.com/bvbej/base-golang/pkg/android_binary"
  3. // Instrumentation is an application instrumentation code.
  4. type Instrumentation struct {
  5. Name android_binary.String `xml:"http://schemas.android.com/apk/res/android name,attr"`
  6. Target android_binary.String `xml:"http://schemas.android.com/apk/res/android targetPackage,attr"`
  7. HandleProfiling android_binary.Bool `xml:"http://schemas.android.com/apk/res/android handleProfiling,attr"`
  8. FunctionalTest android_binary.Bool `xml:"http://schemas.android.com/apk/res/android functionalTest,attr"`
  9. }
  10. // ActivityAction is an action of an activity.
  11. type ActivityAction struct {
  12. Name android_binary.String `xml:"http://schemas.android.com/apk/res/android name,attr"`
  13. }
  14. // ActivityCategory is a category of an activity.
  15. type ActivityCategory struct {
  16. Name android_binary.String `xml:"http://schemas.android.com/apk/res/android name,attr"`
  17. }
  18. // ActivityIntentFilter is an androidbinary.Int32ent filter of an activity.
  19. type ActivityIntentFilter struct {
  20. Actions []ActivityAction `xml:"action"`
  21. Categories []ActivityCategory `xml:"category"`
  22. }
  23. // AppActivity is an activity in an application.
  24. type AppActivity struct {
  25. Theme android_binary.String `xml:"http://schemas.android.com/apk/res/android theme,attr"`
  26. Name android_binary.String `xml:"http://schemas.android.com/apk/res/android name,attr"`
  27. Label android_binary.String `xml:"http://schemas.android.com/apk/res/android label,attr"`
  28. ScreenOrientation android_binary.String `xml:"http://schemas.android.com/apk/res/android screenOrientation,attr"`
  29. IntentFilters []ActivityIntentFilter `xml:"intent-filter"`
  30. }
  31. // AppActivityAlias https://developer.android.com/guide/topics/manifest/activity-alias-element
  32. type AppActivityAlias struct {
  33. Name android_binary.String `xml:"http://schemas.android.com/apk/res/android name,attr"`
  34. Label android_binary.String `xml:"http://schemas.android.com/apk/res/android label,attr"`
  35. TargetActivity android_binary.String `xml:"http://schemas.android.com/apk/res/android targetActivity,attr"`
  36. IntentFilters []ActivityIntentFilter `xml:"intent-filter"`
  37. }
  38. // MetaData is a metadata in an application.
  39. type MetaData struct {
  40. Name android_binary.String `xml:"http://schemas.android.com/apk/res/android name,attr"`
  41. Value android_binary.String `xml:"http://schemas.android.com/apk/res/android value,attr"`
  42. }
  43. // Application is an application in an APK.
  44. type Application struct {
  45. AllowTaskReparenting android_binary.Bool `xml:"http://schemas.android.com/apk/res/android allowTaskReparenting,attr"`
  46. AllowBackup android_binary.Bool `xml:"http://schemas.android.com/apk/res/android allowBackup,attr"`
  47. BackupAgent android_binary.String `xml:"http://schemas.android.com/apk/res/android backupAgent,attr"`
  48. Debuggable android_binary.Bool `xml:"http://schemas.android.com/apk/res/android debuggable,attr"`
  49. Description android_binary.String `xml:"http://schemas.android.com/apk/res/android description,attr"`
  50. Enabled android_binary.Bool `xml:"http://schemas.android.com/apk/res/android enabled,attr"`
  51. HasCode android_binary.Bool `xml:"http://schemas.android.com/apk/res/android hasCode,attr"`
  52. HardwareAccelerated android_binary.Bool `xml:"http://schemas.android.com/apk/res/android hardwareAccelerated,attr"`
  53. Icon android_binary.String `xml:"http://schemas.android.com/apk/res/android icon,attr"`
  54. KillAfterRestore android_binary.Bool `xml:"http://schemas.android.com/apk/res/android killAfterRestore,attr"`
  55. LargeHeap android_binary.Bool `xml:"http://schemas.android.com/apk/res/android largeHeap,attr"`
  56. Label android_binary.String `xml:"http://schemas.android.com/apk/res/android label,attr"`
  57. Logo android_binary.String `xml:"http://schemas.android.com/apk/res/android logo,attr"`
  58. ManageSpaceActivity android_binary.String `xml:"http://schemas.android.com/apk/res/android manageSpaceActivity,attr"`
  59. Name android_binary.String `xml:"http://schemas.android.com/apk/res/android name,attr"`
  60. Permission android_binary.String `xml:"http://schemas.android.com/apk/res/android permission,attr"`
  61. Persistent android_binary.Bool `xml:"http://schemas.android.com/apk/res/android persistent,attr"`
  62. Process android_binary.String `xml:"http://schemas.android.com/apk/res/android process,attr"`
  63. RestoreAnyVersion android_binary.Bool `xml:"http://schemas.android.com/apk/res/android restoreAnyVersion,attr"`
  64. RequiredAccountType android_binary.String `xml:"http://schemas.android.com/apk/res/android requiredAccountType,attr"`
  65. RestrictedAccountType android_binary.String `xml:"http://schemas.android.com/apk/res/android restrictedAccountType,attr"`
  66. SupportsRtl android_binary.Bool `xml:"http://schemas.android.com/apk/res/android supportsRtl,attr"`
  67. TaskAffinity android_binary.String `xml:"http://schemas.android.com/apk/res/android taskAffinity,attr"`
  68. TestOnly android_binary.Bool `xml:"http://schemas.android.com/apk/res/android testOnly,attr"`
  69. Theme android_binary.String `xml:"http://schemas.android.com/apk/res/android theme,attr"`
  70. UIOptions android_binary.String `xml:"http://schemas.android.com/apk/res/android uiOptions,attr"`
  71. VMSafeMode android_binary.Bool `xml:"http://schemas.android.com/apk/res/android vmSafeMode,attr"`
  72. Activities []AppActivity `xml:"activity"`
  73. ActivityAliases []AppActivityAlias `xml:"activity-alias"`
  74. MetaData []MetaData `xml:"meta-data"`
  75. }
  76. // UsesSDK is target SDK version.
  77. type UsesSDK struct {
  78. Min android_binary.Int32 `xml:"http://schemas.android.com/apk/res/android minSdkVersion,attr"`
  79. Target android_binary.Int32 `xml:"http://schemas.android.com/apk/res/android targetSdkVersion,attr"`
  80. Max android_binary.Int32 `xml:"http://schemas.android.com/apk/res/android maxSdkVersion,attr"`
  81. }
  82. // UsesPermission is user grant the system permission.
  83. type UsesPermission struct {
  84. Name android_binary.String `xml:"http://schemas.android.com/apk/res/android name,attr"`
  85. Max android_binary.Int32 `xml:"http://schemas.android.com/apk/res/android maxSdkVersion,attr"`
  86. }
  87. // Manifest is a manifest of an APK.
  88. type Manifest struct {
  89. Package android_binary.String `xml:"package,attr"`
  90. VersionCode android_binary.Int32 `xml:"http://schemas.android.com/apk/res/android versionCode,attr"`
  91. VersionName android_binary.String `xml:"http://schemas.android.com/apk/res/android versionName,attr"`
  92. App Application `xml:"application"`
  93. Instrument Instrumentation `xml:"instrumentation"`
  94. SDK UsesSDK `xml:"uses-sdk"`
  95. UsesPermissions []UsesPermission `xml:"uses-permission"`
  96. }