Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ internal fun baseCustomBrandingPatch(
dependsOn(
addResourcesPatch,
resourceMappingPatch,
addBrandLicensePatch,
bytecodePatch {
execute {
mainActivityOnCreateFingerprint.method.addInstruction(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,7 +29,10 @@ private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/ChangeHeaderPatch;"

private val changeHeaderBytecodePatch = bytecodePatch {
dependsOn(resourceMappingPatch)
dependsOn(
resourceMappingPatch,
addBrandLicensePatch
)

execute {
// Resources are not used during patching, but extension code uses these
Expand Down
Original file line number Diff line number Diff line change
@@ -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 [email protected]

For more information see https://github.com/ReVanced/revanced-branding
Loading