mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-29 05:31:02 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa536957cc | ||
|
|
980deec6af | ||
|
|
658638bfad | ||
|
|
d5ee3b006d |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,3 +1,17 @@
|
|||||||
|
# [2.70.0](https://github.com/revanced/revanced-patches/compare/v2.69.4...v2.70.0) (2022-09-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* `monochrome-icon` patch ([#643](https://github.com/revanced/revanced-patches/issues/643)) ([127c8e5](https://github.com/revanced/revanced-patches/commit/127c8e54e54709c2716029044ae337ad53daafad))
|
||||||
|
|
||||||
|
## [2.69.4](https://github.com/revanced/revanced-patches/compare/v2.69.3...v2.69.4) (2022-09-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **sponsorblock:** dynamically insert `setSponsorBarRect` call ([#644](https://github.com/revanced/revanced-patches/issues/644)) ([998a249](https://github.com/revanced/revanced-patches/commit/998a249a23d09eb752b35c4da731f4223be40a3b))
|
||||||
|
|
||||||
## [2.69.3](https://github.com/revanced/revanced-patches/compare/v2.69.2...v2.69.3) (2022-09-27)
|
## [2.69.3](https://github.com/revanced/revanced-patches/compare/v2.69.2...v2.69.3) (2022-09-27)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ The official Patch bundle provided by ReVanced and the community.
|
|||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `monochrome-icon` | Adds a monochrome icon. | all |
|
||||||
| `timeline-ads` | Removes ads from the Twitter timeline. | all |
|
| `timeline-ads` | Removes ads from the Twitter timeline. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.69.3
|
version = 2.70.0
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,9 @@
|
|||||||
|
package app.revanced.patches.twitter.misc.monochrome.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility([Package("com.twitter.android")])
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class MonochromeIconCompatibility
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package app.revanced.patches.twitter.misc.monochrome.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.impl.DomFileEditor
|
||||||
|
import app.revanced.patcher.data.impl.ResourceData
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.patch.impl.ResourcePatch
|
||||||
|
import app.revanced.patches.twitter.misc.monochrome.annotations.MonochromeIconCompatibility
|
||||||
|
import java.nio.file.Files
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("monochrome-icon")
|
||||||
|
@Description("Adds a monochrome icon.")
|
||||||
|
@MonochromeIconCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class MonochromeIconPatch : ResourcePatch() {
|
||||||
|
override fun execute(data: ResourceData): PatchResult {
|
||||||
|
val resDirectory = data["res"]
|
||||||
|
if (!resDirectory.isDirectory) return PatchResultError("The res folder can not be found.")
|
||||||
|
|
||||||
|
val mipmapV33Directory = resDirectory.resolve("mipmap-anydpi-v33")
|
||||||
|
if (!mipmapV33Directory.isDirectory) Files.createDirectories(mipmapV33Directory.toPath())
|
||||||
|
|
||||||
|
Files.writeString(
|
||||||
|
mipmapV33Directory.resolve("ic_launcher_twitter.xml").toPath(),
|
||||||
|
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
|
||||||
|
"<adaptive-icon\n" +
|
||||||
|
" xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" +
|
||||||
|
" <background android:drawable=\"@color/ic_launcher_background\" />\n" +
|
||||||
|
" <foreground android:drawable=\"@mipmap/ic_launcher_twitter_foreground\" />\n" +
|
||||||
|
" <monochrome android:drawable=\"@mipmap/ic_launcher_twitter_foreground\" />\n" +
|
||||||
|
"</adaptive-icon>"
|
||||||
|
)
|
||||||
|
|
||||||
|
Files.writeString(
|
||||||
|
mipmapV33Directory.resolve("ic_launcher_twitter_round.xml").toPath(),
|
||||||
|
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
|
||||||
|
"<adaptive-icon\n" +
|
||||||
|
" xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" +
|
||||||
|
" <background android:drawable=\"@color/ic_launcher_background\" />\n" +
|
||||||
|
" <foreground android:drawable=\"@mipmap/ic_launcher_twitter_foreground\" />\n" +
|
||||||
|
" <monochrome android:drawable=\"@mipmap/ic_launcher_twitter_foreground\" />\n" +
|
||||||
|
"</adaptive-icon>"
|
||||||
|
)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -99,10 +99,14 @@ class SponsorBlockBytecodePatch : BytecodePatch(
|
|||||||
/*
|
/*
|
||||||
Get the instance of the seekbar rectangle
|
Get the instance of the seekbar rectangle
|
||||||
*/
|
*/
|
||||||
seekbarMethod.addInstruction(
|
for ((index, instruction) in seekbarMethodInstructions.withIndex()) {
|
||||||
1,
|
if (instruction.opcode != Opcode.MOVE_OBJECT_FROM16) continue
|
||||||
"invoke-static {v0}, Lapp/revanced/integrations/sponsorblock/PlayerController;->setSponsorBarRect(Ljava/lang/Object;)V"
|
seekbarMethod.addInstruction(
|
||||||
)
|
index + 1,
|
||||||
|
"invoke-static {v0}, Lapp/revanced/integrations/sponsorblock/PlayerController;->setSponsorBarRect(Ljava/lang/Object;)V"
|
||||||
|
)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
for ((index, instruction) in seekbarMethodInstructions.withIndex()) {
|
for ((index, instruction) in seekbarMethodInstructions.withIndex()) {
|
||||||
if (instruction.opcode != Opcode.INVOKE_STATIC) continue
|
if (instruction.opcode != Opcode.INVOKE_STATIC) continue
|
||||||
|
|||||||
Reference in New Issue
Block a user