mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-08 18:33:57 +01:00
Compare commits
15 Commits
v2.186.0-d
...
v2.187.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4680f1dc61 | ||
|
|
70da6d8971 | ||
|
|
1df7df2841 | ||
|
|
c14a7fb66f | ||
|
|
6af4e47947 | ||
|
|
ef704fcf7a | ||
|
|
eefa677b1a | ||
|
|
2bf6d693ec | ||
|
|
acc55fff89 | ||
|
|
82e3ebeeff | ||
|
|
47d096399a | ||
|
|
ae990eac6a | ||
|
|
b7f40c3955 | ||
|
|
807a7b01d3 | ||
|
|
b3ff7efdb2 |
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
@@ -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
|
||||||
|
|||||||
51
CHANGELOG.md
51
CHANGELOG.md
@@ -1,3 +1,54 @@
|
|||||||
|
# [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)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **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))
|
||||||
|
|
||||||
|
# [2.186.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v2.186.0-dev.2...v2.186.0-dev.3) (2023-07-20)
|
||||||
|
|
||||||
|
|
||||||
|
### 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))
|
||||||
|
|
||||||
# [2.186.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v2.186.0-dev.1...v2.186.0-dev.2) (2023-07-20)
|
# [2.186.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v2.186.0-dev.1...v2.186.0-dev.2) (2023-07-20)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.2
|
version = 2.187.0-dev.1
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -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"
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -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()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,7 +18,8 @@ import app.revanced.patches.tiktok.misc.integrations.patch.IntegrationsPatch
|
|||||||
import app.revanced.patches.tiktok.misc.settings.annotations.SettingsCompatibility
|
import app.revanced.patches.tiktok.misc.settings.annotations.SettingsCompatibility
|
||||||
import app.revanced.patches.tiktok.misc.settings.fingerprints.*
|
import app.revanced.patches.tiktok.misc.settings.fingerprints.*
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
|
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
|
||||||
|
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@DependsOn([IntegrationsPatch::class])
|
@DependsOn([IntegrationsPatch::class])
|
||||||
@@ -45,7 +46,9 @@ class SettingsPatch : BytecodePatch(
|
|||||||
AddSettingsEntryFingerprint.result?.apply {
|
AddSettingsEntryFingerprint.result?.apply {
|
||||||
scanResult.patternScanResult?.startIndex?.let {
|
scanResult.patternScanResult?.startIndex?.let {
|
||||||
val settingsEntries = mutableMethod.getInstruction(it + 3)
|
val settingsEntries = mutableMethod.getInstruction(it + 3)
|
||||||
val addEntry = mutableMethod.getInstruction(it + 5)
|
val addEntry = mutableMethod.getInstruction<BuilderInstruction35c>(it + 5)
|
||||||
|
val register1 = addEntry.registerC
|
||||||
|
val register2 = addEntry.registerD
|
||||||
// Add the settings entry created to the settings fragment
|
// Add the settings entry created to the settings fragment
|
||||||
mutableMethod.addInstructions(
|
mutableMethod.addInstructions(
|
||||||
it + 6,
|
it + 6,
|
||||||
@@ -58,10 +61,10 @@ class SettingsPatch : BytecodePatch(
|
|||||||
mutableMethod.addInstructions(
|
mutableMethod.addInstructions(
|
||||||
it + 6,
|
it + 6,
|
||||||
"""
|
"""
|
||||||
const-string v1, "$settingsButtonClass"
|
const-string v$register1, "$settingsButtonClass"
|
||||||
const-string v2, "$settingsButtonInfoClass"
|
const-string v$register2, "$settingsButtonInfoClass"
|
||||||
invoke-static {v1, v2}, $CREATE_SETTINGS_ENTRY_METHOD_DESCRIPTOR
|
invoke-static {v$register1, v$register2}, $CREATE_SETTINGS_ENTRY_METHOD_DESCRIPTOR
|
||||||
move-result-object v1
|
move-result-object v$register2
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -73,14 +76,15 @@ class SettingsPatch : BytecodePatch(
|
|||||||
it.opcode == Opcode.INVOKE_SUPER
|
it.opcode == Opcode.INVOKE_SUPER
|
||||||
} + 1
|
} + 1
|
||||||
|
|
||||||
val thisRegister = getInstruction<FiveRegisterInstruction>(initializeSettingsIndex - 1).registerC
|
val thisRegister = getInstruction<Instruction35c>(initializeSettingsIndex - 1).registerC
|
||||||
|
val usableRegister = implementation!!.registerCount - parameters.size - 2
|
||||||
|
|
||||||
addInstructionsWithLabels(
|
addInstructionsWithLabels(
|
||||||
initializeSettingsIndex,
|
initializeSettingsIndex,
|
||||||
"""
|
"""
|
||||||
invoke-static {v$thisRegister}, $INITIALIZE_SETTINGS_METHOD_DESCRIPTOR
|
invoke-static {v$thisRegister}, $INITIALIZE_SETTINGS_METHOD_DESCRIPTOR
|
||||||
move-result v0
|
move-result v$usableRegister
|
||||||
if-eqz v0, :notrevanced
|
if-eqz v$usableRegister, :notrevanced
|
||||||
return-void
|
return-void
|
||||||
""",
|
""",
|
||||||
ExternalLabel("notrevanced", getInstruction(initializeSettingsIndex))
|
ExternalLabel("notrevanced", getInstruction(initializeSettingsIndex))
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class SpoofAppVersionPatch : BytecodePatch(
|
|||||||
StringResource("revanced_spoof_app_version_user_dialog_message",
|
StringResource("revanced_spoof_app_version_user_dialog_message",
|
||||||
"App version will be spoofed to an older version of YouTube."
|
"App version will be spoofed to an older version of YouTube."
|
||||||
+ "\\n\\nThis will change the appearance and features of the app, but unknown side effects may occur."
|
+ "\\n\\nThis will change the appearance and features of the app, but unknown side effects may occur."
|
||||||
+ "\\n\\nIf later turned off, the old UI may remain until you log out or clear the app data.")
|
+ "\\n\\nIf later turned off, the old UI may remain until the app data is cleared.")
|
||||||
),
|
),
|
||||||
ListPreference(
|
ListPreference(
|
||||||
"revanced_spoof_app_version_target",
|
"revanced_spoof_app_version_target",
|
||||||
@@ -54,7 +54,7 @@ class SpoofAppVersionPatch : BytecodePatch(
|
|||||||
"revanced_spoof_app_version_target_entries",
|
"revanced_spoof_app_version_target_entries",
|
||||||
listOf(
|
listOf(
|
||||||
StringResource("revanced_spoof_app_version_target_entry_1", "17.30.35 - Restore old UI layout"),
|
StringResource("revanced_spoof_app_version_target_entry_1", "17.30.35 - Restore old UI layout"),
|
||||||
StringResource("revanced_spoof_app_version_target_entry_2", "17.01.35 - Enable sorting videos by oldest"),
|
StringResource("revanced_spoof_app_version_target_entry_2", "17.01.35 - Restore old watch history"),
|
||||||
StringResource("revanced_spoof_app_version_target_entry_3", "16.08.35 - Restore explore tab"),
|
StringResource("revanced_spoof_app_version_target_entry_3", "16.08.35 - Restore explore tab"),
|
||||||
StringResource("revanced_spoof_app_version_target_entry_4", "16.01.35 - Restore old Shorts player"),
|
StringResource("revanced_spoof_app_version_target_entry_4", "16.01.35 - Restore old Shorts player"),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user