Skip to content

Commit ac5309b

Browse files
committed
2 parents 4ad2d55 + 7bdd685 commit ac5309b

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

QuestPatcher.Core/Models/PatchingOptions.cs

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public bool HandTracking
2323

2424
public bool Microphone { get; set; }
2525

26+
public bool OpenXR { get; set; }
27+
2628
public bool FlatScreenSupport { get; set; }
2729

2830
public HandTrackingVersion HandTrackingType { get; set; }

QuestPatcher.Core/Patching/PatchingManager.cs

+36
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public class PatchingManager : INotifyPropertyChanged
3535
private const int DebuggableAttributeResourceId = 16842767;
3636
private const int LegacyStorageAttributeResourceId = 16844291;
3737
private const int ValueAttributeResourceId = 16842788;
38+
private const int AuthoritiesAttributeResourceId = 16842776;
3839

3940
/// <summary>
4041
/// Compression level to use when adding files to the APK during patching.
@@ -191,6 +192,41 @@ private async Task PatchManifest(ApkZip apk)
191192
addingFeatures.Add("oculus.software.handtracking");
192193
}
193194

195+
if (permissions.OpenXR)
196+
{
197+
Log.Information("Adding OpenXR permission . . .");
198+
199+
addingPermissions.AddRange(new[] {
200+
"org.khronos.openxr.permission.OPENXR",
201+
"org.khronos.openxr.permission.OPENXR_SYSTEM",
202+
});
203+
204+
AxmlElement providerElement = new("provider") {
205+
Attributes = {new("authorities", AndroidNamespaceUri, AuthoritiesAttributeResourceId, "org.khronos.openxr.runtime_broker;org.khronos.openxr.system_runtime_broker")},
206+
};
207+
AxmlElement runtimeIntent = new("intent") {
208+
Children = {
209+
new("action") {
210+
Attributes = {new("name", AndroidNamespaceUri, NameAttributeResourceId, "org.khronos.openxr.OpenXRRuntimeService")},
211+
},
212+
},
213+
};
214+
AxmlElement layerIntent = new("intent") {
215+
Children = {
216+
new("action") {
217+
Attributes = {new("name", AndroidNamespaceUri, NameAttributeResourceId, "org.khronos.openxr.OpenXRApiLayerService")},
218+
},
219+
},
220+
};
221+
manifest.Children.Add(new("queries") {
222+
Children = {
223+
providerElement,
224+
runtimeIntent,
225+
layerIntent,
226+
},
227+
});
228+
}
229+
194230
// Find which features and permissions already exist to avoid adding existing ones
195231
var existingPermissions = GetExistingChildren(manifest, "uses-permission");
196232
var existingFeatures = GetExistingChildren(manifest, "uses-feature");

QuestPatcher/Views/PatchingView.axaml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<ToggleSwitch IsChecked="{Binding Config.PatchingOptions.Debuggable}">Allow Debugging</ToggleSwitch>
2020
<ToggleSwitch IsChecked="{Binding Config.PatchingOptions.FlatScreenSupport}">Disable VR Requirement</ToggleSwitch>
2121
<ToggleSwitch IsChecked="{Binding Config.PatchingOptions.Microphone}">Enable Microphone</ToggleSwitch>
22+
<ToggleSwitch IsChecked="{Binding Config.PatchingOptions.OpenXR}">Enable OpenXR</ToggleSwitch>
2223

2324
<StackPanel Orientation="Vertical" Spacing="10">
2425
<TextBlock>Hand Tracking Type</TextBlock>

0 commit comments

Comments
 (0)