Compare commits

...

10 Commits

Author SHA1 Message Date
semantic-release-bot
4680f1dc61 chore(release): 2.187.0-dev.1 [skip ci]
# [2.187.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.186.1-dev.1...v2.187.0-dev.1) (2023-07-24)

### Features

* **Sync for Reddit:** add `Disable Sync for Lemmy bottom sheet` patch ([70da6d8](70da6d8971))
2023-07-24 23:41:28 +00:00
oSumAtrIX
70da6d8971 feat(Sync for Reddit): add Disable Sync for Lemmy bottom sheet patch 2023-07-25 01:36:28 +02:00
semantic-release-bot
1df7df2841 chore(release): 2.186.1-dev.1 [skip ci]
## [2.186.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.186.0...v2.186.1-dev.1) (2023-07-21)

### Bug Fixes

* **YouTube - Theme:** only set splash screen color if background colors are set ([c14a7fb](c14a7fb66f))
2023-07-21 22:11:35 +00:00
oSumAtrIX
c14a7fb66f fix(YouTube - Theme): only set splash screen color if background colors are set 2023-07-22 00:08:25 +02:00
oSumAtrIX
6af4e47947 ci: clean after building 2023-07-21 19:17:06 +02:00
semantic-release-bot
ef704fcf7a chore(release): 2.186.0 [skip ci]
# [2.186.0](https://github.com/ReVanced/revanced-patches/compare/v2.185.0...v2.186.0) (2023-07-21)

### Bug Fixes

* **Tiktok - Settings:** get instruction registers dynamically ([#2676](https://github.com/ReVanced/revanced-patches/issues/2676)) ([b3ff7ef](b3ff7efdb2))
* **YouTube - Spoof app version:** update target app version description ([#2666](https://github.com/ReVanced/revanced-patches/issues/2666)) ([ae990ea](ae990eac6a))
* **YouTube - Theme:** allow setting no background color ([82e3ebe](82e3ebeeff))
* **YouTube - Theme:** apply custom seekbar color to shorts ([#2670](https://github.com/ReVanced/revanced-patches/issues/2670)) ([a19fa4e](a19fa4e087))

### Features

* **Twitter:** remove `Hide view stats` patch ([4e1c9b9](4e1c9b9ec2))
* **Youtube - Theme:** add a switch to enable/disable custom seekbar color ([#2663](https://github.com/ReVanced/revanced-patches/issues/2663)) ([dd7c663](dd7c663df6))
2023-07-21 15:08:14 +00:00
oSumAtrIX
eefa677b1a chore: merge branch dev to main (#2674) 2023-07-21 17:04:32 +02:00
oSumAtrIX
2bf6d693ec ci: do not cache build directory 2023-07-21 16:57:20 +02:00
semantic-release-bot
acc55fff89 chore(release): 2.186.0-dev.5 [skip ci]
# [2.186.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v2.186.0-dev.4...v2.186.0-dev.5) (2023-07-20)

### Bug Fixes

* **YouTube - Theme:** allow setting no background color ([82e3ebe](82e3ebeeff))
2023-07-20 22:13:30 +00:00
oSumAtrIX
82e3ebeeff fix(YouTube - Theme): allow setting no background color 2023-07-21 00:10:48 +02:00
7 changed files with 112 additions and 25 deletions

View File

@@ -30,13 +30,12 @@ jobs:
${{ runner.home }}/.gradle/caches ${{ runner.home }}/.gradle/caches
${{ runner.home }}/.gradle/wrapper ${{ runner.home }}/.gradle/wrapper
.gradle .gradle
build
node_modules node_modules
key: ${{ runner.os }}-gradle-npm-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'package-lock.json') }} key: ${{ runner.os }}-gradle-npm-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'package-lock.json') }}
- name: Build with Gradle - name: Build with Gradle
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew generateMeta clean --no-daemon run: ./gradlew generateMeta clean
- name: Setup semantic-release - name: Setup semantic-release
run: npm install run: npm install
- name: Release - name: Release

View File

@@ -1,3 +1,40 @@
# [2.187.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.186.1-dev.1...v2.187.0-dev.1) (2023-07-24)
### Features
* **Sync for Reddit:** add `Disable Sync for Lemmy bottom sheet` patch ([56b535b](https://github.com/ReVanced/revanced-patches/commit/56b535b2a136d4b0afbddf2c8e251889c2555056))
## [2.186.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.186.0...v2.186.1-dev.1) (2023-07-21)
### Bug Fixes
* **YouTube - Theme:** only set splash screen color if background colors are set ([f058db4](https://github.com/ReVanced/revanced-patches/commit/f058db4ba4300400ac92b4a9790708eb8bde7092))
# [2.186.0](https://github.com/ReVanced/revanced-patches/compare/v2.185.0...v2.186.0) (2023-07-21)
### Bug Fixes
* **Tiktok - Settings:** get instruction registers dynamically ([#2676](https://github.com/ReVanced/revanced-patches/issues/2676)) ([b34e45b](https://github.com/ReVanced/revanced-patches/commit/b34e45b6dafad8e9d567ad65f58a182b8cc04676))
* **YouTube - Spoof app version:** update target app version description ([#2666](https://github.com/ReVanced/revanced-patches/issues/2666)) ([307442e](https://github.com/ReVanced/revanced-patches/commit/307442e654ff5486656319d91e4a5f5fb2b92651))
* **YouTube - Theme:** allow setting no background color ([8a4e77a](https://github.com/ReVanced/revanced-patches/commit/8a4e77a290a61a1caf93eb8bccaf728c84a3ef53))
* **YouTube - Theme:** apply custom seekbar color to shorts ([#2670](https://github.com/ReVanced/revanced-patches/issues/2670)) ([1f6fe3d](https://github.com/ReVanced/revanced-patches/commit/1f6fe3da4284fd768057ef068c7ddf88d3a11049))
### Features
* **Twitter:** remove `Hide view stats` patch ([f0d3800](https://github.com/ReVanced/revanced-patches/commit/f0d38001b34db63f212209afb91eebf59dad2b24))
* **Youtube - Theme:** add a switch to enable/disable custom seekbar color ([#2663](https://github.com/ReVanced/revanced-patches/issues/2663)) ([5c39985](https://github.com/ReVanced/revanced-patches/commit/5c39985888cdfe3acfdd8811ff9b6f80e243704e))
# [2.186.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v2.186.0-dev.4...v2.186.0-dev.5) (2023-07-20)
### Bug Fixes
* **YouTube - Theme:** allow setting no background color ([8a4e77a](https://github.com/ReVanced/revanced-patches/commit/8a4e77a290a61a1caf93eb8bccaf728c84a3ef53))
# [2.186.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v2.186.0-dev.3...v2.186.0-dev.4) (2023-07-20) # [2.186.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v2.186.0-dev.3...v2.186.0-dev.4) (2023-07-20)

View File

@@ -1,4 +1,4 @@
org.gradle.parallel = true org.gradle.parallel = true
org.gradle.caching = true org.gradle.caching = true
kotlin.code.style = official kotlin.code.style = official
version = 2.186.0-dev.4 version = 2.187.0-dev.1

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,9 @@
package app.revanced.patches.reddit.customclients.syncforreddit.annoyances.startup.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object MainActivityOnCreate : MethodFingerprint(
customFingerprint = custom@{ method, classDef ->
classDef.type.endsWith("MainActivity;") && method.name == "onCreate"
}
)

View File

@@ -0,0 +1,35 @@
package app.revanced.patches.reddit.customclients.syncforreddit.annoyances.startup.patch
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Package
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.reddit.customclients.syncforreddit.annoyances.startup.fingerprints.MainActivityOnCreate
@Patch
@Name("Disable Sync for Lemmy bottom sheet")
@Description("Disables the bottom sheet at the startup that asks you to signup to \"Sync for Lemmy\".")
@Compatibility(
[
Package("com.laurencedawson.reddit_sync", ["v23.06.30-13:39"]),
Package("com.laurencedawson.reddit_sync.pro"), // Version unknown.
Package("com.laurencedawson.reddit_sync.dev") // Version unknown.
]
)
class DisableSyncForLemmyBottomSheetPatch : BytecodePatch(listOf(MainActivityOnCreate)) {
override fun execute(context: BytecodeContext): PatchResult {
MainActivityOnCreate.result?.mutableMethod?.apply {
val showBottomSheetIndex = implementation!!.instructions.lastIndex - 1
removeInstruction(showBottomSheetIndex)
}
return PatchResultSuccess()
}
}

View File

@@ -45,8 +45,8 @@ class ThemeResourcePatch : ResourcePatch {
node.textContent = when (node.getAttribute("name")) { node.textContent = when (node.getAttribute("name")) {
"yt_black0", "yt_black1", "yt_black1_opacity95", "yt_black1_opacity98", "yt_black2", "yt_black3", "yt_black0", "yt_black1", "yt_black1_opacity95", "yt_black1_opacity98", "yt_black2", "yt_black3",
"yt_black4", "yt_status_bar_background_dark", "material_grey_850" -> darkThemeBackgroundColor "yt_black4", "yt_status_bar_background_dark", "material_grey_850"
?: continue -> darkThemeBackgroundColor ?: continue
"yt_white1", "yt_white1_opacity95", "yt_white1_opacity98", "yt_white1", "yt_white1_opacity95", "yt_white1_opacity98",
"yt_white2", "yt_white3", "yt_white4", "yt_white2", "yt_white3", "yt_white4",
@@ -58,36 +58,43 @@ class ThemeResourcePatch : ResourcePatch {
} }
// Add a dynamic background color to the colors.xml file. // Add a dynamic background color to the colors.xml file.
addResourceColor(context, "res/values/colors.xml", lightThemeBackgroundColor?.let {
SPLASH_BACKGROUND_COLOR, lightThemeBackgroundColor!!) addColorResource(context, "res/values/colors.xml", SPLASH_BACKGROUND_COLOR, it)
addResourceColor(context, "res/values-night/colors.xml", }
SPLASH_BACKGROUND_COLOR, darkThemeBackgroundColor!!)
// Edit splash screen files and change the background color. darkThemeBackgroundColor?.let {
val splashScreenResourceFiles = listOf( addColorResource(context, "res/values-night/colors.xml", SPLASH_BACKGROUND_COLOR, it)
"res/drawable/quantum_launchscreen_youtube.xml", }
"res/drawable-sw600dp/quantum_launchscreen_youtube.xml")
splashScreenResourceFiles.forEach editSplashScreen@ { resourceFile -> // Edit splash screen files and change the background color,
context.xmlEditor[resourceFile].use { // if the background colors are set.
val layerList = it.file.getElementsByTagName("layer-list").item(0) as Element if (darkThemeBackgroundColor != null && lightThemeBackgroundColor != null) {
val splashScreenResourceFiles = listOf(
"res/drawable/quantum_launchscreen_youtube.xml",
"res/drawable-sw600dp/quantum_launchscreen_youtube.xml")
val childNodes = layerList.childNodes splashScreenResourceFiles.forEach editSplashScreen@ { resourceFile ->
for (i in 0 until childNodes.length) { context.xmlEditor[resourceFile].use {
val node = childNodes.item(i) val layerList = it.file.getElementsByTagName("layer-list").item(0) as Element
if (node is Element && node.hasAttribute("android:drawable")) {
node.setAttribute("android:drawable", "@color/$SPLASH_BACKGROUND_COLOR") val childNodes = layerList.childNodes
return@editSplashScreen for (i in 0 until childNodes.length) {
val node = childNodes.item(i)
if (node is Element && node.hasAttribute("android:drawable")) {
node.setAttribute("android:drawable", "@color/$SPLASH_BACKGROUND_COLOR")
return@editSplashScreen
}
} }
return PatchResultError("Failed to modify launch screen")
} }
return PatchResultError("Failed to modify launch screen")
} }
} }
return PatchResultSuccess() return PatchResultSuccess()
} }
private fun addResourceColor( private fun addColorResource(
context: ResourceContext, context: ResourceContext,
resourceFile: String, resourceFile: String,
colorName: String, colorName: String,