File tree Expand file tree Collapse file tree 6 files changed +44
-3
lines changed
kotlin/app/revanced/patches
youtube/layout/branding/header
resources/branding-license Expand file tree Collapse file tree 6 files changed +44
-3
lines changed Original file line number Diff line number Diff line change 1+ package app.revanced.patches.shared.layout.branding
2+
3+ import app.revanced.patcher.patch.rawResourcePatch
4+ import app.revanced.util.inputStreamFromBundledResource
5+ import java.nio.file.Files
6+
7+ /* *
8+ * Copies a branding license text file to the target apk.
9+ *
10+ * This patch must be a dependency for all patches that add ReVanced branding to the target app.
11+ */
12+ internal val addBrandLicensePatch = rawResourcePatch {
13+ execute {
14+ val brandingLicenseFileName = " LICENSE_REVANCED.TXT"
15+
16+ val inputFileStream = inputStreamFromBundledResource(
17+ " branding-license" ,
18+ brandingLicenseFileName
19+ )!!
20+
21+ val targetFile = get(brandingLicenseFileName, false ).toPath()
22+
23+ Files .copy(inputFileStream, targetFile)
24+ }
25+ }
Original file line number Diff line number Diff line change @@ -123,6 +123,7 @@ internal fun baseCustomBrandingPatch(
123123 dependsOn(
124124 addResourcesPatch,
125125 resourceMappingPatch,
126+ addBrandLicensePatch,
126127 bytecodePatch {
127128 execute {
128129 mainActivityOnCreateFingerprint.method.addInstruction(
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import app.revanced.patcher.patch.resourcePatch
66import app.revanced.patches.all.misc.resources.addResource
77import app.revanced.patches.all.misc.resources.addResources
88import app.revanced.patches.all.misc.resources.addResourcesPatch
9+ import app.revanced.patches.shared.layout.branding.addBrandLicensePatch
910import app.revanced.patches.shared.misc.settings.preference.BasePreference
1011import app.revanced.patches.shared.misc.settings.preference.IntentPreference
1112import app.revanced.patches.shared.misc.settings.preference.PreferenceCategory
@@ -61,7 +62,11 @@ fun settingsPatch (
6162 rootPreferences : List <Pair <BasePreference , String >>? = null,
6263 preferences : Set <BasePreference >,
6364) = resourcePatch {
64- dependsOn(addResourcesPatch, settingsColorPatch)
65+ dependsOn(
66+ addResourcesPatch,
67+ settingsColorPatch,
68+ addBrandLicensePatch
69+ )
6570
6671 execute {
6772 copyResources(
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWith
55import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
66import app.revanced.patcher.patch.bytecodePatch
77import app.revanced.patcher.util.smali.ExternalLabel
8+ import app.revanced.patches.shared.layout.branding.addBrandLicensePatch
89import app.revanced.patches.tiktok.misc.extension.sharedExtensionPatch
910import com.android.tools.smali.dexlib2.Opcode
1011import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction22c
@@ -18,7 +19,7 @@ val settingsPatch = bytecodePatch(
1819 name = " Settings" ,
1920 description = " Adds ReVanced settings to TikTok." ,
2021) {
21- dependsOn(sharedExtensionPatch)
22+ dependsOn(sharedExtensionPatch, addBrandLicensePatch )
2223
2324 compatibleWith(
2425 " com.ss.android.ugc.trill" (" 36.5.4" ),
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import app.revanced.patcher.patch.stringOption
99import app.revanced.patcher.util.Document
1010import app.revanced.patches.all.misc.resources.addResources
1111import app.revanced.patches.all.misc.resources.addResourcesPatch
12+ import app.revanced.patches.shared.layout.branding.addBrandLicensePatch
1213import app.revanced.patches.shared.misc.mapping.get
1314import app.revanced.patches.shared.misc.mapping.resourceMappingPatch
1415import app.revanced.patches.shared.misc.mapping.resourceMappings
@@ -54,7 +55,10 @@ private val customHeaderResourceFileNames = variants.map { variant ->
5455private const val EXTENSION_CLASS_DESCRIPTOR = " Lapp/revanced/extension/youtube/patches/ChangeHeaderPatch;"
5556
5657private val changeHeaderBytecodePatch = bytecodePatch {
57- dependsOn(resourceMappingPatch)
58+ dependsOn(
59+ resourceMappingPatch,
60+ addBrandLicensePatch
61+ )
5862
5963 execute {
6064 // Verify images exist. Resources are not used during patching but extension code does.
Original file line number Diff line number Diff line change 1+ The ReVanced branding found in this software is copyrighted and not covered under the GPL.
2+
3+ To use or distribute ReVanced branding, you must obtain permission by contacting
[email protected] 4+
5+ For more information see https://github.com/ReVanced/revanced-branding
You can’t perform that action at this time.
0 commit comments