@@ -201,24 +201,28 @@ private async Task PatchManifest(ApkZip apk)
201201 "org.khronos.openxr.permission.OPENXR_SYSTEM" ,
202202 } ) ;
203203
204- AxmlElement providerElement = new ( "provider" ) {
205- Attributes = { new ( "authorities" , AndroidNamespaceUri , AuthoritiesAttributeResourceId , "org.khronos.openxr.runtime_broker;org.khronos.openxr.system_runtime_broker" ) } ,
204+ AxmlElement providerElement = new ( "provider" )
205+ {
206+ Attributes = { new ( "authorities" , AndroidNamespaceUri , AuthoritiesAttributeResourceId , "org.khronos.openxr.runtime_broker;org.khronos.openxr.system_runtime_broker" ) } ,
206207 } ;
207- AxmlElement runtimeIntent = new ( "intent" ) {
208+ AxmlElement runtimeIntent = new ( "intent" )
209+ {
208210 Children = {
209211 new ( "action" ) {
210212 Attributes = { new ( "name" , AndroidNamespaceUri , NameAttributeResourceId , "org.khronos.openxr.OpenXRRuntimeService" ) } ,
211213 } ,
212214 } ,
213215 } ;
214- AxmlElement layerIntent = new ( "intent" ) {
216+ AxmlElement layerIntent = new ( "intent" )
217+ {
215218 Children = {
216219 new ( "action" ) {
217220 Attributes = { new ( "name" , AndroidNamespaceUri , NameAttributeResourceId , "org.khronos.openxr.OpenXRApiLayerService" ) } ,
218221 } ,
219222 } ,
220223 } ;
221- manifest . Children . Add ( new ( "queries" ) {
224+ manifest . Children . Add ( new ( "queries" )
225+ {
222226 Children = {
223227 providerElement ,
224228 runtimeIntent ,
@@ -475,6 +479,21 @@ private async Task ModifyApk(string mainPath, string? modloaderPath, string? uni
475479 await AddFlatscreenSupport ( apk , ovrPlatformSdkPath ! ) ;
476480 }
477481
482+ if ( _config . PatchingOptions . CustomSplashPath != null )
483+ {
484+ Log . Information ( "Checking if Splash screen file exists" ) ;
485+ if ( File . Exists ( _config . PatchingOptions . CustomSplashPath ) )
486+ {
487+ apk . RemoveFile ( "assets/vr_splash.png" ) ;
488+ await AddFileToApk ( _config . PatchingOptions . CustomSplashPath , "assets/vr_splash.png" , apk , true ) ;
489+ Log . Information ( "Replaced Splash with custom Image" ) ;
490+ }
491+ else
492+ {
493+ Log . Warning ( "Could not add custom splash screen: file did not exist." ) ;
494+ }
495+ }
496+
478497 Log . Information ( "Patching manifest . . ." ) ;
479498 await PatchManifest ( apk ) ;
480499
@@ -495,8 +514,9 @@ private async Task ModifyApk(string mainPath, string? modloaderPath, string? uni
495514 /// <param name="filePath">The path to the file to copy into the APK</param>
496515 /// <param name="apkFilePath">The name of the file in the APK to create</param>
497516 /// <param name="apk">The apk to copy the file into</param>
517+ /// <param name="useStore">If enabled, compression is disabled and the STORE compression method is used.</param>
498518 /// <exception cref="PatchingException">If the file already exists in the APK, if configured to throw.</exception>
499- private async Task AddFileToApk ( string filePath , string apkFilePath , ApkZip apk )
519+ private async Task AddFileToApk ( string filePath , string apkFilePath , ApkZip apk , bool useStore = false )
500520 {
501521 using var fileStream = File . OpenRead ( filePath ) ;
502522 if ( apk . ContainsFile ( apkFilePath ) )
@@ -511,7 +531,7 @@ private async Task AddFileToApk(string filePath, string apkFilePath, ApkZip apk)
511531 fileStream . Position = 0 ;
512532 }
513533
514- await apk . AddFileAsync ( apkFilePath , fileStream , PatchingCompression ) ;
534+ await apk . AddFileAsync ( apkFilePath , fileStream , useStore ? null : PatchingCompression ) ;
515535 }
516536
517537 /// <summary>
0 commit comments