mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-07 01:51:27 +01:00
chore: Add branding license text file (#6179)
This commit is contained in:
committed by
GitHub
parent
dfdbbfa047
commit
38d9299dfe
@@ -0,0 +1,25 @@
|
||||
package app.revanced.patches.shared.layout.branding
|
||||
|
||||
import app.revanced.patcher.patch.rawResourcePatch
|
||||
import app.revanced.util.inputStreamFromBundledResource
|
||||
import java.nio.file.Files
|
||||
|
||||
/**
|
||||
* Copies a branding license text file to the target apk.
|
||||
*
|
||||
* This patch must be a dependency for all patches that add ReVanced branding to the target app.
|
||||
*/
|
||||
internal val addBrandLicensePatch = rawResourcePatch {
|
||||
execute {
|
||||
val brandingLicenseFileName = "LICENSE_REVANCED.TXT"
|
||||
|
||||
val inputFileStream = inputStreamFromBundledResource(
|
||||
"branding-license",
|
||||
brandingLicenseFileName
|
||||
)!!
|
||||
|
||||
val targetFile = get(brandingLicenseFileName, false).toPath()
|
||||
|
||||
Files.copy(inputFileStream, targetFile)
|
||||
}
|
||||
}
|
||||
@@ -123,6 +123,7 @@ internal fun baseCustomBrandingPatch(
|
||||
dependsOn(
|
||||
addResourcesPatch,
|
||||
resourceMappingPatch,
|
||||
addBrandLicensePatch,
|
||||
bytecodePatch {
|
||||
execute {
|
||||
mainActivityOnCreateFingerprint.method.addInstruction(
|
||||
|
||||
@@ -6,6 +6,7 @@ import app.revanced.patcher.patch.resourcePatch
|
||||
import app.revanced.patches.all.misc.resources.addResource
|
||||
import app.revanced.patches.all.misc.resources.addResources
|
||||
import app.revanced.patches.all.misc.resources.addResourcesPatch
|
||||
import app.revanced.patches.shared.layout.branding.addBrandLicensePatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.BasePreference
|
||||
import app.revanced.patches.shared.misc.settings.preference.IntentPreference
|
||||
import app.revanced.patches.shared.misc.settings.preference.PreferenceCategory
|
||||
@@ -61,7 +62,11 @@ fun settingsPatch (
|
||||
rootPreferences: List<Pair<BasePreference, String>>? = null,
|
||||
preferences: Set<BasePreference>,
|
||||
) = resourcePatch {
|
||||
dependsOn(addResourcesPatch, settingsColorPatch)
|
||||
dependsOn(
|
||||
addResourcesPatch,
|
||||
settingsColorPatch,
|
||||
addBrandLicensePatch
|
||||
)
|
||||
|
||||
execute {
|
||||
copyResources(
|
||||
|
||||
@@ -5,6 +5,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWith
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.shared.layout.branding.addBrandLicensePatch
|
||||
import app.revanced.patches.tiktok.misc.extension.sharedExtensionPatch
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction22c
|
||||
@@ -18,7 +19,7 @@ val settingsPatch = bytecodePatch(
|
||||
name = "Settings",
|
||||
description = "Adds ReVanced settings to TikTok.",
|
||||
) {
|
||||
dependsOn(sharedExtensionPatch)
|
||||
dependsOn(sharedExtensionPatch, addBrandLicensePatch)
|
||||
|
||||
compatibleWith(
|
||||
"com.ss.android.ugc.trill"("36.5.4"),
|
||||
|
||||
@@ -9,6 +9,7 @@ import app.revanced.patcher.patch.stringOption
|
||||
import app.revanced.patcher.util.Document
|
||||
import app.revanced.patches.all.misc.resources.addResources
|
||||
import app.revanced.patches.all.misc.resources.addResourcesPatch
|
||||
import app.revanced.patches.shared.layout.branding.addBrandLicensePatch
|
||||
import app.revanced.patches.shared.misc.mapping.get
|
||||
import app.revanced.patches.shared.misc.mapping.resourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.mapping.resourceMappings
|
||||
@@ -54,7 +55,10 @@ private val customHeaderResourceFileNames = variants.map { variant ->
|
||||
private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/ChangeHeaderPatch;"
|
||||
|
||||
private val changeHeaderBytecodePatch = bytecodePatch {
|
||||
dependsOn(resourceMappingPatch)
|
||||
dependsOn(
|
||||
resourceMappingPatch,
|
||||
addBrandLicensePatch
|
||||
)
|
||||
|
||||
execute {
|
||||
// Verify images exist. Resources are not used during patching but extension code does.
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
The ReVanced branding found in this software is copyrighted and not covered under the GPL.
|
||||
|
||||
To use or distribute ReVanced branding, you must obtain permission by contacting branding@revanced.app
|
||||
|
||||
For more information see https://github.com/ReVanced/revanced-branding
|
||||
Reference in New Issue
Block a user