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