Skip to content

Commit

Permalink
Added workaround for mixed reality capture
Browse files Browse the repository at this point in the history
Closes #174
  • Loading branch information
Lauriethefish committed Aug 19, 2024
1 parent c7ff941 commit 0acf9fe
Show file tree
Hide file tree
Showing 5 changed files with 689 additions and 555 deletions.
2 changes: 2 additions & 0 deletions QuestPatcher.Core/Models/PatchingOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public bool HandTracking
}
}

public bool MrcWorkaround { get; set; }

public bool Microphone { get; set; }

public bool OpenXR { get; set; }
Expand Down
20 changes: 20 additions & 0 deletions QuestPatcher.Core/Patching/PatchingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,26 @@ private async Task PatchManifest(ApkZip apk)
appElement.Attributes.Add(new AxmlAttribute("requestLegacyExternalStorage", AndroidNamespaceUri, LegacyStorageAttributeResourceId, true));
}

if (permissions.MrcWorkaround)
{
const string MrcLibName = "libOVRMrcLib.oculus.so";

if(appElement.Children.Any(child => child.Name == "uses-native-library" &&
child.Attributes.Any(attr => attr.Name == "name" && (string) attr.Value == MrcLibName))) {
Log.Information("Not adding MRC workaround as it already exists");
}
else
{
Log.Information("Adding MRC workaround");
AxmlElement nativeLibElement = new("uses-native-library");
AddNameAttribute(nativeLibElement, MrcLibName);
nativeLibElement.Attributes.Add(new AxmlAttribute("required", AndroidNamespaceUri, RequiredAttributeResourceId, false));

appElement.Children.Add(nativeLibElement);
manifestModified = true;
}
}

// TODO: Modify an existing hand tracking element if one exists
switch (permissions.HandTrackingType)
{
Expand Down
9 changes: 9 additions & 0 deletions QuestPatcher/Resources/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0acf9fe

Please sign in to comment.