feat(YouTube - Change header): Change to ReVanced borderless logo header by default (#2512)
Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
co-authored by
LisoUseInAIKyrios
parent
2debdc1056
commit
60d70e5877
@@ -5,6 +5,7 @@ import app.revanced.patcher.util.DomFileEditor
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import org.w3c.dom.Node
|
||||
import java.io.InputStream
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.StandardCopyOption
|
||||
|
||||
@@ -53,13 +54,18 @@ fun ResourceContext.copyResources(sourceResourceDirectory: String, vararg resour
|
||||
resourceGroup.resources.forEach { resource ->
|
||||
val resourceFile = "${resourceGroup.resourceDirectoryName}/$resource"
|
||||
Files.copy(
|
||||
classLoader.getResourceAsStream("$sourceResourceDirectory/$resourceFile")!!,
|
||||
inputStreamFromBundledResource(sourceResourceDirectory, resourceFile)!!,
|
||||
targetResourceDirectory.resolve(resourceFile).toPath(), StandardCopyOption.REPLACE_EXISTING
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal fun inputStreamFromBundledResource(
|
||||
sourceResourceDirectory: String,
|
||||
resourceFile: String
|
||||
): InputStream? = classLoader.getResourceAsStream("$sourceResourceDirectory/$resourceFile")
|
||||
|
||||
/**
|
||||
* Resource names mapped to their corresponding resource data.
|
||||
* @param resourceDirectoryName The name of the directory of the resource.
|
||||
|
||||
Reference in New Issue
Block a user