@@ -201,24 +201,28 @@ private async Task PatchManifest(ApkZip apk)
201
201
"org.khronos.openxr.permission.OPENXR_SYSTEM" ,
202
202
} ) ;
203
203
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" ) } ,
206
207
} ;
207
- AxmlElement runtimeIntent = new ( "intent" ) {
208
+ AxmlElement runtimeIntent = new ( "intent" )
209
+ {
208
210
Children = {
209
211
new ( "action" ) {
210
212
Attributes = { new ( "name" , AndroidNamespaceUri , NameAttributeResourceId , "org.khronos.openxr.OpenXRRuntimeService" ) } ,
211
213
} ,
212
214
} ,
213
215
} ;
214
- AxmlElement layerIntent = new ( "intent" ) {
216
+ AxmlElement layerIntent = new ( "intent" )
217
+ {
215
218
Children = {
216
219
new ( "action" ) {
217
220
Attributes = { new ( "name" , AndroidNamespaceUri , NameAttributeResourceId , "org.khronos.openxr.OpenXRApiLayerService" ) } ,
218
221
} ,
219
222
} ,
220
223
} ;
221
- manifest . Children . Add ( new ( "queries" ) {
224
+ manifest . Children . Add ( new ( "queries" )
225
+ {
222
226
Children = {
223
227
providerElement ,
224
228
runtimeIntent ,
@@ -475,6 +479,21 @@ private async Task ModifyApk(string mainPath, string? modloaderPath, string? uni
475
479
await AddFlatscreenSupport ( apk , ovrPlatformSdkPath ! ) ;
476
480
}
477
481
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
+
478
497
Log . Information ( "Patching manifest . . ." ) ;
479
498
await PatchManifest ( apk ) ;
480
499
@@ -495,8 +514,9 @@ private async Task ModifyApk(string mainPath, string? modloaderPath, string? uni
495
514
/// <param name="filePath">The path to the file to copy into the APK</param>
496
515
/// <param name="apkFilePath">The name of the file in the APK to create</param>
497
516
/// <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>
498
518
/// <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 )
500
520
{
501
521
using var fileStream = File . OpenRead ( filePath ) ;
502
522
if ( apk . ContainsFile ( apkFilePath ) )
@@ -511,7 +531,7 @@ private async Task AddFileToApk(string filePath, string apkFilePath, ApkZip apk)
511
531
fileStream . Position = 0 ;
512
532
}
513
533
514
- await apk . AddFileAsync ( apkFilePath , fileStream , PatchingCompression ) ;
534
+ await apk . AddFileAsync ( apkFilePath , fileStream , useStore ? null : PatchingCompression ) ;
515
535
}
516
536
517
537
/// <summary>
0 commit comments