This repository has been archived by the owner on Jul 26, 2024. It is now read-only.
generated from ReVanced/revanced-patches-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(twitter): grey theme(replaces lightsout), og app name (#6)
- Loading branch information
1 parent
e86a296
commit 2c2dbc1
Showing
18 changed files
with
524 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ plugins { | |
`maven-publish` | ||
} | ||
|
||
group = "your.org" | ||
group = "indus.org" | ||
|
||
repositories { | ||
mavenCentral() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
org.gradle.parallel = true | ||
org.gradle.caching = true | ||
kotlin.code.style = official | ||
version = 1.0.0 | ||
version = 1.1.0-dev.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/kotlin/indus/org/patches/twitter/ads/HideAdsHookPatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package indus.org.patches.twitter.ads | ||
|
||
import app.revanced.patcher.patch.annotation.CompatiblePackage | ||
import app.revanced.patcher.patch.annotation.Patch | ||
import indus.org.patches.twitter.json.JsonHookPatch | ||
import indus.org.patches.twitter.recommendation.BaseHookPatch | ||
|
||
@Patch( | ||
name = "Hide recommended users", | ||
dependencies = [JsonHookPatch::class], | ||
compatiblePackages = [CompatiblePackage("com.twitter.android")] | ||
) | ||
@Suppress("unused") | ||
object HideRecommendedUsersPatch : BaseHookPatch( | ||
"Lapp/revanced/integrations/twitter/patches/hook/patch/recommendation/RecommendedUsersHook;" | ||
) |
32 changes: 32 additions & 0 deletions
32
src/main/kotlin/indus/org/patches/twitter/brand/OGTwitterBrand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package indus.org.patches.twitter.brand | ||
|
||
import app.revanced.patcher.data.ResourceContext | ||
import app.revanced.patcher.patch.PatchException | ||
import app.revanced.patcher.patch.ResourcePatch | ||
import app.revanced.patcher.patch.annotation.CompatiblePackage | ||
import app.revanced.patcher.patch.annotation.Patch | ||
|
||
@Patch( | ||
name = "OG Twitter brand name", | ||
description = "Replaces the app name from nonsense X to Twitter.Experimental [may cause some issues]", | ||
compatiblePackages = [CompatiblePackage("com.twitter.android")] | ||
) | ||
@Suppress("unused") | ||
object OGTwitterBrand : ResourcePatch() { | ||
|
||
override fun execute(context: ResourceContext) { | ||
|
||
val manifestFile = context["AndroidManifest.xml"] | ||
if (!manifestFile.isFile) throw PatchException("Manifest file can not be found.") | ||
|
||
context.xmlEditor["AndroidManifest.xml"].use { editor -> | ||
val document = editor.file | ||
|
||
// Modify the app name in the application node | ||
val applicationNode = document.getElementsByTagName("application").item(0) | ||
val appNameAttribute = applicationNode.attributes.getNamedItem("android:label") | ||
appNameAttribute.textContent = "Twitter" | ||
|
||
} | ||
} | ||
} |
Oops, something went wrong.