forked from MattRix/UnityDecompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathManifestUAP.cs
More file actions
209 lines (187 loc) · 9.68 KB
/
ManifestUAP.cs
File metadata and controls
209 lines (187 loc) · 9.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Xml.Linq;
using UnityEditor;
internal class ManifestUAP : ManifestWSA
{
private readonly XNamespace _defaultNamespace = "http://schemas.microsoft.com/appx/manifest/foundation/windows10";
private readonly XNamespace _mpNamespace = "http://schemas.microsoft.com/appx/2014/phone/manifest";
private readonly XNamespace _uap2Namespace = "http://schemas.microsoft.com/appx/manifest/uap/windows10/2";
private readonly XNamespace _uapNamespace = "http://schemas.microsoft.com/appx/manifest/uap/windows10";
private readonly XNamespace _uapRescapNamespace = "http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities";
protected readonly List<UIOrientation> supportedOrientations;
public ManifestUAP()
{
List<UIOrientation> list = new List<UIOrientation> {
UIOrientation.LandscapeLeft,
UIOrientation.LandscapeRight,
UIOrientation.Portrait,
UIOrientation.PortraitUpsideDown
};
this.supportedOrientations = list;
}
protected override XElement CreateDependenciesElement()
{
Version version = new Version(10, 0, 0x2800, 0);
object[] content = new object[] { new XAttribute("Name", "Windows.Universal"), new XAttribute("MinVersion", version), new XAttribute("MaxVersionTested", Utility.GetDesiredUWPSDKString()) };
return new XElement((XName) (this.DefaultNamespace + "Dependencies"), new XElement((XName) (this.DefaultNamespace + "TargetDeviceFamily"), content));
}
protected override XElement CreateHumanInterfaceDeviceCapabilityElement() =>
this.CreateHumanInterfaceDeviceCapabilityElement(this.DefaultNamespace);
protected override XElement CreateInitialRotationPreferenceElement() =>
base.CreateInitialRotationPreferenceElement(this._uapNamespace, this.supportedOrientations);
protected override XElement CreatePackageElement()
{
XElement element = base.CreatePackageElement();
element.Add(new XAttribute((XName) (XNamespace.Xmlns + "mp"), this._mpNamespace));
element.Add(new XAttribute((XName) (XNamespace.Xmlns + "uap"), this._uapNamespace));
element.Add(new XAttribute((XName) (XNamespace.Xmlns + "uap2"), this._uap2Namespace));
string str = "uap uap2 mp";
if (PlayerSettings.WSA.GetCapability(PlayerSettings.WSACapability.InputInjectionBrokered))
{
element.Add(new XAttribute((XName) (XNamespace.Xmlns + "rescap"), this._uapRescapNamespace));
str = str + " rescap";
}
element.Add(new XAttribute("IgnorableNamespaces", str));
return element;
}
protected override XElement CreatePhoneIdentityElement() =>
new XElement((XName) (this._mpNamespace + "PhoneIdentity"), new object[] { new XAttribute("PhoneProductId", base.ProductId), new XAttribute("PhonePublisherId", Guid.Empty.ToString("D", CultureInfo.InvariantCulture)) });
protected override XElement CreateVisualElementsElement()
{
object[] content = new object[] { new XAttribute("DisplayName", PlayerSettings.productName), new XAttribute("Square150x150Logo", base.Images.uwpSquare150x150Logo), new XAttribute("Square44x44Logo", base.Images.uwpSquare44x44Logo), new XAttribute("Description", PlayerSettings.WSA.applicationDescription), new XAttribute("BackgroundColor", base.BackgroundColor) };
XElement element = new XElement((XName) (this._uapNamespace + "VisualElements"), content);
XElement defaultTileElement = this.GetDefaultTileElement();
if (defaultTileElement != null)
{
element.Add(defaultTileElement);
}
XElement splashScreenElement = base.GetSplashScreenElement(this._uapNamespace, base.Images.uwpSplashScreen);
element.Add(splashScreenElement);
return element;
}
private XElement GetDefaultTileElement()
{
XElement element = new XElement((XName) (this._uapNamespace + "DefaultTile"));
string tileShortName = PlayerSettings.WSA.tileShortName;
if (!string.IsNullOrEmpty(tileShortName))
{
element.Add(new XAttribute("ShortName", tileShortName));
}
if (!string.IsNullOrEmpty(base.Images.uwpWide310x150Logo))
{
element.Add(new XAttribute("Wide310x150Logo", base.Images.uwpWide310x150Logo));
}
if (!string.IsNullOrEmpty(base.Images.uwpSquare71x71Logo))
{
element.Add(new XAttribute("Square71x71Logo", base.Images.uwpSquare71x71Logo));
}
if (!string.IsNullOrEmpty(base.Images.uwpSquare310x310Logo))
{
element.Add(new XAttribute("Square310x310Logo", base.Images.uwpSquare310x310Logo));
}
XElement showNameOnTilesElement = this.GetShowNameOnTilesElement();
if (showNameOnTilesElement != null)
{
element.Add(showNameOnTilesElement);
}
return ((!element.HasAttributes && !element.HasElements) ? null : element);
}
protected override XNamespace GetNamespaceForCapability(PlayerSettings.WSACapability cap)
{
switch (cap)
{
case PlayerSettings.WSACapability.BlockedChatMessages:
case PlayerSettings.WSACapability.Chat:
case PlayerSettings.WSACapability.Objects3D:
case PlayerSettings.WSACapability.PhoneCall:
case PlayerSettings.WSACapability.UserAccountInformation:
case PlayerSettings.WSACapability.VoipCall:
break;
case PlayerSettings.WSACapability.SpatialPerception:
return this._uap2Namespace;
case PlayerSettings.WSACapability.InputInjectionBrokered:
return this._uapRescapNamespace;
default:
switch (cap)
{
case PlayerSettings.WSACapability.EnterpriseAuthentication:
case PlayerSettings.WSACapability.MusicLibrary:
case PlayerSettings.WSACapability.PicturesLibrary:
case PlayerSettings.WSACapability.RemovableStorage:
case PlayerSettings.WSACapability.SharedUserCertificates:
case PlayerSettings.WSACapability.VideosLibrary:
break;
case PlayerSettings.WSACapability.InternetClient:
case PlayerSettings.WSACapability.InternetClientServer:
case PlayerSettings.WSACapability.PrivateNetworkClientServer:
goto Label_0085;
default:
goto Label_0085;
}
break;
}
return this._uapNamespace;
Label_0085:
return this.DefaultNamespace;
}
protected override XNamespace GetNamespaceForFileTypeAssociationExtension() =>
this._uapNamespace;
protected override XNamespace GetNamespaceForProtocolExtension() =>
this._uapNamespace;
private XElement GetShowNameOnTilesElement()
{
XElement element = new XElement((XName) (this._uapNamespace + "ShowNameOnTiles"));
if (PlayerSettings.WSA.mediumTileShowName)
{
element.Add(new XElement((XName) (this._uapNamespace + "ShowOn"), new XAttribute("Tile", "square150x150Logo")));
}
if (PlayerSettings.WSA.largeTileShowName && !string.IsNullOrEmpty(base.Images.uwpSquare310x310Logo))
{
element.Add(new XElement((XName) (this._uapNamespace + "ShowOn"), new XAttribute("Tile", "square310x310Logo")));
}
if (PlayerSettings.WSA.wideTileShowName && !string.IsNullOrEmpty(base.Images.uwpWide310x150Logo))
{
element.Add(new XElement((XName) (this._uapNamespace + "ShowOn"), new XAttribute("Tile", "wide310x150Logo")));
}
return (!element.HasElements ? null : element);
}
protected override bool IsCapabilitySupported(PlayerSettings.WSACapability cap)
{
switch (cap)
{
case PlayerSettings.WSACapability.EnterpriseAuthentication:
case PlayerSettings.WSACapability.InternetClient:
case PlayerSettings.WSACapability.InternetClientServer:
case PlayerSettings.WSACapability.MusicLibrary:
case PlayerSettings.WSACapability.PicturesLibrary:
case PlayerSettings.WSACapability.PrivateNetworkClientServer:
case PlayerSettings.WSACapability.RemovableStorage:
case PlayerSettings.WSACapability.SharedUserCertificates:
case PlayerSettings.WSACapability.VideosLibrary:
case PlayerSettings.WSACapability.WebCam:
case PlayerSettings.WSACapability.Proximity:
case PlayerSettings.WSACapability.Microphone:
case PlayerSettings.WSACapability.Location:
case PlayerSettings.WSACapability.HumanInterfaceDevice:
case PlayerSettings.WSACapability.AllJoyn:
case PlayerSettings.WSACapability.BlockedChatMessages:
case PlayerSettings.WSACapability.Chat:
case PlayerSettings.WSACapability.CodeGeneration:
case PlayerSettings.WSACapability.Objects3D:
case PlayerSettings.WSACapability.PhoneCall:
case PlayerSettings.WSACapability.UserAccountInformation:
case PlayerSettings.WSACapability.VoipCall:
case PlayerSettings.WSACapability.Bluetooth:
case PlayerSettings.WSACapability.SpatialPerception:
case PlayerSettings.WSACapability.InputInjectionBrokered:
return true;
}
return false;
}
protected override XNamespace DefaultNamespace =>
this._defaultNamespace;
protected override string StoreLogo =>
base.Images.uwpStoreLogo;
}