mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-22 18:23:59 +00:00
Compare commits
45 Commits
v2.188.0-d
...
v2.190.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc6fa70d6f | ||
|
|
3d93a9d851 | ||
|
|
426c4c2600 | ||
|
|
8bcbd8443d | ||
|
|
1d01155b47 | ||
|
|
bada0ea50f | ||
|
|
0a9e0982da | ||
|
|
078e5d3b88 | ||
|
|
2adfc37a66 | ||
|
|
392021124c | ||
|
|
d5dd8a22de | ||
|
|
03725b853a | ||
|
|
3938f2f1b3 | ||
|
|
ce2e46a7cb | ||
|
|
75a113d327 | ||
|
|
9bc4323a80 | ||
|
|
74ef6843cb | ||
|
|
4318cf7121 | ||
|
|
a4b33f2063 | ||
|
|
5979230705 | ||
|
|
79b037d044 | ||
|
|
c5ef490eee | ||
|
|
69092def55 | ||
|
|
004aae8258 | ||
|
|
c378869941 | ||
|
|
52e70866d9 | ||
|
|
c7e1dd7563 | ||
|
|
3d4ef97c1e | ||
|
|
040f612818 | ||
|
|
520eb07277 | ||
|
|
a471605db7 | ||
|
|
31b5d506a5 | ||
|
|
1168c0cdf4 | ||
|
|
eeab2fa705 | ||
|
|
c10de2da22 | ||
|
|
bae5c8a70d | ||
|
|
a388592019 | ||
|
|
269fa7fa48 | ||
|
|
f4c2c19f1d | ||
|
|
1817dbd10c | ||
|
|
3072412c79 | ||
|
|
52df1e6814 | ||
|
|
038d6b215a | ||
|
|
4f7618c980 | ||
|
|
9893c99009 |
169
CHANGELOG.md
169
CHANGELOG.md
@@ -1,3 +1,172 @@
|
|||||||
|
# [2.190.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v2.190.0-dev.1...v2.190.0-dev.2) (2023-08-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Infinity for Reddit - Spoof client:** Support latest version ([8a5311b](https://github.com/ReVanced/revanced-patches/commit/8a5311b1e645ca2aab1e416d647cf52bf0be6e7f))
|
||||||
|
|
||||||
|
# [2.190.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.189.0...v2.190.0-dev.1) (2023-08-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **Photomath:** Support latest version ([5a2cad0](https://github.com/ReVanced/revanced-patches/commit/5a2cad077f03880ee1417c5cfd448bbdea4c07e2))
|
||||||
|
|
||||||
|
# [2.189.0](https://github.com/ReVanced/revanced-patches/compare/v2.188.1...v2.189.0) (2023-08-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Restore previous release ([f7352fe](https://github.com/ReVanced/revanced-patches/commit/f7352feb6e9604162b52072d74310b9e3067bc69))
|
||||||
|
|
||||||
|
# [2.189.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.188.1...v2.189.0-dev.1) (2023-08-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Restore previous release ([f7352fe](https://github.com/ReVanced/revanced-patches/commit/f7352feb6e9604162b52072d74310b9e3067bc69))
|
||||||
|
|
||||||
|
## [2.188.1](https://github.com/ReVanced/revanced-patches/compare/v2.188.0...v2.188.1) (2023-08-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Revert previous release ([ed24a20](https://github.com/ReVanced/revanced-patches/commit/ed24a201a9fbe08dd6694582d0ab08ced8ad026a))
|
||||||
|
|
||||||
|
## [2.188.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.188.0...v2.188.1-dev.1) (2023-08-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Revert previous release ([ed24a20](https://github.com/ReVanced/revanced-patches/commit/ed24a201a9fbe08dd6694582d0ab08ced8ad026a))
|
||||||
|
|
||||||
|
# [2.188.0](https://github.com/ReVanced/revanced-patches/compare/v2.187.0...v2.188.0) (2023-08-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* allow using `PreferenceScreen` outside of current module ([fe94013](https://github.com/ReVanced/revanced-patches/commit/fe94013a2235953b32fed6e0710a252698a264b3))
|
||||||
|
* **Client spoof:** Remove exception from option ([9c69f87](https://github.com/ReVanced/revanced-patches/commit/9c69f876902496c101eac295e581c15e02bfaf29))
|
||||||
|
* **Enable android debugging:** Update patch description ([#2869](https://github.com/ReVanced/revanced-patches/issues/2869)) ([d9f0d08](https://github.com/ReVanced/revanced-patches/commit/d9f0d08498662e7aa18edb5201a5d60f3738e4e4))
|
||||||
|
* improve wording ([26f9b05](https://github.com/ReVanced/revanced-patches/commit/26f9b0514fda9434b2a36d2f9e5ad6a4f5bb94bd))
|
||||||
|
* **Reddit is Fun - Spoof client:** Use a more convincing user agent ([236a18f](https://github.com/ReVanced/revanced-patches/commit/236a18f9356cede156417c0d55a876d25a98cd4d))
|
||||||
|
* remove newline ([545388b](https://github.com/ReVanced/revanced-patches/commit/545388b3b21cabb485c4d2025756c48984548d6b))
|
||||||
|
* **Tiktok - Show seekbar:** Bump compatibility ([#2737](https://github.com/ReVanced/revanced-patches/issues/2737)) ([08413bd](https://github.com/ReVanced/revanced-patches/commit/08413bdc97aef892f7372c585d1d792eb95e30f4))
|
||||||
|
* **YouTube - Client spoof:** Adjust spoof signature settings description ([#2760](https://github.com/ReVanced/revanced-patches/issues/2760)) ([f71d893](https://github.com/ReVanced/revanced-patches/commit/f71d8937663fdbfc93d8e3ce1cdb47e1667554f0))
|
||||||
|
* **YouTube Music - Remove upgrade button:** Remove the correct navigation bar item ([fd3813f](https://github.com/ReVanced/revanced-patches/commit/fd3813f66ededdae1e52bf021a3de9d818f65096))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Add `Override certificate pinning` patch ([#2781](https://github.com/ReVanced/revanced-patches/issues/2781)) ([94ed738](https://github.com/ReVanced/revanced-patches/commit/94ed738515aa6e1a1d346b85b54805e68e36f94c))
|
||||||
|
* **Change package name:** Append `.revanced` to package name by default ([#2750](https://github.com/ReVanced/revanced-patches/issues/2750)) ([e83e62f](https://github.com/ReVanced/revanced-patches/commit/e83e62fc2400caf1c5179d25e0ac4fbd51ddba00))
|
||||||
|
* **Duolingo:** Add `Unlock Duolingo Super` patch ([#2862](https://github.com/ReVanced/revanced-patches/issues/2862)) ([61a7533](https://github.com/ReVanced/revanced-patches/commit/61a7533136f38d7a308e31c9f250baad00515d6a))
|
||||||
|
* Exclude `Custom branding` patch by default ([d6de957](https://github.com/ReVanced/revanced-patches/commit/d6de957f4efce11d9a709d4c8f500b039166fc2f))
|
||||||
|
* **Lightroom:** Add `Disable mandatory login` patch ([#2738](https://github.com/ReVanced/revanced-patches/issues/2738)) ([896a713](https://github.com/ReVanced/revanced-patches/commit/896a71308f1084d7f941c5b59610e40ea5d53009))
|
||||||
|
* **Lightroom:** Add `Unlock premium` patch ([#2740](https://github.com/ReVanced/revanced-patches/issues/2740)) ([e18a9bc](https://github.com/ReVanced/revanced-patches/commit/e18a9bcb50705d374ccbf03cd6ab9a140a2f23ec))
|
||||||
|
* **Nova Launcher:** Remove `Unlock prime` patch ([bbde91c](https://github.com/ReVanced/revanced-patches/commit/bbde91cf9df4b410a34147bbe5f359e39a71ad4c))
|
||||||
|
* Publicize resource utility functions ([20aff26](https://github.com/ReVanced/revanced-patches/commit/20aff26784296517257ea19d66ffd3bdfe6b06fa))
|
||||||
|
* **Solid Explorer:** Add `Remove file size limit` patch ([01c617d](https://github.com/ReVanced/revanced-patches/commit/01c617d94e58b30bbffb3426fcfa55b8979962bd))
|
||||||
|
* **Strava:** Add `Subscription features` patch ([#2872](https://github.com/ReVanced/revanced-patches/issues/2872)) ([387eb29](https://github.com/ReVanced/revanced-patches/commit/387eb29e7ed45169c89a03513af64104d0082f28))
|
||||||
|
* **Tasker:** Remove `Unlock trial` patch ([8354a87](https://github.com/ReVanced/revanced-patches/commit/8354a879cfc6028820e2bb0e01d6f607e145c0f6))
|
||||||
|
* Use an extension property to create new exception when failing to resolve a fingerprint ([47eac14](https://github.com/ReVanced/revanced-patches/commit/47eac14f039dc466c1957470d82255bfa2c06ff0))
|
||||||
|
* **YouTube - Debug:** Logging of layout proto buffer strings ([#2759](https://github.com/ReVanced/revanced-patches/issues/2759)) ([189f719](https://github.com/ReVanced/revanced-patches/commit/189f719720551f36c6e006c45558fe5ae46ca4f8))
|
||||||
|
* **YouTube - External downloads:** Recommend Seal instead of PowerTube ([#2803](https://github.com/ReVanced/revanced-patches/issues/2803)) ([082e067](https://github.com/ReVanced/revanced-patches/commit/082e067338026d05046ed5f398a1261aa20d3cb3))
|
||||||
|
* **YouTube - Hide video action buttons:** Hide individual action buttons ([#2723](https://github.com/ReVanced/revanced-patches/issues/2723)) ([220f694](https://github.com/ReVanced/revanced-patches/commit/220f694b12e7ed013753c8215d181936ab2205c3))
|
||||||
|
* **YouTube Music - Exclusive audio playback:** Support latest version ([0861991](https://github.com/ReVanced/revanced-patches/commit/0861991cfbdfa977713f1f1f4ee8a0a5fd3f939e))
|
||||||
|
* **YouTube Music:** Add `Permanent repeat` patch ([#2722](https://github.com/ReVanced/revanced-patches/issues/2722)) ([506d49c](https://github.com/ReVanced/revanced-patches/commit/506d49c82a68faee25aede8194e7884191c0f271))
|
||||||
|
* **YouTube Music:** Add `Permanent Shuffle` patch ([#2730](https://github.com/ReVanced/revanced-patches/issues/2730)) ([86a271c](https://github.com/ReVanced/revanced-patches/commit/86a271cd7cc3d1d2a11ff9ebe962574368b93f4f))
|
||||||
|
* **YouTube:** Add `Alternative thumbnails` patch ([#2834](https://github.com/ReVanced/revanced-patches/issues/2834)) ([8a4277c](https://github.com/ReVanced/revanced-patches/commit/8a4277c486d995f57cde3a56274979c4a7b42bf6))
|
||||||
|
* **YouTube:** Add `Custom player overlay opacity` patch ([#2721](https://github.com/ReVanced/revanced-patches/issues/2721)) ([2622b00](https://github.com/ReVanced/revanced-patches/commit/2622b008ab78b15aa3c28a13b38e63041f29c9ea))
|
||||||
|
* **YouTube:** Add `Enable tablet layout` patch ([c89b2aa](https://github.com/ReVanced/revanced-patches/commit/c89b2aa26125d302079b5cf522f3b6c9fbe1257a))
|
||||||
|
* **YouTube:** Support version `18.29.38` ([c1b9eef](https://github.com/ReVanced/revanced-patches/commit/c1b9eefa280b980d08a571e1ce205dc71ccde3b6))
|
||||||
|
* **YouTube:** Support version `18.32.39` ([7b503e2](https://github.com/ReVanced/revanced-patches/commit/7b503e2336dd4d330b651bf7c168d95a38e8c777))
|
||||||
|
|
||||||
|
# [2.188.0-dev.28](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.27...v2.188.0-dev.28) (2023-08-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube:** Add `Enable tablet layout` patch ([3ac68b3](https://github.com/ReVanced/revanced-patches/commit/3ac68b3c6ef0d568780855003217fc3e904d789b))
|
||||||
|
|
||||||
|
# [2.188.0-dev.27](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.26...v2.188.0-dev.27) (2023-08-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube Music - Exclusive audio playback:** Support latest version ([bfa379a](https://github.com/ReVanced/revanced-patches/commit/bfa379a398bce8d635043eb2d4f81c4ed7440101))
|
||||||
|
|
||||||
|
# [2.188.0-dev.26](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.25...v2.188.0-dev.26) (2023-08-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube:** Support version `18.32.39` ([7b503e2](https://github.com/ReVanced/revanced-patches/commit/7b503e2336dd4d330b651bf7c168d95a38e8c777))
|
||||||
|
|
||||||
|
# [2.188.0-dev.25](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.24...v2.188.0-dev.25) (2023-08-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube:** Add `Custom player overlay opacity` patch ([#2721](https://github.com/ReVanced/revanced-patches/issues/2721)) ([2622b00](https://github.com/ReVanced/revanced-patches/commit/2622b008ab78b15aa3c28a13b38e63041f29c9ea))
|
||||||
|
|
||||||
|
# [2.188.0-dev.24](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.23...v2.188.0-dev.24) (2023-08-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Exclude `Custom branding` patch by default ([d6de957](https://github.com/ReVanced/revanced-patches/commit/d6de957f4efce11d9a709d4c8f500b039166fc2f))
|
||||||
|
|
||||||
|
# [2.188.0-dev.23](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.22...v2.188.0-dev.23) (2023-08-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **Strava:** Add `Subscription features` patch ([#2872](https://github.com/ReVanced/revanced-patches/issues/2872)) ([387eb29](https://github.com/ReVanced/revanced-patches/commit/387eb29e7ed45169c89a03513af64104d0082f28))
|
||||||
|
|
||||||
|
# [2.188.0-dev.22](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.21...v2.188.0-dev.22) (2023-08-24)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Publicize resource utility functions ([20aff26](https://github.com/ReVanced/revanced-patches/commit/20aff26784296517257ea19d66ffd3bdfe6b06fa))
|
||||||
|
* Use an extension property to create new exception when failing to resolve a fingerprint ([47eac14](https://github.com/ReVanced/revanced-patches/commit/47eac14f039dc466c1957470d82255bfa2c06ff0))
|
||||||
|
|
||||||
|
# [2.188.0-dev.21](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.20...v2.188.0-dev.21) (2023-08-24)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **Duolingo:** Add `Unlock Duolingo Super` patch ([#2862](https://github.com/ReVanced/revanced-patches/issues/2862)) ([61a7533](https://github.com/ReVanced/revanced-patches/commit/61a7533136f38d7a308e31c9f250baad00515d6a))
|
||||||
|
|
||||||
|
# [2.188.0-dev.20](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.19...v2.188.0-dev.20) (2023-08-24)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Enable android debugging:** Update patch description ([#2869](https://github.com/ReVanced/revanced-patches/issues/2869)) ([d9f0d08](https://github.com/ReVanced/revanced-patches/commit/d9f0d08498662e7aa18edb5201a5d60f3738e4e4))
|
||||||
|
|
||||||
|
# [2.188.0-dev.19](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.18...v2.188.0-dev.19) (2023-08-24)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **Solid Explorer:** Add `Remove file size limit` patch ([01c617d](https://github.com/ReVanced/revanced-patches/commit/01c617d94e58b30bbffb3426fcfa55b8979962bd))
|
||||||
|
|
||||||
|
# [2.188.0-dev.18](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.17...v2.188.0-dev.18) (2023-08-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube:** Support version `18.29.38` ([c1b9eef](https://github.com/ReVanced/revanced-patches/commit/c1b9eefa280b980d08a571e1ce205dc71ccde3b6))
|
||||||
|
|
||||||
|
# [2.188.0-dev.17](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.16...v2.188.0-dev.17) (2023-08-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube:** Add `Alternative thumbnails` patch ([#2834](https://github.com/ReVanced/revanced-patches/issues/2834)) ([8a4277c](https://github.com/ReVanced/revanced-patches/commit/8a4277c486d995f57cde3a56274979c4a7b42bf6))
|
||||||
|
|
||||||
# [2.188.0-dev.16](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.15...v2.188.0-dev.16) (2023-08-19)
|
# [2.188.0-dev.16](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.15...v2.188.0-dev.16) (2023-08-19)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("app.revanced:revanced-patcher:13.0.0")
|
implementation("app.revanced:revanced-patcher:14.2.1")
|
||||||
implementation("com.android.tools.smali:smali:3.0.3")
|
implementation("com.android.tools.smali:smali:3.0.3")
|
||||||
// Required because build fails without it.
|
// Required because build fails without it.
|
||||||
// TODO: Find a way to remove this dependency.
|
// TODO: Find a way to remove this dependency.
|
||||||
|
|||||||
@@ -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.188.0-dev.16
|
version = 2.190.0-dev.2
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,9 +1,10 @@
|
|||||||
package app.revanced.extensions
|
package app.revanced.extensions
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
|
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
import app.revanced.patcher.patch.PatchException
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||||
@@ -13,13 +14,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.WideLiteralInstruction
|
|||||||
import com.android.tools.smali.dexlib2.util.MethodUtil
|
import com.android.tools.smali.dexlib2.util.MethodUtil
|
||||||
import org.w3c.dom.Node
|
import org.w3c.dom.Node
|
||||||
|
|
||||||
// TODO: populate this to all patches
|
|
||||||
/**
|
/**
|
||||||
* Convert a [MethodFingerprint] to a [PatchResultError].
|
* The [PatchException] of failing to resolve a [MethodFingerprint].
|
||||||
*
|
*
|
||||||
* @return A [PatchResultError] for the [MethodFingerprint].
|
* @return The [PatchException].
|
||||||
*/
|
*/
|
||||||
internal fun MethodFingerprint.toErrorResult() = PatchResultError("Failed to resolve $name")
|
val MethodFingerprint.exception
|
||||||
|
get() = PatchException("Failed to resolve $name")
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find the [MutableMethod] from a given [Method] in a [MutableClass].
|
* Find the [MutableMethod] from a given [Method] in a [MutableClass].
|
||||||
@@ -27,27 +28,27 @@ internal fun MethodFingerprint.toErrorResult() = PatchResultError("Failed to res
|
|||||||
* @param method The [Method] to find.
|
* @param method The [Method] to find.
|
||||||
* @return The [MutableMethod].
|
* @return The [MutableMethod].
|
||||||
*/
|
*/
|
||||||
internal fun MutableClass.findMutableMethodOf(method: Method) = this.methods.first {
|
fun MutableClass.findMutableMethodOf(method: Method) = this.methods.first {
|
||||||
MethodUtil.methodSignaturesMatch(it, method)
|
MethodUtil.methodSignaturesMatch(it, method)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* apply a transform to all methods of the class
|
* apply a transform to all methods of the class.
|
||||||
*
|
*
|
||||||
* @param transform the transformation function. original method goes in, transformed method goes out
|
* @param transform the transformation function. original method goes in, transformed method goes out.
|
||||||
*/
|
*/
|
||||||
internal fun MutableClass.transformMethods(transform: MutableMethod.() -> MutableMethod) {
|
fun MutableClass.transformMethods(transform: MutableMethod.() -> MutableMethod) {
|
||||||
val transformedMethods = methods.map { it.transform() }
|
val transformedMethods = methods.map { it.transform() }
|
||||||
methods.clear()
|
methods.clear()
|
||||||
methods.addAll(transformedMethods)
|
methods.addAll(transformedMethods)
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun Node.doRecursively(action: (Node) -> Unit) {
|
fun Node.doRecursively(action: (Node) -> Unit) {
|
||||||
action(this)
|
action(this)
|
||||||
for (i in 0 until this.childNodes.length) this.childNodes.item(i).doRecursively(action)
|
for (i in 0 until this.childNodes.length) this.childNodes.item(i).doRecursively(action)
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun MutableMethod.injectHideViewCall(
|
fun MutableMethod.injectHideViewCall(
|
||||||
insertIndex: Int,
|
insertIndex: Int,
|
||||||
viewRegister: Int,
|
viewRegister: Int,
|
||||||
classDescriptor: String,
|
classDescriptor: String,
|
||||||
@@ -57,7 +58,13 @@ internal fun MutableMethod.injectHideViewCall(
|
|||||||
"invoke-static { v$viewRegister }, $classDescriptor->$targetMethod(Landroid/view/View;)V"
|
"invoke-static { v$viewRegister }, $classDescriptor->$targetMethod(Landroid/view/View;)V"
|
||||||
)
|
)
|
||||||
|
|
||||||
internal fun Method.findIndexForIdResource(resourceName: String): Int {
|
/**
|
||||||
|
* Find the index of the first constant instruction with the id of the given resource name.
|
||||||
|
*
|
||||||
|
* @param resourceName the name of the resource to find the id for.
|
||||||
|
* @return the index of the first constant instruction with the id of the given resource name, or -1 if not found.
|
||||||
|
*/
|
||||||
|
fun Method.findIndexForIdResource(resourceName: String): Int {
|
||||||
fun getIdResourceId(resourceName: String) = ResourceMappingPatch.resourceMappings.single {
|
fun getIdResourceId(resourceName: String) = ResourceMappingPatch.resourceMappings.single {
|
||||||
it.type == "id" && it.name == resourceName
|
it.type == "id" && it.name == resourceName
|
||||||
}.id
|
}.id
|
||||||
@@ -66,6 +73,8 @@ internal fun Method.findIndexForIdResource(resourceName: String): Int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Find the index of the first constant instruction with the given value.
|
||||||
|
*
|
||||||
* @return the first constant instruction with the value, or -1 if not found.
|
* @return the first constant instruction with the value, or -1 if not found.
|
||||||
*/
|
*/
|
||||||
fun Method.indexOfFirstConstantInstructionValue(constantValue: Long): Int {
|
fun Method.indexOfFirstConstantInstructionValue(constantValue: Long): Int {
|
||||||
@@ -77,8 +86,23 @@ fun Method.indexOfFirstConstantInstructionValue(constantValue: Long): Int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Check if the method contains a constant with the given value.
|
||||||
|
*
|
||||||
* @return if the method contains a constant with the given value.
|
* @return if the method contains a constant with the given value.
|
||||||
*/
|
*/
|
||||||
fun Method.containsConstantInstructionValue(constantValue: Long): Boolean {
|
fun Method.containsConstantInstructionValue(constantValue: Long): Boolean {
|
||||||
return indexOfFirstConstantInstructionValue(constantValue) >= 0
|
return indexOfFirstConstantInstructionValue(constantValue) >= 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Traverse the class hierarchy starting from the given root class.
|
||||||
|
*
|
||||||
|
* @param targetClass the class to start traversing the class hierarchy from.
|
||||||
|
* @param callback function that is called for every class in the hierarchy.
|
||||||
|
*/
|
||||||
|
fun BytecodeContext.traverseClassHierarchy(targetClass: MutableClass, callback: MutableClass.() -> Unit) {
|
||||||
|
callback(targetClass)
|
||||||
|
this.findClass(targetClass.superclass ?: return)?.mutableClass?.let {
|
||||||
|
traverseClassHierarchy(it, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,7 +6,6 @@ import app.revanced.patcher.extensions.PatchExtensions.description
|
|||||||
import app.revanced.patcher.extensions.PatchExtensions.include
|
import app.revanced.patcher.extensions.PatchExtensions.include
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.options
|
import app.revanced.patcher.extensions.PatchExtensions.options
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.version
|
|
||||||
import app.revanced.patcher.patch.PatchOption
|
import app.revanced.patcher.patch.PatchOption
|
||||||
import com.google.gson.GsonBuilder
|
import com.google.gson.GsonBuilder
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@@ -17,7 +16,6 @@ internal class JsonGenerator : PatchesFileGenerator {
|
|||||||
JsonPatch(
|
JsonPatch(
|
||||||
it.patchName,
|
it.patchName,
|
||||||
it.description ?: "This patch has no description.",
|
it.description ?: "This patch has no description.",
|
||||||
it.version ?: "0.0.0",
|
|
||||||
!it.include,
|
!it.include,
|
||||||
it.options?.map { option ->
|
it.options?.map { option ->
|
||||||
JsonPatch.Option(
|
JsonPatch.Option(
|
||||||
@@ -48,7 +46,6 @@ internal class JsonGenerator : PatchesFileGenerator {
|
|||||||
private class JsonPatch(
|
private class JsonPatch(
|
||||||
val name: String,
|
val name: String,
|
||||||
val description: String,
|
val description: String,
|
||||||
val version: String,
|
|
||||||
val excluded: Boolean,
|
val excluded: Boolean,
|
||||||
val options: Array<Option>,
|
val options: Array<Option>,
|
||||||
val dependencies: Array<String>,
|
val dependencies: Array<String>,
|
||||||
|
|||||||
@@ -1,25 +1,22 @@
|
|||||||
package app.revanced.meta
|
package app.revanced.meta
|
||||||
|
|
||||||
import app.revanced.patcher.data.Context
|
import app.revanced.patcher.PatchBundleLoader
|
||||||
import app.revanced.patcher.patch.Patch
|
import app.revanced.patcher.patch.PatchClass
|
||||||
import app.revanced.patcher.util.patch.PatchBundle
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
internal typealias PatchBundlePatches = List<Class<out Patch<Context>>>
|
internal typealias PatchBundlePatches = List<PatchClass>
|
||||||
|
|
||||||
internal interface PatchesFileGenerator {
|
internal interface PatchesFileGenerator {
|
||||||
fun generate(bundle: PatchBundlePatches)
|
fun generate(bundle: PatchBundlePatches)
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun main(args: Array<String>) = PatchBundle.Jar(
|
fun main(args: Array<String>) = PatchBundleLoader.Jar(
|
||||||
File("build/libs/").listFiles()!!.first {
|
File("build/libs/").listFiles { it -> it.name.endsWith(".jar") }!!.first()
|
||||||
it.name.startsWith("revanced-patches-") && it.name.endsWith(".jar")
|
).also { loader ->
|
||||||
}.absolutePath
|
if (loader.isEmpty()) throw IllegalStateException("No patches found")
|
||||||
).loadPatches().also {
|
|
||||||
if (it.isEmpty()) throw IllegalStateException("No patches found")
|
|
||||||
}.let { bundle ->
|
}.let { bundle ->
|
||||||
arrayOf(JsonGenerator()).forEach { it.generate(bundle) }
|
arrayOf(JsonGenerator()).forEach { generator -> generator.generate(bundle) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
package app.revanced.patches.all.activity.exportAll.patch
|
package app.revanced.patches.all.activity.exportall.patch
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.ResourceContext
|
import app.revanced.patcher.data.ResourceContext
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.ResourcePatch
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
|
||||||
@@ -12,7 +10,7 @@ import app.revanced.patcher.patch.annotations.Patch
|
|||||||
@Name("Export all activities")
|
@Name("Export all activities")
|
||||||
@Description("Makes all app activities exportable.")
|
@Description("Makes all app activities exportable.")
|
||||||
class ExportAllActivitiesPatch : ResourcePatch {
|
class ExportAllActivitiesPatch : ResourcePatch {
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext) {
|
||||||
context.xmlEditor["AndroidManifest.xml"].use { editor ->
|
context.xmlEditor["AndroidManifest.xml"].use { editor ->
|
||||||
val document = editor.file
|
val document = editor.file
|
||||||
val activities = document.getElementsByTagName("activity")
|
val activities = document.getElementsByTagName("activity")
|
||||||
@@ -33,8 +31,6 @@ class ExportAllActivitiesPatch : ResourcePatch {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
@@ -15,7 +15,7 @@ import java.util.*
|
|||||||
@Name("Spoof wifi connection")
|
@Name("Spoof wifi connection")
|
||||||
@Description("Spoofs an existing Wi-Fi connection.")
|
@Description("Spoofs an existing Wi-Fi connection.")
|
||||||
@RequiresIntegrations
|
@RequiresIntegrations
|
||||||
internal class SpoofWifiPatch : AbstractTransformInstructionsPatch<Instruction35cInfo>() {
|
class SpoofWifiPatch : AbstractTransformInstructionsPatch<Instruction35cInfo>() {
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
const val INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX = "Lapp/revanced/all/connectivity/wifi/spoof/SpoofWifiPatch"
|
const val INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX = "Lapp/revanced/all/connectivity/wifi/spoof/SpoofWifiPatch"
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ package app.revanced.patches.all.interaction.gestures.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.ResourceContext
|
import app.revanced.patcher.data.ResourceContext
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.ResourcePatch
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
|
||||||
@@ -12,7 +10,7 @@ import app.revanced.patcher.patch.annotations.Patch
|
|||||||
@Name("Predictive back gesture")
|
@Name("Predictive back gesture")
|
||||||
@Description("Enables the predictive back gesture introduced on Android 13.")
|
@Description("Enables the predictive back gesture introduced on Android 13.")
|
||||||
class PredictiveBackGesturePatch : ResourcePatch {
|
class PredictiveBackGesturePatch : ResourcePatch {
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext) {
|
||||||
context.xmlEditor["AndroidManifest.xml"].use { editor ->
|
context.xmlEditor["AndroidManifest.xml"].use { editor ->
|
||||||
val document = editor.file
|
val document = editor.file
|
||||||
|
|
||||||
@@ -25,8 +23,6 @@ class PredictiveBackGesturePatch : ResourcePatch {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import org.w3c.dom.Element
|
|||||||
|
|
||||||
@Patch(false)
|
@Patch(false)
|
||||||
@Name("Enable android debugging")
|
@Name("Enable android debugging")
|
||||||
@Description("Enables Android debugging capabilities.")
|
@Description("Enables Android debugging capabilities. This can slow down the app.")
|
||||||
class EnableAndroidDebuggingPatch : ResourcePatch {
|
class EnableAndroidDebuggingPatch : ResourcePatch {
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext) {
|
||||||
context.xmlEditor["AndroidManifest.xml"].use { dom ->
|
context.xmlEditor["AndroidManifest.xml"].use { dom ->
|
||||||
val applicationNode = dom
|
val applicationNode = dom
|
||||||
.file
|
.file
|
||||||
@@ -21,8 +21,6 @@ class EnableAndroidDebuggingPatch : ResourcePatch {
|
|||||||
// set application as debuggable
|
// set application as debuggable
|
||||||
applicationNode.setAttribute("android:debuggable", "true")
|
applicationNode.setAttribute("android:debuggable", "true")
|
||||||
}
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,8 @@ package app.revanced.patches.all.misc.network.patch
|
|||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.ResourceContext
|
import app.revanced.patcher.data.ResourceContext
|
||||||
import app.revanced.patcher.patch.*
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.all.misc.debugging.patch.EnableAndroidDebuggingPatch
|
import app.revanced.patches.all.misc.debugging.patch.EnableAndroidDebuggingPatch
|
||||||
@@ -16,8 +15,7 @@ import java.io.File
|
|||||||
@Description("Overrides certificate pinning, allowing to inspect traffic via a proxy.")
|
@Description("Overrides certificate pinning, allowing to inspect traffic via a proxy.")
|
||||||
@DependsOn([EnableAndroidDebuggingPatch::class])
|
@DependsOn([EnableAndroidDebuggingPatch::class])
|
||||||
class OverrideCertificatePinningPatch : ResourcePatch {
|
class OverrideCertificatePinningPatch : ResourcePatch {
|
||||||
|
override fun execute(context: ResourceContext) {
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
|
||||||
val resXmlDirectory = context["res/xml"]
|
val resXmlDirectory = context["res/xml"]
|
||||||
|
|
||||||
// Add android:networkSecurityConfig="@xml/network_security_config" and the "networkSecurityConfig" attribute if it does not exist.
|
// Add android:networkSecurityConfig="@xml/network_security_config" and the "networkSecurityConfig" attribute if it does not exist.
|
||||||
@@ -73,7 +71,5 @@ class OverrideCertificatePinningPatch : ResourcePatch {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,20 +11,18 @@ import org.w3c.dom.Element
|
|||||||
@Name("Change package name")
|
@Name("Change package name")
|
||||||
@Description("Changes the package name. Appends \".revanced\" to the package name by default.")
|
@Description("Changes the package name. Appends \".revanced\" to the package name by default.")
|
||||||
class ChangePackageNamePatch : ResourcePatch {
|
class ChangePackageNamePatch : ResourcePatch {
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext) {
|
||||||
val packageNameToUse = packageName ?: getDefaultPackageName(context)
|
val packageNameToUse = packageName ?: getDefaultPackageName(context)
|
||||||
|
|
||||||
val packageNameRegex = Regex("^[a-z]\\w*(\\.[a-z]\\w*)+\$")
|
val packageNameRegex = Regex("^[a-z]\\w*(\\.[a-z]\\w*)+\$")
|
||||||
if (!packageNameToUse.matches(packageNameRegex))
|
if (!packageNameToUse.matches(packageNameRegex))
|
||||||
return PatchResultError("Invalid package name")
|
throw PatchException("Invalid package name")
|
||||||
|
|
||||||
val originalPackageName = getOriginalPackageName(context)
|
val originalPackageName = getOriginalPackageName(context)
|
||||||
|
|
||||||
context["AndroidManifest.xml"].apply {
|
context["AndroidManifest.xml"].apply {
|
||||||
readText().replace(originalPackageName, packageNameToUse).let(::writeText)
|
readText().replace(originalPackageName, packageNameToUse).let(::writeText)
|
||||||
}
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getDefaultPackageName(context: ResourceContext): String {
|
private fun getDefaultPackageName(context: ResourceContext): String {
|
||||||
|
|||||||
@@ -7,7 +7,10 @@ import app.revanced.patcher.patch.annotations.Patch
|
|||||||
import app.revanced.patcher.patch.annotations.RequiresIntegrations
|
import app.revanced.patcher.patch.annotations.RequiresIntegrations
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
import app.revanced.patches.all.screencapture.removerestriction.resource.patch.RemoveCaptureRestrictionResourcePatch
|
import app.revanced.patches.all.screencapture.removerestriction.resource.patch.RemoveCaptureRestrictionResourcePatch
|
||||||
import app.revanced.util.patch.*
|
import app.revanced.util.patch.AbstractTransformInstructionsPatch
|
||||||
|
import app.revanced.util.patch.IMethodCall
|
||||||
|
import app.revanced.util.patch.Instruction35cInfo
|
||||||
|
import app.revanced.util.patch.filterMapInstruction35c
|
||||||
import com.android.tools.smali.dexlib2.iface.ClassDef
|
import com.android.tools.smali.dexlib2.iface.ClassDef
|
||||||
import com.android.tools.smali.dexlib2.iface.Method
|
import com.android.tools.smali.dexlib2.iface.Method
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.Instruction
|
import com.android.tools.smali.dexlib2.iface.instruction.Instruction
|
||||||
@@ -17,7 +20,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.Instruction
|
|||||||
@Description("Removes the restriction of capturing audio from apps that normally wouldn't allow it.")
|
@Description("Removes the restriction of capturing audio from apps that normally wouldn't allow it.")
|
||||||
@DependsOn([RemoveCaptureRestrictionResourcePatch::class])
|
@DependsOn([RemoveCaptureRestrictionResourcePatch::class])
|
||||||
@RequiresIntegrations
|
@RequiresIntegrations
|
||||||
internal class RemoveCaptureRestrictionPatch : AbstractTransformInstructionsPatch<Instruction35cInfo>() {
|
class RemoveCaptureRestrictionPatch : AbstractTransformInstructionsPatch<Instruction35cInfo>() {
|
||||||
// Information about method calls we want to replace
|
// Information about method calls we want to replace
|
||||||
enum class MethodCall(
|
enum class MethodCall(
|
||||||
override val definedClassName: String,
|
override val definedClassName: String,
|
||||||
|
|||||||
@@ -2,14 +2,12 @@ package app.revanced.patches.all.screencapture.removerestriction.resource.patch
|
|||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.data.ResourceContext
|
import app.revanced.patcher.data.ResourceContext
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.ResourcePatch
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
import org.w3c.dom.Element
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
@Description("Sets allowAudioPlaybackCapture in manifest to true.")
|
@Description("Sets allowAudioPlaybackCapture in manifest to true.")
|
||||||
internal class RemoveCaptureRestrictionResourcePatch : ResourcePatch {
|
internal class RemoveCaptureRestrictionResourcePatch : ResourcePatch {
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext) {
|
||||||
// create an xml editor instance
|
// create an xml editor instance
|
||||||
context.xmlEditor["AndroidManifest.xml"].use { dom ->
|
context.xmlEditor["AndroidManifest.xml"].use { dom ->
|
||||||
// get the application node
|
// get the application node
|
||||||
@@ -21,7 +19,5 @@ internal class RemoveCaptureRestrictionResourcePatch : ResourcePatch {
|
|||||||
// set allowAudioPlaybackCapture attribute to true
|
// set allowAudioPlaybackCapture attribute to true
|
||||||
applicationNode.setAttribute("android:allowAudioPlaybackCapture", "true")
|
applicationNode.setAttribute("android:allowAudioPlaybackCapture", "true")
|
||||||
}
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,17 +5,19 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.annotations.RequiresIntegrations
|
import app.revanced.patcher.patch.annotations.RequiresIntegrations
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
import app.revanced.util.patch.*
|
import app.revanced.util.patch.AbstractTransformInstructionsPatch
|
||||||
|
import app.revanced.util.patch.IMethodCall
|
||||||
|
import app.revanced.util.patch.Instruction35cInfo
|
||||||
|
import app.revanced.util.patch.filterMapInstruction35c
|
||||||
import com.android.tools.smali.dexlib2.iface.ClassDef
|
import com.android.tools.smali.dexlib2.iface.ClassDef
|
||||||
import com.android.tools.smali.dexlib2.iface.Method
|
import com.android.tools.smali.dexlib2.iface.Method
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.Instruction
|
import com.android.tools.smali.dexlib2.iface.instruction.Instruction
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
@Patch(false)
|
@Patch(false)
|
||||||
@Name("Remove screenshot restriction")
|
@Name("Remove screenshot restriction")
|
||||||
@Description("Removes the restriction of taking screenshots in apps that normally wouldn't allow it.")
|
@Description("Removes the restriction of taking screenshots in apps that normally wouldn't allow it.")
|
||||||
@RequiresIntegrations
|
@RequiresIntegrations
|
||||||
internal class RemoveScreenshotRestrictionPatch : AbstractTransformInstructionsPatch<Instruction35cInfo>() {
|
class RemoveScreenshotRestrictionPatch : AbstractTransformInstructionsPatch<Instruction35cInfo>() {
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
const val INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX =
|
const val INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX =
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package app.revanced.patches.backdrops.misc.pro.patch
|
package app.revanced.patches.backdrops.misc.pro.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.backdrops.misc.pro.annotations.ProUnlockCompatibility
|
import app.revanced.patches.backdrops.misc.pro.annotations.ProUnlockCompatibility
|
||||||
import app.revanced.patches.backdrops.misc.pro.fingerprints.ProUnlockFingerprint
|
import app.revanced.patches.backdrops.misc.pro.fingerprints.ProUnlockFingerprint
|
||||||
@@ -21,7 +19,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
class ProUnlockPatch : BytecodePatch(
|
class ProUnlockPatch : BytecodePatch(
|
||||||
listOf(ProUnlockFingerprint)
|
listOf(ProUnlockFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
ProUnlockFingerprint.result?.let { result ->
|
ProUnlockFingerprint.result?.let { result ->
|
||||||
val registerIndex = result.scanResult.patternScanResult!!.endIndex - 1
|
val registerIndex = result.scanResult.patternScanResult!!.endIndex - 1
|
||||||
|
|
||||||
@@ -35,8 +33,6 @@ class ProUnlockPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
} ?: return ProUnlockFingerprint.toErrorResult()
|
} ?: throw ProUnlockFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,11 @@
|
|||||||
package app.revanced.patches.candylinkvpn.patch
|
package app.revanced.patches.candylinkvpn.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.candylinkvpn.annotations.UnlockProCompatibility
|
import app.revanced.patches.candylinkvpn.annotations.UnlockProCompatibility
|
||||||
import app.revanced.patches.candylinkvpn.fingerprints.IsPremiumPurchasedFingerprint
|
import app.revanced.patches.candylinkvpn.fingerprints.IsPremiumPurchasedFingerprint
|
||||||
@@ -19,15 +17,13 @@ import app.revanced.patches.candylinkvpn.fingerprints.IsPremiumPurchasedFingerpr
|
|||||||
class UnlockProPatch : BytecodePatch(
|
class UnlockProPatch : BytecodePatch(
|
||||||
listOf(IsPremiumPurchasedFingerprint)
|
listOf(IsPremiumPurchasedFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
IsPremiumPurchasedFingerprint.result?.mutableMethod?.addInstructions(
|
IsPremiumPurchasedFingerprint.result?.mutableMethod?.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
const/4 v0, 0x1
|
const/4 v0, 0x1
|
||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
) ?: return IsPremiumPurchasedFingerprint.toErrorResult()
|
) ?: throw IsPremiumPurchasedFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package app.revanced.patches.duolingo.unlocksuper.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
object IsUserSuperMethodFingerprint : MethodFingerprint(
|
||||||
|
returnType = "Ljava/lang/Object",
|
||||||
|
parameters = listOf("Ljava/lang/Object"),
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
strings = listOf("user"),
|
||||||
|
opcodes = listOf(Opcode.IGET_BOOLEAN),
|
||||||
|
)
|
||||||
@@ -1,18 +1,20 @@
|
|||||||
package app.revanced.patches.youtube.misc.links.open.fingerprints
|
package app.revanced.patches.duolingo.unlocksuper.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import com.android.tools.smali.dexlib2.AccessFlags
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
object InitializeCustomTabSupportFingerprint : MethodFingerprint(
|
object UserSerializationMethodFingerprint : MethodFingerprint(
|
||||||
returnType = "V",
|
returnType = "V",
|
||||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||||
opcodes = listOf(
|
strings = listOf(
|
||||||
Opcode.CHECK_CAST,
|
"betaStatus",
|
||||||
Opcode.NEW_INSTANCE,
|
"coachOutfit",
|
||||||
Opcode.INVOKE_DIRECT,
|
"globalAmbassadorStatus",
|
||||||
Opcode.CONST_STRING
|
),
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.MOVE_FROM16,
|
||||||
|
Opcode.IPUT_BOOLEAN,
|
||||||
),
|
),
|
||||||
strings = listOf("android.support.customtabs.action.CustomTabsService")
|
|
||||||
)
|
)
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package app.revanced.patches.duolingo.unlocksuper.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.exception
|
||||||
|
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.getInstructions
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchException
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
|
import app.revanced.patches.duolingo.unlocksuper.fingerprints.IsUserSuperMethodFingerprint
|
||||||
|
import app.revanced.patches.duolingo.unlocksuper.fingerprints.UserSerializationMethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction22c
|
||||||
|
import com.android.tools.smali.dexlib2.iface.reference.Reference
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("Unlock Duolingo Super")
|
||||||
|
@Description("Unlocks Duolingo Super features.")
|
||||||
|
@Compatibility([Package("com.duolingo")])
|
||||||
|
class UnlockDuolingoSuperPatch : BytecodePatch(
|
||||||
|
listOf(UserSerializationMethodFingerprint, IsUserSuperMethodFingerprint)
|
||||||
|
) {
|
||||||
|
|
||||||
|
/* First find the reference to the isUserSuper field, then patch the instruction that assigns it to false.
|
||||||
|
* This strategy is used because the method that sets the isUserSuper field is difficult to fingerprint reliably.
|
||||||
|
*/
|
||||||
|
override fun execute(context: BytecodeContext) {
|
||||||
|
// Find the reference to the isUserSuper field.
|
||||||
|
val isUserSuperReference = IsUserSuperMethodFingerprint
|
||||||
|
.result
|
||||||
|
?.mutableMethod
|
||||||
|
?.getInstructions()
|
||||||
|
?.filterIsInstance<BuilderInstruction22c>()
|
||||||
|
?.firstOrNull { it.opcode == Opcode.IGET_BOOLEAN }
|
||||||
|
?.reference
|
||||||
|
?: throw IsUserSuperMethodFingerprint.exception
|
||||||
|
|
||||||
|
// Patch the instruction that assigns isUserSuper to true.
|
||||||
|
UserSerializationMethodFingerprint
|
||||||
|
.result
|
||||||
|
?.mutableMethod
|
||||||
|
?.apply {
|
||||||
|
replaceInstructions(
|
||||||
|
indexOfReference(isUserSuperReference) - 1,
|
||||||
|
"const/4 v2, 0x1"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
?: throw UserSerializationMethodFingerprint.exception
|
||||||
|
}
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
private fun MutableMethod.indexOfReference(reference: Reference) = getInstructions()
|
||||||
|
.filterIsInstance<BuilderInstruction22c>()
|
||||||
|
.filter { it.opcode == Opcode.IPUT_BOOLEAN }.indexOfFirst { it.reference == reference }.let {
|
||||||
|
if (it == -1) throw PatchException("Could not find index of instruction with supplied reference.")
|
||||||
|
else it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +1,11 @@
|
|||||||
package app.revanced.patches.finanzonline.detection.bootloader.patch
|
package app.revanced.patches.finanzonline.detection.bootloader.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.finanzonline.detection.bootloader.fingerprints.BootStateFingerprint
|
import app.revanced.patches.finanzonline.detection.bootloader.fingerprints.BootStateFingerprint
|
||||||
import app.revanced.patches.finanzonline.detection.bootloader.fingerprints.CreateKeyFingerprint
|
import app.revanced.patches.finanzonline.detection.bootloader.fingerprints.CreateKeyFingerprint
|
||||||
@@ -21,7 +19,7 @@ import app.revanced.patches.finanzonline.detection.shared.annotations.DetectionC
|
|||||||
class BootloaderDetectionPatch : BytecodePatch(
|
class BootloaderDetectionPatch : BytecodePatch(
|
||||||
listOf(CreateKeyFingerprint, BootStateFingerprint)
|
listOf(CreateKeyFingerprint, BootStateFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
arrayOf(CreateKeyFingerprint, BootStateFingerprint).forEach { fingerprint ->
|
arrayOf(CreateKeyFingerprint, BootStateFingerprint).forEach { fingerprint ->
|
||||||
fingerprint.result?.mutableMethod?.addInstructions(
|
fingerprint.result?.mutableMethod?.addInstructions(
|
||||||
0,
|
0,
|
||||||
@@ -29,9 +27,7 @@ class BootloaderDetectionPatch : BytecodePatch(
|
|||||||
const/4 v0, 0x1
|
const/4 v0, 0x1
|
||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
) ?: return fingerprint.toErrorResult()
|
) ?: throw fingerprint.exception
|
||||||
}
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package app.revanced.patches.finanzonline.detection.root.patch
|
package app.revanced.patches.finanzonline.detection.root.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.finanzonline.detection.root.fingerprints.RootDetectionFingerprint
|
import app.revanced.patches.finanzonline.detection.root.fingerprints.RootDetectionFingerprint
|
||||||
import app.revanced.patches.finanzonline.detection.shared.annotations.DetectionCompatibility
|
import app.revanced.patches.finanzonline.detection.shared.annotations.DetectionCompatibility
|
||||||
@@ -19,15 +17,13 @@ import app.revanced.patches.finanzonline.detection.shared.annotations.DetectionC
|
|||||||
class RootDetectionPatch : BytecodePatch(
|
class RootDetectionPatch : BytecodePatch(
|
||||||
listOf(RootDetectionFingerprint)
|
listOf(RootDetectionFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
RootDetectionFingerprint.result?.mutableMethod?.addInstructions(
|
RootDetectionFingerprint.result?.mutableMethod?.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
sget-object v0, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean;
|
sget-object v0, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean;
|
||||||
return-object v0
|
return-object v0
|
||||||
"""
|
"""
|
||||||
) ?: return RootDetectionFingerprint.toErrorResult()
|
) ?: throw RootDetectionFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package app.revanced.patches.googlerecorder.restrictions.patch
|
package app.revanced.patches.googlerecorder.restrictions.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
@@ -10,8 +10,6 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.googlerecorder.restrictions.fingerprints.OnApplicationCreateFingerprint
|
import app.revanced.patches.googlerecorder.restrictions.fingerprints.OnApplicationCreateFingerprint
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
@@ -23,7 +21,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
class RemoveDeviceRestrictions : BytecodePatch(
|
class RemoveDeviceRestrictions : BytecodePatch(
|
||||||
listOf(OnApplicationCreateFingerprint)
|
listOf(OnApplicationCreateFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
OnApplicationCreateFingerprint.result?.let {
|
OnApplicationCreateFingerprint.result?.let {
|
||||||
val featureStringIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
val featureStringIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
||||||
|
|
||||||
@@ -36,8 +34,6 @@ class RemoveDeviceRestrictions : BytecodePatch(
|
|||||||
// Override "isPixelDevice()" to return true.
|
// Override "isPixelDevice()" to return true.
|
||||||
addInstruction(featureStringIndex, "const/4 v$featureAvailableRegister, 0x1")
|
addInstruction(featureStringIndex, "const/4 v$featureAvailableRegister, 0x1")
|
||||||
}
|
}
|
||||||
} ?: return OnApplicationCreateFingerprint.toErrorResult()
|
} ?: throw OnApplicationCreateFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.hexeditor.ad.annotations.HexEditorAdsCompatibility
|
import app.revanced.patches.hexeditor.ad.annotations.HexEditorAdsCompatibility
|
||||||
import app.revanced.patches.hexeditor.ad.fingerprints.PrimaryAdsFingerprint
|
import app.revanced.patches.hexeditor.ad.fingerprints.PrimaryAdsFingerprint
|
||||||
@@ -20,7 +18,7 @@ class HexEditorAdsPatch : BytecodePatch(
|
|||||||
PrimaryAdsFingerprint
|
PrimaryAdsFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
val method = PrimaryAdsFingerprint.result!!.mutableMethod
|
val method = PrimaryAdsFingerprint.result!!.mutableMethod
|
||||||
|
|
||||||
method.replaceInstructions(
|
method.replaceInstructions(
|
||||||
@@ -30,7 +28,5 @@ class HexEditorAdsPatch : BytecodePatch(
|
|||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.iconpackstudio.misc.pro.annotations.UnlockProCompatibility
|
import app.revanced.patches.iconpackstudio.misc.pro.annotations.UnlockProCompatibility
|
||||||
import app.revanced.patches.iconpackstudio.misc.pro.fingerprints.CheckProFingerprint
|
import app.revanced.patches.iconpackstudio.misc.pro.fingerprints.CheckProFingerprint
|
||||||
@@ -20,7 +18,7 @@ class UnlockProPatch : BytecodePatch(
|
|||||||
CheckProFingerprint
|
CheckProFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
val method = CheckProFingerprint.result!!.mutableMethod
|
val method = CheckProFingerprint.result!!.mutableMethod
|
||||||
method.addInstructions(
|
method.addInstructions(
|
||||||
0,
|
0,
|
||||||
@@ -29,7 +27,5 @@ class UnlockProPatch : BytecodePatch(
|
|||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.idaustria.detection.root.fingerprints.RootDetectionFingerprint
|
import app.revanced.patches.idaustria.detection.root.fingerprints.RootDetectionFingerprint
|
||||||
import app.revanced.patches.idaustria.detection.shared.annotations.DetectionCompatibility
|
import app.revanced.patches.idaustria.detection.shared.annotations.DetectionCompatibility
|
||||||
@@ -18,8 +16,6 @@ import app.revanced.patches.idaustria.detection.shared.annotations.DetectionComp
|
|||||||
class RootDetectionPatch : BytecodePatch(
|
class RootDetectionPatch : BytecodePatch(
|
||||||
listOf(RootDetectionFingerprint)
|
listOf(RootDetectionFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) =
|
||||||
RootDetectionFingerprint.result!!.mutableMethod.addInstruction(0, "return-void")
|
RootDetectionFingerprint.result!!.mutableMethod.addInstruction(0, "return-void")
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.idaustria.detection.shared.annotations.DetectionCompatibility
|
import app.revanced.patches.idaustria.detection.shared.annotations.DetectionCompatibility
|
||||||
import app.revanced.patches.idaustria.detection.signature.fingerprints.SpoofSignatureFingerprint
|
import app.revanced.patches.idaustria.detection.signature.fingerprints.SpoofSignatureFingerprint
|
||||||
@@ -32,7 +30,7 @@ class SpoofSignaturePatch : BytecodePatch(
|
|||||||
"bf42c121d620ddfb7914f7a95c713d9e1c1b7bdb4a03d618e40cf7e9e235c0b5687e03b7ab3,publicExponent=10001}"
|
"bf42c121d620ddfb7914f7a95c713d9e1c1b7bdb4a03d618e40cf7e9e235c0b5687e03b7ab3,publicExponent=10001}"
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
SpoofSignatureFingerprint.result!!.mutableMethod.addInstructions(
|
SpoofSignatureFingerprint.result!!.mutableMethod.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
@@ -40,6 +38,5 @@ class SpoofSignaturePatch : BytecodePatch(
|
|||||||
return-object v0
|
return-object v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package app.revanced.patches.inshorts.ad.patch
|
package app.revanced.patches.inshorts.ad.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.inshorts.ad.annotations.HideAdsCompatibility
|
import app.revanced.patches.inshorts.ad.annotations.HideAdsCompatibility
|
||||||
import app.revanced.patches.inshorts.ad.fingerprints.InshortsAdsFingerprint
|
import app.revanced.patches.inshorts.ad.fingerprints.InshortsAdsFingerprint
|
||||||
@@ -19,7 +17,7 @@ import app.revanced.patches.inshorts.ad.fingerprints.InshortsAdsFingerprint
|
|||||||
class HideAdsPatch : BytecodePatch(
|
class HideAdsPatch : BytecodePatch(
|
||||||
listOf(InshortsAdsFingerprint)
|
listOf(InshortsAdsFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
InshortsAdsFingerprint.result?.let { result ->
|
InshortsAdsFingerprint.result?.let { result ->
|
||||||
result.apply {
|
result.apply {
|
||||||
mutableMethod.addInstruction(
|
mutableMethod.addInstruction(
|
||||||
@@ -29,8 +27,6 @@ class HideAdsPatch : BytecodePatch(
|
|||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} ?: return InshortsAdsFingerprint.toErrorResult()
|
} ?: throw InshortsAdsFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package app.revanced.patches.instagram.patches.ads.timeline.patch
|
package app.revanced.patches.instagram.patches.ads.timeline.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.*
|
import app.revanced.patcher.annotation.*
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
@@ -8,8 +8,6 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.util.smali.ExternalLabel
|
import app.revanced.patcher.util.smali.ExternalLabel
|
||||||
import app.revanced.patches.instagram.patches.ads.timeline.fingerprints.MediaFingerprint
|
import app.revanced.patches.instagram.patches.ads.timeline.fingerprints.MediaFingerprint
|
||||||
@@ -32,19 +30,19 @@ class HideTimelineAdsPatch : BytecodePatch(
|
|||||||
PaidPartnershipAdFingerprint // Unlike the other ads this one is resolved from all classes.
|
PaidPartnershipAdFingerprint // Unlike the other ads this one is resolved from all classes.
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
// region Resolve required methods to check for ads.
|
// region Resolve required methods to check for ads.
|
||||||
|
|
||||||
ShowAdFingerprint.result ?: return ShowAdFingerprint.toErrorResult()
|
ShowAdFingerprint.result ?: throw ShowAdFingerprint.exception
|
||||||
|
|
||||||
PaidPartnershipAdFingerprint.result ?: return PaidPartnershipAdFingerprint.toErrorResult()
|
PaidPartnershipAdFingerprint.result ?: throw PaidPartnershipAdFingerprint.exception
|
||||||
|
|
||||||
MediaFingerprint.result?.let {
|
MediaFingerprint.result?.let {
|
||||||
GenericMediaAdFingerprint.resolve(context, it.classDef)
|
GenericMediaAdFingerprint.resolve(context, it.classDef)
|
||||||
ShoppingAdFingerprint.resolve(context, it.classDef)
|
ShoppingAdFingerprint.resolve(context, it.classDef)
|
||||||
|
|
||||||
return@let
|
return@let
|
||||||
} ?: return MediaFingerprint.toErrorResult()
|
} ?: throw MediaFingerprint.exception
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
@@ -99,7 +97,5 @@ class HideTimelineAdsPatch : BytecodePatch(
|
|||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.irplus.ad.annotations.IrplusAdsCompatibility
|
import app.revanced.patches.irplus.ad.annotations.IrplusAdsCompatibility
|
||||||
import app.revanced.patches.irplus.ad.fingerprints.IrplusAdsFingerprint
|
import app.revanced.patches.irplus.ad.fingerprints.IrplusAdsFingerprint
|
||||||
@@ -19,13 +17,11 @@ import app.revanced.patches.irplus.ad.fingerprints.IrplusAdsFingerprint
|
|||||||
class IrplusAdsPatch : BytecodePatch(
|
class IrplusAdsPatch : BytecodePatch(
|
||||||
listOf(IrplusAdsFingerprint)
|
listOf(IrplusAdsFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
val method = IrplusAdsFingerprint.result!!.mutableMethod
|
val method = IrplusAdsFingerprint.result!!.mutableMethod
|
||||||
|
|
||||||
// By overwriting the second parameter of the method,
|
// By overwriting the second parameter of the method,
|
||||||
// the view which holds the advertisement is removed.
|
// the view which holds the advertisement is removed.
|
||||||
method.addInstruction(0, "const/4 p2, 0x0")
|
method.addInstruction(0, "const/4 p2, 0x0")
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,10 @@
|
|||||||
package app.revanced.patches.lightroom.misc.login.patch
|
package app.revanced.patches.lightroom.misc.login.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.lightroom.misc.login.annotations.DisableMandatoryLoginCompatibility
|
import app.revanced.patches.lightroom.misc.login.annotations.DisableMandatoryLoginCompatibility
|
||||||
import app.revanced.patches.lightroom.misc.login.fingerprint.IsLoggedInFingerprint
|
import app.revanced.patches.lightroom.misc.login.fingerprint.IsLoggedInFingerprint
|
||||||
@@ -15,13 +13,11 @@ import app.revanced.patches.lightroom.misc.login.fingerprint.IsLoggedInFingerpri
|
|||||||
@Name("Disable mandatory login")
|
@Name("Disable mandatory login")
|
||||||
@DisableMandatoryLoginCompatibility
|
@DisableMandatoryLoginCompatibility
|
||||||
class DisableMandatoryLoginPatch : BytecodePatch(listOf(IsLoggedInFingerprint)) {
|
class DisableMandatoryLoginPatch : BytecodePatch(listOf(IsLoggedInFingerprint)) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
IsLoggedInFingerprint.result?.mutableMethod?.apply {
|
IsLoggedInFingerprint.result?.mutableMethod?.apply {
|
||||||
val index = implementation!!.instructions.lastIndex - 1
|
val index = implementation!!.instructions.lastIndex - 1
|
||||||
// Set isLoggedIn = true.
|
// Set isLoggedIn = true.
|
||||||
replaceInstruction(index, "const/4 v0, 0x1")
|
replaceInstruction(index, "const/4 v0, 0x1")
|
||||||
} ?: throw IsLoggedInFingerprint.toErrorResult()
|
} ?: throw IsLoggedInFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,11 @@
|
|||||||
package app.revanced.patches.lightroom.misc.premium.patch
|
package app.revanced.patches.lightroom.misc.premium.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.lightroom.misc.premium.annotations.UnlockPremiumCompatibility
|
import app.revanced.patches.lightroom.misc.premium.annotations.UnlockPremiumCompatibility
|
||||||
import app.revanced.patches.lightroom.misc.premium.fingerprint.HasPurchasedFingerprint
|
import app.revanced.patches.lightroom.misc.premium.fingerprint.HasPurchasedFingerprint
|
||||||
@@ -17,11 +15,9 @@ import app.revanced.patches.lightroom.misc.premium.fingerprint.HasPurchasedFinge
|
|||||||
@Description("Unlocks premium features.")
|
@Description("Unlocks premium features.")
|
||||||
@UnlockPremiumCompatibility
|
@UnlockPremiumCompatibility
|
||||||
class UnlockPremiumPatch : BytecodePatch(listOf(HasPurchasedFingerprint)) {
|
class UnlockPremiumPatch : BytecodePatch(listOf(HasPurchasedFingerprint)) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
// Set hasPremium = true.
|
// Set hasPremium = true.
|
||||||
HasPurchasedFingerprint.result?.mutableMethod?.replaceInstruction(2, "const/4 v2, 0x1")
|
HasPurchasedFingerprint.result?.mutableMethod?.replaceInstruction(2, "const/4 v2, 0x1")
|
||||||
?: throw HasPurchasedFingerprint.toErrorResult()
|
?: throw HasPurchasedFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,17 @@
|
|||||||
package app.revanced.patches.memegenerator.detection.license.patch
|
package app.revanced.patches.memegenerator.detection.license.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patches.memegenerator.detection.license.fingerprint.LicenseValidationFingerprint
|
import app.revanced.patches.memegenerator.detection.license.fingerprint.LicenseValidationFingerprint
|
||||||
|
|
||||||
@Description("Disables Firebase license validation.")
|
@Description("Disables Firebase license validation.")
|
||||||
class LicenseValidationPatch : BytecodePatch(
|
class LicenseValidationPatch : BytecodePatch(
|
||||||
listOf(LicenseValidationFingerprint)
|
listOf(LicenseValidationFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
LicenseValidationFingerprint.result?.apply {
|
LicenseValidationFingerprint.result?.apply {
|
||||||
mutableMethod.replaceInstructions(
|
mutableMethod.replaceInstructions(
|
||||||
0,
|
0,
|
||||||
@@ -22,8 +20,6 @@ class LicenseValidationPatch : BytecodePatch(
|
|||||||
return p0
|
return p0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
} ?: throw LicenseValidationFingerprint.toErrorResult()
|
} ?: throw LicenseValidationFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,17 @@
|
|||||||
package app.revanced.patches.memegenerator.detection.signature.patch
|
package app.revanced.patches.memegenerator.detection.signature.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patches.memegenerator.detection.signature.fingerprint.VerifySignatureFingerprint
|
import app.revanced.patches.memegenerator.detection.signature.fingerprint.VerifySignatureFingerprint
|
||||||
|
|
||||||
@Description("Disables detection of incorrect signature.")
|
@Description("Disables detection of incorrect signature.")
|
||||||
class SignatureVerificationPatch : BytecodePatch(
|
class SignatureVerificationPatch : BytecodePatch(
|
||||||
listOf(VerifySignatureFingerprint)
|
listOf(VerifySignatureFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
VerifySignatureFingerprint.result?.apply {
|
VerifySignatureFingerprint.result?.apply {
|
||||||
mutableMethod.replaceInstructions(
|
mutableMethod.replaceInstructions(
|
||||||
0,
|
0,
|
||||||
@@ -22,8 +20,6 @@ class SignatureVerificationPatch : BytecodePatch(
|
|||||||
return p0
|
return p0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
} ?: throw VerifySignatureFingerprint.toErrorResult()
|
} ?: throw VerifySignatureFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,11 @@
|
|||||||
package app.revanced.patches.memegenerator.misc.pro.patch
|
package app.revanced.patches.memegenerator.misc.pro.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.memegenerator.detection.license.patch.LicenseValidationPatch
|
import app.revanced.patches.memegenerator.detection.license.patch.LicenseValidationPatch
|
||||||
@@ -28,7 +26,7 @@ class UnlockProVersionPatch : BytecodePatch(
|
|||||||
IsFreeVersionFingerprint
|
IsFreeVersionFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
IsFreeVersionFingerprint.result?.apply {
|
IsFreeVersionFingerprint.result?.apply {
|
||||||
mutableMethod.replaceInstructions(0,
|
mutableMethod.replaceInstructions(0,
|
||||||
"""
|
"""
|
||||||
@@ -36,8 +34,6 @@ class UnlockProVersionPatch : BytecodePatch(
|
|||||||
return-object p0
|
return-object p0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
} ?: throw IsFreeVersionFingerprint.toErrorResult()
|
} ?: throw IsFreeVersionFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,10 @@
|
|||||||
package app.revanced.patches.messenger.ads.inbox.patch
|
package app.revanced.patches.messenger.ads.inbox.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.*
|
import app.revanced.patcher.annotation.*
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.messenger.ads.inbox.fingerprints.LoadInboxAdsFingerprint
|
import app.revanced.patches.messenger.ads.inbox.fingerprints.LoadInboxAdsFingerprint
|
||||||
|
|
||||||
@@ -17,12 +15,10 @@ import app.revanced.patches.messenger.ads.inbox.fingerprints.LoadInboxAdsFingerp
|
|||||||
class HideInboxAdsPatch : BytecodePatch(
|
class HideInboxAdsPatch : BytecodePatch(
|
||||||
listOf(LoadInboxAdsFingerprint)
|
listOf(LoadInboxAdsFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
LoadInboxAdsFingerprint.result?.mutableMethod?.apply {
|
LoadInboxAdsFingerprint.result?.mutableMethod?.apply {
|
||||||
this.replaceInstruction(0, "return-void")
|
this.replaceInstruction(0, "return-void")
|
||||||
} ?: return LoadInboxAdsFingerprint.toErrorResult()
|
} ?: throw LoadInboxAdsFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package app.revanced.patches.messenger.inputfield.patch
|
package app.revanced.patches.messenger.inputfield.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.*
|
import app.revanced.patcher.annotation.*
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.messenger.inputfield.fingerprints.SwitchMessangeInputEmojiButtonFingerprint
|
import app.revanced.patches.messenger.inputfield.fingerprints.SwitchMessangeInputEmojiButtonFingerprint
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
@@ -17,7 +15,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
@Description("Disables switching from emoji to sticker search mode in message input field")
|
@Description("Disables switching from emoji to sticker search mode in message input field")
|
||||||
@Compatibility([Package("com.facebook.orca")])
|
@Compatibility([Package("com.facebook.orca")])
|
||||||
class DisableSwitchingEmojiToStickerInMessageInputField : BytecodePatch(listOf(SwitchMessangeInputEmojiButtonFingerprint)) {
|
class DisableSwitchingEmojiToStickerInMessageInputField : BytecodePatch(listOf(SwitchMessangeInputEmojiButtonFingerprint)) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
SwitchMessangeInputEmojiButtonFingerprint.result?.let {
|
SwitchMessangeInputEmojiButtonFingerprint.result?.let {
|
||||||
val setStringIndex = it.scanResult.patternScanResult!!.startIndex + 2
|
val setStringIndex = it.scanResult.patternScanResult!!.startIndex + 2
|
||||||
|
|
||||||
@@ -29,8 +27,6 @@ class DisableSwitchingEmojiToStickerInMessageInputField : BytecodePatch(listOf(S
|
|||||||
"const-string v$targetRegister, \"expression\""
|
"const-string v$targetRegister, \"expression\""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} ?: throw SwitchMessangeInputEmojiButtonFingerprint.toErrorResult()
|
} ?: throw SwitchMessangeInputEmojiButtonFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package app.revanced.patches.messenger.inputfield.patch
|
package app.revanced.patches.messenger.inputfield.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
@@ -8,8 +8,6 @@ import app.revanced.patcher.annotation.Package
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.messenger.inputfield.fingerprints.SendTypingIndicatorFingerprint
|
import app.revanced.patches.messenger.inputfield.fingerprints.SendTypingIndicatorFingerprint
|
||||||
|
|
||||||
@@ -18,10 +16,8 @@ import app.revanced.patches.messenger.inputfield.fingerprints.SendTypingIndicato
|
|||||||
@Description("Disables the indicator while typing a message")
|
@Description("Disables the indicator while typing a message")
|
||||||
@Compatibility([Package("com.facebook.orca")])
|
@Compatibility([Package("com.facebook.orca")])
|
||||||
class DisableTypingIndicator : BytecodePatch(listOf(SendTypingIndicatorFingerprint)) {
|
class DisableTypingIndicator : BytecodePatch(listOf(SendTypingIndicatorFingerprint)) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
SendTypingIndicatorFingerprint.result?.mutableMethod?.replaceInstruction(0, "return-void")
|
SendTypingIndicatorFingerprint.result?.mutableMethod?.replaceInstruction(0, "return-void")
|
||||||
?: throw SendTypingIndicatorFingerprint.toErrorResult()
|
?: throw SendTypingIndicatorFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.moneymanager.annotations.UnlockProCompatibility
|
import app.revanced.patches.moneymanager.annotations.UnlockProCompatibility
|
||||||
import app.revanced.patches.moneymanager.fingerprints.UnlockProFingerprint
|
import app.revanced.patches.moneymanager.fingerprints.UnlockProFingerprint
|
||||||
@@ -18,7 +16,7 @@ import app.revanced.patches.moneymanager.fingerprints.UnlockProFingerprint
|
|||||||
class UnlockProPatch : BytecodePatch(
|
class UnlockProPatch : BytecodePatch(
|
||||||
listOf(UnlockProFingerprint)
|
listOf(UnlockProFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
UnlockProFingerprint.result!!.mutableMethod.addInstructions(
|
UnlockProFingerprint.result!!.mutableMethod.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
@@ -26,6 +24,5 @@ class UnlockProPatch : BytecodePatch(
|
|||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,8 +6,6 @@ import app.revanced.patcher.data.BytecodeContext
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.music.ad.video.fingerprints.ShowMusicVideoAdsConstructorFingerprint
|
import app.revanced.patches.music.ad.video.fingerprints.ShowMusicVideoAdsConstructorFingerprint
|
||||||
import app.revanced.patches.music.ad.video.fingerprints.ShowMusicVideoAdsFingerprint
|
import app.revanced.patches.music.ad.video.fingerprints.ShowMusicVideoAdsFingerprint
|
||||||
@@ -20,7 +18,7 @@ import app.revanced.patches.music.annotations.MusicCompatibility
|
|||||||
class MusicVideoAdsPatch : BytecodePatch(
|
class MusicVideoAdsPatch : BytecodePatch(
|
||||||
listOf(ShowMusicVideoAdsConstructorFingerprint)
|
listOf(ShowMusicVideoAdsConstructorFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
ShowMusicVideoAdsFingerprint.resolve(context, ShowMusicVideoAdsConstructorFingerprint.result!!.classDef)
|
ShowMusicVideoAdsFingerprint.resolve(context, ShowMusicVideoAdsConstructorFingerprint.result!!.classDef)
|
||||||
|
|
||||||
val result = ShowMusicVideoAdsFingerprint.result!!
|
val result = ShowMusicVideoAdsFingerprint.result!!
|
||||||
@@ -31,7 +29,5 @@ class MusicVideoAdsPatch : BytecodePatch(
|
|||||||
const/4 p1, 0x0
|
const/4 p1, 0x0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,7 @@ package app.revanced.patches.music.audio.codecs.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.data.toMethodWalker
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.util.smali.toInstruction
|
import app.revanced.patcher.util.smali.toInstruction
|
||||||
import app.revanced.patches.music.annotations.MusicCompatibility
|
import app.revanced.patches.music.annotations.MusicCompatibility
|
||||||
@@ -23,7 +20,7 @@ class CodecsUnlockPatch : BytecodePatch(
|
|||||||
CodecsLockFingerprint, AllCodecsReferenceFingerprint
|
CodecsLockFingerprint, AllCodecsReferenceFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
val codecsLockResult = CodecsLockFingerprint.result!!
|
val codecsLockResult = CodecsLockFingerprint.result!!
|
||||||
|
|
||||||
val implementation = codecsLockResult.mutableMethod.implementation!!
|
val implementation = codecsLockResult.mutableMethod.implementation!!
|
||||||
@@ -48,7 +45,5 @@ class CodecsUnlockPatch : BytecodePatch(
|
|||||||
instructionIndex,
|
instructionIndex,
|
||||||
"invoke-static {}, ${allCodecsMethod.definingClass}->${allCodecsMethod.name}()Ljava/util/Set;".toInstruction()
|
"invoke-static {}, ${allCodecsMethod.definingClass}->${allCodecsMethod.name}()Ljava/util/Set;".toInstruction()
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,14 +5,11 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|||||||
import com.android.tools.smali.dexlib2.AccessFlags
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
object AudioOnlyEnablerFingerprint: MethodFingerprint(
|
object AllowExclusiveAudioPlaybackFingerprint: MethodFingerprint(
|
||||||
"Z", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
"Z",
|
||||||
Opcode.IGET_OBJECT,
|
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
Opcode.INVOKE_INTERFACE,
|
listOf(),
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
listOf(
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.INVOKE_INTERFACE,
|
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
Opcode.CHECK_CAST,
|
Opcode.CHECK_CAST,
|
||||||
@@ -1,29 +1,31 @@
|
|||||||
package app.revanced.patches.music.audio.exclusiveaudio.patch
|
package app.revanced.patches.music.audio.exclusiveaudio.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.music.annotations.MusicCompatibility
|
import app.revanced.patches.music.annotations.MusicCompatibility
|
||||||
import app.revanced.patches.music.audio.exclusiveaudio.fingerprints.AudioOnlyEnablerFingerprint
|
import app.revanced.patches.music.audio.exclusiveaudio.fingerprints.AllowExclusiveAudioPlaybackFingerprint
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("Exclusive audio playback")
|
@Name("Exclusive audio playback")
|
||||||
@Description("Enables the option to play music without video.")
|
@Description("Enables the option to play audio without video.")
|
||||||
@MusicCompatibility
|
@MusicCompatibility
|
||||||
class ExclusiveAudioPatch : BytecodePatch(
|
class ExclusiveAudioPatch : BytecodePatch(
|
||||||
listOf(AudioOnlyEnablerFingerprint)
|
listOf(AllowExclusiveAudioPlaybackFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
val method = AudioOnlyEnablerFingerprint.result!!.mutableMethod
|
AllowExclusiveAudioPlaybackFingerprint.result?.mutableMethod?.apply {
|
||||||
method.replaceInstruction(method.implementation!!.instructions.count() - 1, "const/4 v0, 0x1")
|
addInstructions(
|
||||||
method.addInstruction("return v0")
|
0,
|
||||||
|
"""
|
||||||
return PatchResultSuccess()
|
const/4 v0, 0x1
|
||||||
|
return v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
} ?: throw AllowExclusiveAudioPlaybackFingerprint.exception
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,12 @@
|
|||||||
package app.revanced.patches.music.interaction.permanentrepeat.patch
|
package app.revanced.patches.music.interaction.permanentrepeat.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.util.smali.ExternalLabel
|
import app.revanced.patcher.util.smali.ExternalLabel
|
||||||
import app.revanced.patches.music.annotations.MusicCompatibility
|
import app.revanced.patches.music.annotations.MusicCompatibility
|
||||||
@@ -21,7 +19,7 @@ import app.revanced.patches.music.interaction.permanentrepeat.fingerprints.Repea
|
|||||||
class PermanentRepeatPatch : BytecodePatch(
|
class PermanentRepeatPatch : BytecodePatch(
|
||||||
listOf(RepeatTrackFingerprint)
|
listOf(RepeatTrackFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
RepeatTrackFingerprint.result?.let {
|
RepeatTrackFingerprint.result?.let {
|
||||||
val startIndex = it.scanResult.patternScanResult!!.endIndex
|
val startIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
val repeatIndex = startIndex + 3
|
val repeatIndex = startIndex + 3
|
||||||
@@ -33,8 +31,6 @@ class PermanentRepeatPatch : BytecodePatch(
|
|||||||
ExternalLabel("repeat", getInstruction(repeatIndex))
|
ExternalLabel("repeat", getInstruction(repeatIndex))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} ?: return RepeatTrackFingerprint.toErrorResult()
|
} ?: throw RepeatTrackFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package app.revanced.patches.music.interaction.permanentshuffle.patch
|
package app.revanced.patches.music.interaction.permanentshuffle.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.music.annotations.MusicCompatibility
|
import app.revanced.patches.music.annotations.MusicCompatibility
|
||||||
import app.revanced.patches.music.interaction.permanentshuffle.fingerprints.DisableShuffleFingerprint
|
import app.revanced.patches.music.interaction.permanentshuffle.fingerprints.DisableShuffleFingerprint
|
||||||
@@ -20,10 +18,8 @@ import app.revanced.patches.music.interaction.permanentshuffle.fingerprints.Disa
|
|||||||
class PermanentShuffleTogglePatch : BytecodePatch(
|
class PermanentShuffleTogglePatch : BytecodePatch(
|
||||||
listOf(DisableShuffleFingerprint)
|
listOf(DisableShuffleFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
DisableShuffleFingerprint.result?.mutableMethod?.addInstruction(0, "return-void")
|
DisableShuffleFingerprint.result?.mutableMethod?.addInstruction(0, "return-void")
|
||||||
?: return DisableShuffleFingerprint.toErrorResult()
|
?: throw DisableShuffleFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.music.annotations.MusicCompatibility
|
import app.revanced.patches.music.annotations.MusicCompatibility
|
||||||
import app.revanced.patches.music.layout.compactheader.fingerprints.CompactHeaderConstructorFingerprint
|
import app.revanced.patches.music.layout.compactheader.fingerprints.CompactHeaderConstructorFingerprint
|
||||||
@@ -19,7 +17,7 @@ import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction11x
|
|||||||
class CompactHeaderPatch : BytecodePatch(
|
class CompactHeaderPatch : BytecodePatch(
|
||||||
listOf(CompactHeaderConstructorFingerprint)
|
listOf(CompactHeaderConstructorFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
val result = CompactHeaderConstructorFingerprint.result!!
|
val result = CompactHeaderConstructorFingerprint.result!!
|
||||||
val method = result.mutableMethod
|
val method = result.mutableMethod
|
||||||
|
|
||||||
@@ -31,7 +29,5 @@ class CompactHeaderPatch : BytecodePatch(
|
|||||||
invoke-virtual {v${register}, v2}, Landroid/view/View;->setVisibility(I)V
|
invoke-virtual {v${register}, v2}, Landroid/view/View;->setVisibility(I)V
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.music.annotations.MusicCompatibility
|
import app.revanced.patches.music.annotations.MusicCompatibility
|
||||||
import app.revanced.patches.music.layout.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint
|
import app.revanced.patches.music.layout.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint
|
||||||
@@ -18,14 +16,12 @@ import app.revanced.patches.music.layout.minimizedplayback.fingerprints.Minimize
|
|||||||
class MinimizedPlaybackPatch : BytecodePatch(
|
class MinimizedPlaybackPatch : BytecodePatch(
|
||||||
listOf(MinimizedPlaybackManagerFingerprint)
|
listOf(MinimizedPlaybackManagerFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
MinimizedPlaybackManagerFingerprint.result!!.mutableMethod.addInstruction(
|
MinimizedPlaybackManagerFingerprint.result!!.mutableMethod.addInstruction(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
return-void
|
return-void
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.music.annotations.MusicCompatibility
|
import app.revanced.patches.music.annotations.MusicCompatibility
|
||||||
import app.revanced.patches.music.layout.premium.fingerprints.HideGetPremiumFingerprint
|
import app.revanced.patches.music.layout.premium.fingerprints.HideGetPremiumFingerprint
|
||||||
@@ -21,7 +19,7 @@ import app.revanced.patches.music.layout.premium.fingerprints.HideGetPremiumPare
|
|||||||
class HideGetPremiumPatch : BytecodePatch(
|
class HideGetPremiumPatch : BytecodePatch(
|
||||||
listOf(HideGetPremiumParentFingerprint)
|
listOf(HideGetPremiumParentFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
val parentResult = HideGetPremiumParentFingerprint.result!!
|
val parentResult = HideGetPremiumParentFingerprint.result!!
|
||||||
HideGetPremiumFingerprint.resolve(context, parentResult.classDef)
|
HideGetPremiumFingerprint.resolve(context, parentResult.classDef)
|
||||||
|
|
||||||
@@ -43,7 +41,5 @@ class HideGetPremiumPatch : BytecodePatch(
|
|||||||
const/16 v0, 0x8
|
const/16 v0, 0x8
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.util.smali.toInstructions
|
import app.revanced.patcher.util.smali.toInstructions
|
||||||
import app.revanced.patches.music.annotations.MusicCompatibility
|
import app.revanced.patches.music.annotations.MusicCompatibility
|
||||||
@@ -24,7 +22,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
|
|||||||
class RemoveUpgradeButtonPatch : BytecodePatch(
|
class RemoveUpgradeButtonPatch : BytecodePatch(
|
||||||
listOf(PivotBarConstructorFingerprint)
|
listOf(PivotBarConstructorFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
val result = PivotBarConstructorFingerprint.result!!
|
val result = PivotBarConstructorFingerprint.result!!
|
||||||
val implementation = result.mutableMethod.implementation!!
|
val implementation = result.mutableMethod.implementation!!
|
||||||
|
|
||||||
@@ -69,6 +67,5 @@ class RemoveUpgradeButtonPatch : BytecodePatch(
|
|||||||
implementation.addInstructions(
|
implementation.addInstructions(
|
||||||
endIndex, instructionList
|
endIndex, instructionList
|
||||||
)
|
)
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package app.revanced.patches.music.misc.androidauto.patch
|
package app.revanced.patches.music.misc.androidauto.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.music.annotations.MusicCompatibility
|
import app.revanced.patches.music.annotations.MusicCompatibility
|
||||||
import app.revanced.patches.music.misc.androidauto.fingerprints.CheckCertificateFingerprint
|
import app.revanced.patches.music.misc.androidauto.fingerprints.CheckCertificateFingerprint
|
||||||
@@ -19,7 +17,7 @@ import app.revanced.patches.music.misc.androidauto.fingerprints.CheckCertificate
|
|||||||
class BypassCertificateChecksPatch : BytecodePatch(
|
class BypassCertificateChecksPatch : BytecodePatch(
|
||||||
listOf(CheckCertificateFingerprint)
|
listOf(CheckCertificateFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
CheckCertificateFingerprint.result?.apply {
|
CheckCertificateFingerprint.result?.apply {
|
||||||
mutableMethod.addInstructions(
|
mutableMethod.addInstructions(
|
||||||
0, """
|
0, """
|
||||||
@@ -27,8 +25,6 @@ class BypassCertificateChecksPatch : BytecodePatch(
|
|||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
} ?: return CheckCertificateFingerprint.toErrorResult()
|
} ?: throw CheckCertificateFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.music.annotations.MusicCompatibility
|
import app.revanced.patches.music.annotations.MusicCompatibility
|
||||||
@@ -37,27 +36,25 @@ class MicroGBytecodePatch : BytecodePatch(
|
|||||||
// - "com.google.android.gms.phenotype.PACKAGE_NAME",
|
// - "com.google.android.gms.phenotype.PACKAGE_NAME",
|
||||||
// - "com.google.android.gms.phenotype.UPDATE",
|
// - "com.google.android.gms.phenotype.UPDATE",
|
||||||
// - "com.google.android.gms.phenotype",
|
// - "com.google.android.gms.phenotype",
|
||||||
override fun execute(context: BytecodeContext) =
|
override fun execute(context: BytecodeContext) = MicroGBytecodeHelper.patchBytecode(
|
||||||
// apply common microG patch
|
context,
|
||||||
MicroGBytecodeHelper.patchBytecode(
|
arrayOf(
|
||||||
context,
|
MicroGBytecodeHelper.packageNameTransform(
|
||||||
arrayOf(
|
Constants.PACKAGE_NAME,
|
||||||
MicroGBytecodeHelper.packageNameTransform(
|
Constants.REVANCED_PACKAGE_NAME
|
||||||
Constants.PACKAGE_NAME,
|
|
||||||
Constants.REVANCED_PACKAGE_NAME
|
|
||||||
)
|
|
||||||
),
|
|
||||||
MicroGBytecodeHelper.PrimeMethodTransformationData(
|
|
||||||
PrimeFingerprint,
|
|
||||||
MUSIC_PACKAGE_NAME,
|
|
||||||
REVANCED_MUSIC_PACKAGE_NAME
|
|
||||||
),
|
|
||||||
listOf(
|
|
||||||
ServiceCheckFingerprint,
|
|
||||||
GooglePlayUtilityFingerprint,
|
|
||||||
CastDynamiteModuleFingerprint,
|
|
||||||
CastDynamiteModuleV2Fingerprint,
|
|
||||||
CastContextFetchFingerprint
|
|
||||||
)
|
)
|
||||||
).let { PatchResultSuccess() }
|
),
|
||||||
|
MicroGBytecodeHelper.PrimeMethodTransformationData(
|
||||||
|
PrimeFingerprint,
|
||||||
|
MUSIC_PACKAGE_NAME,
|
||||||
|
REVANCED_MUSIC_PACKAGE_NAME
|
||||||
|
),
|
||||||
|
listOf(
|
||||||
|
ServiceCheckFingerprint,
|
||||||
|
GooglePlayUtilityFingerprint,
|
||||||
|
CastDynamiteModuleFingerprint,
|
||||||
|
CastDynamiteModuleV2Fingerprint,
|
||||||
|
CastContextFetchFingerprint
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package app.revanced.patches.music.misc.microg.patch.resource
|
|||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.data.ResourceContext
|
import app.revanced.patcher.data.ResourceContext
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.ResourcePatch
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
import app.revanced.patches.music.misc.microg.shared.Constants.MUSIC_PACKAGE_NAME
|
import app.revanced.patches.music.misc.microg.shared.Constants.MUSIC_PACKAGE_NAME
|
||||||
import app.revanced.patches.music.misc.microg.shared.Constants.REVANCED_MUSIC_APP_NAME
|
import app.revanced.patches.music.misc.microg.shared.Constants.REVANCED_MUSIC_APP_NAME
|
||||||
@@ -15,7 +13,7 @@ import app.revanced.util.microg.MicroGResourceHelper
|
|||||||
|
|
||||||
@Description("Resource patch to allow YouTube Music ReVanced to run without root and under a different package name.")
|
@Description("Resource patch to allow YouTube Music ReVanced to run without root and under a different package name.")
|
||||||
class MicroGResourcePatch : ResourcePatch {
|
class MicroGResourcePatch : ResourcePatch {
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext) {
|
||||||
// update manifest
|
// update manifest
|
||||||
MicroGResourceHelper.patchManifest(
|
MicroGResourceHelper.patchManifest(
|
||||||
context,
|
context,
|
||||||
@@ -30,6 +28,5 @@ class MicroGResourcePatch : ResourcePatch {
|
|||||||
SPOOFED_PACKAGE_NAME,
|
SPOOFED_PACKAGE_NAME,
|
||||||
SPOOFED_PACKAGE_SIGNATURE
|
SPOOFED_PACKAGE_SIGNATURE
|
||||||
)
|
)
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.music.annotations.MusicCompatibility
|
import app.revanced.patches.music.annotations.MusicCompatibility
|
||||||
import app.revanced.patches.music.premium.backgroundplay.fingerprints.BackgroundPlaybackDisableFingerprint
|
import app.revanced.patches.music.premium.backgroundplay.fingerprints.BackgroundPlaybackDisableFingerprint
|
||||||
@@ -18,7 +16,7 @@ import app.revanced.patches.music.premium.backgroundplay.fingerprints.Background
|
|||||||
class BackgroundPlayPatch : BytecodePatch(
|
class BackgroundPlayPatch : BytecodePatch(
|
||||||
listOf(BackgroundPlaybackDisableFingerprint)
|
listOf(BackgroundPlaybackDisableFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
BackgroundPlaybackDisableFingerprint.result!!.mutableMethod.addInstructions(
|
BackgroundPlaybackDisableFingerprint.result!!.mutableMethod.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
@@ -26,7 +24,5 @@ class BackgroundPlayPatch : BytecodePatch(
|
|||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.myexpenses.misc.pro.annotations.UnlockProCompatibility
|
import app.revanced.patches.myexpenses.misc.pro.annotations.UnlockProCompatibility
|
||||||
import app.revanced.patches.myexpenses.misc.pro.fingerprints.IsEnabledFingerprint
|
import app.revanced.patches.myexpenses.misc.pro.fingerprints.IsEnabledFingerprint
|
||||||
@@ -20,7 +18,7 @@ class UnlockProPatch : BytecodePatch(
|
|||||||
IsEnabledFingerprint
|
IsEnabledFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
val method = IsEnabledFingerprint.result!!.mutableMethod
|
val method = IsEnabledFingerprint.result!!.mutableMethod
|
||||||
method.addInstructions(
|
method.addInstructions(
|
||||||
0,
|
0,
|
||||||
@@ -29,7 +27,5 @@ class UnlockProPatch : BytecodePatch(
|
|||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ package app.revanced.patches.netguard.broadcasts.removerestriction.resource.patc
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.ResourceContext
|
import app.revanced.patcher.data.ResourceContext
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.ResourcePatch
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.netguard.broadcasts.removerestriction.resource.annotations.RemoveBroadcastsRestrictionCompatibility
|
import app.revanced.patches.netguard.broadcasts.removerestriction.resource.annotations.RemoveBroadcastsRestrictionCompatibility
|
||||||
@@ -15,7 +13,7 @@ import org.w3c.dom.Element
|
|||||||
@Description("Enables starting/stopping NetGuard via broadcasts.")
|
@Description("Enables starting/stopping NetGuard via broadcasts.")
|
||||||
@RemoveBroadcastsRestrictionCompatibility
|
@RemoveBroadcastsRestrictionCompatibility
|
||||||
class RemoveBroadcastsRestrictionPatch : ResourcePatch {
|
class RemoveBroadcastsRestrictionPatch : ResourcePatch {
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext) {
|
||||||
context.xmlEditor["AndroidManifest.xml"].use { dom ->
|
context.xmlEditor["AndroidManifest.xml"].use { dom ->
|
||||||
val applicationNode = dom
|
val applicationNode = dom
|
||||||
.file
|
.file
|
||||||
@@ -32,7 +30,5 @@ class RemoveBroadcastsRestrictionPatch : ResourcePatch {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package app.revanced.patches.nfctoolsse.misc.pro.patch
|
package app.revanced.patches.nfctoolsse.misc.pro.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.nfctoolsse.misc.pro.annotations.UnlockProCompatibility
|
import app.revanced.patches.nfctoolsse.misc.pro.annotations.UnlockProCompatibility
|
||||||
import app.revanced.patches.nfctoolsse.misc.pro.fingerprints.IsLicenseRegisteredFingerprint
|
import app.revanced.patches.nfctoolsse.misc.pro.fingerprints.IsLicenseRegisteredFingerprint
|
||||||
@@ -22,7 +20,7 @@ class UnlockProPatch : BytecodePatch(
|
|||||||
IsLicenseRegisteredFingerprint
|
IsLicenseRegisteredFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
IsLicenseRegisteredFingerprint.result?.mutableMethod?.apply {
|
IsLicenseRegisteredFingerprint.result?.mutableMethod?.apply {
|
||||||
addInstructions(
|
addInstructions(
|
||||||
0,
|
0,
|
||||||
@@ -31,9 +29,7 @@ class UnlockProPatch : BytecodePatch(
|
|||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
} ?: return IsLicenseRegisteredFingerprint.toErrorResult()
|
} ?: throw IsLicenseRegisteredFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.nyx.misc.pro.annotations.UnlockProCompatibility
|
import app.revanced.patches.nyx.misc.pro.annotations.UnlockProCompatibility
|
||||||
import app.revanced.patches.nyx.misc.pro.fingerprints.CheckProFingerprint
|
import app.revanced.patches.nyx.misc.pro.fingerprints.CheckProFingerprint
|
||||||
@@ -20,7 +18,7 @@ class UnlockProPatch : BytecodePatch(
|
|||||||
CheckProFingerprint
|
CheckProFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
val method = CheckProFingerprint.result!!.mutableMethod
|
val method = CheckProFingerprint.result!!.mutableMethod
|
||||||
method.addInstructions(
|
method.addInstructions(
|
||||||
0,
|
0,
|
||||||
@@ -29,7 +27,5 @@ class UnlockProPatch : BytecodePatch(
|
|||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package app.revanced.patches.photomath.detection.deviceid.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object GetDeviceIdFingerprint : MethodFingerprint(
|
||||||
|
returnType = "Ljava/lang/String;",
|
||||||
|
strings = listOf("androidId", "android_id"),
|
||||||
|
parameters = listOf()
|
||||||
|
)
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package app.revanced.patches.photomath.detection.deviceid.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.exception
|
||||||
|
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.replaceInstructions
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.photomath.detection.deviceid.fingerprints.GetDeviceIdFingerprint
|
||||||
|
import app.revanced.patches.photomath.detection.signature.patch.SignatureDetectionPatch
|
||||||
|
import kotlin.random.Random
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@DependsOn([SignatureDetectionPatch::class])
|
||||||
|
@Name("Spoof device ID")
|
||||||
|
@Description("Spoofs device ID to mitigate manual bans by developers.")
|
||||||
|
@Compatibility([Package("com.microblink.photomath")])
|
||||||
|
class SpoofDeviceIdPatch : BytecodePatch(
|
||||||
|
listOf(GetDeviceIdFingerprint)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext) = GetDeviceIdFingerprint.result?.mutableMethod?.replaceInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const-string v0, "${Random.nextLong().toString(16)}"
|
||||||
|
return-object v0
|
||||||
|
"""
|
||||||
|
) ?: throw GetDeviceIdFingerprint.exception
|
||||||
|
}
|
||||||
@@ -1,19 +1,11 @@
|
|||||||
package app.revanced.patches.photomath.detection.signature.fingerprints
|
package app.revanced.patches.photomath.detection.signature.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import com.android.tools.smali.dexlib2.AccessFlags
|
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
object CheckSignatureFingerprint : MethodFingerprint(
|
object CheckSignatureFingerprint : MethodFingerprint(
|
||||||
returnType = "V",
|
|
||||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
|
||||||
customFingerprint = { methodDef, _ ->
|
|
||||||
(methodDef.definingClass == "Lcom/microblink/photomath/main/activity/LauncherActivity;" ||
|
|
||||||
methodDef.definingClass == "Lcom/microblink/photomath/PhotoMath;") &&
|
|
||||||
methodDef.name == "onCreate"
|
|
||||||
},
|
|
||||||
strings = listOf(
|
strings = listOf(
|
||||||
|
"packageInfo.signatures",
|
||||||
"currentSignature"
|
"currentSignature"
|
||||||
),
|
),
|
||||||
opcodes = listOf(
|
opcodes = listOf(
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package app.revanced.patches.photomath.detection.signature.patch
|
package app.revanced.patches.photomath.detection.signature.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patches.photomath.detection.signature.fingerprints.CheckSignatureFingerprint
|
import app.revanced.patches.photomath.detection.signature.fingerprints.CheckSignatureFingerprint
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
|
||||||
@@ -17,15 +15,12 @@ class SignatureDetectionPatch : BytecodePatch(
|
|||||||
CheckSignatureFingerprint
|
CheckSignatureFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
CheckSignatureFingerprint.result?.apply {
|
CheckSignatureFingerprint.result?.apply {
|
||||||
val signatureCheckInstruction = mutableMethod.getInstruction(scanResult.patternScanResult!!.endIndex)
|
val signatureCheckInstruction = mutableMethod.getInstruction(scanResult.patternScanResult!!.endIndex)
|
||||||
val checkRegister = (signatureCheckInstruction as OneRegisterInstruction).registerA
|
val checkRegister = (signatureCheckInstruction as OneRegisterInstruction).registerA
|
||||||
|
|
||||||
mutableMethod.replaceInstruction(signatureCheckInstruction.location.index, "const/4 v$checkRegister, 0x1")
|
mutableMethod.replaceInstruction(signatureCheckInstruction.location.index, "const/4 v$checkRegister, 0x1")
|
||||||
} ?: throw CheckSignatureFingerprint.toErrorResult()
|
} ?: throw CheckSignatureFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package app.revanced.patches.photomath.misc.bookpoint.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
object IsBookpointEnabledFingerprint : MethodFingerprint(
|
||||||
|
returnType = "Z",
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
parameters = listOf(),
|
||||||
|
strings = listOf(
|
||||||
|
"NoGeoData",
|
||||||
|
"NoCountryInGeo",
|
||||||
|
"RemoteConfig",
|
||||||
|
"GeoRCMismatch"
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package app.revanced.patches.photomath.misc.bookpoint.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.exception
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patches.photomath.misc.bookpoint.fingerprints.IsBookpointEnabledFingerprint
|
||||||
|
|
||||||
|
@Description("Enables textbook access")
|
||||||
|
class EnableBookpointPatch : BytecodePatch(listOf(IsBookpointEnabledFingerprint)) {
|
||||||
|
override fun execute(context: BytecodeContext) =
|
||||||
|
IsBookpointEnabledFingerprint.result?.mutableMethod?.replaceInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const/4 v0, 0x1
|
||||||
|
return v0
|
||||||
|
"""
|
||||||
|
) ?: throw IsBookpointEnabledFingerprint.exception
|
||||||
|
}
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package app.revanced.patches.photomath.misc.unlockplus.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility([Package("com.microblink.photomath", arrayOf("8.20.0"))])
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
internal annotation class UnlockPlusCompatibilty
|
|
||||||
@@ -1,41 +1,30 @@
|
|||||||
package app.revanced.patches.photomath.misc.unlockplus.patch
|
package app.revanced.patches.photomath.misc.unlockplus.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.photomath.detection.signature.patch.SignatureDetectionPatch
|
import app.revanced.patches.photomath.detection.signature.patch.SignatureDetectionPatch
|
||||||
import app.revanced.patches.photomath.misc.unlockplus.annotations.UnlockPlusCompatibilty
|
import app.revanced.patches.photomath.misc.bookpoint.patch.EnableBookpointPatch
|
||||||
import app.revanced.patches.photomath.misc.unlockplus.fingerprints.IsPlusUnlockedFingerprint
|
import app.revanced.patches.photomath.misc.unlockplus.fingerprints.IsPlusUnlockedFingerprint
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("Unlock plus")
|
@Name("Unlock plus")
|
||||||
@DependsOn([SignatureDetectionPatch::class])
|
@DependsOn([SignatureDetectionPatch::class, EnableBookpointPatch::class])
|
||||||
@Description("Unlocks plus features.")
|
@Compatibility([Package("com.microblink.photomath")])
|
||||||
@UnlockPlusCompatibilty
|
|
||||||
class UnlockPlusPatch : BytecodePatch(
|
class UnlockPlusPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(IsPlusUnlockedFingerprint)
|
||||||
IsPlusUnlockedFingerprint
|
|
||||||
)
|
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) = IsPlusUnlockedFingerprint.result?.mutableMethod?.addInstructions(
|
||||||
IsPlusUnlockedFingerprint.result?.mutableMethod?.apply {
|
0,
|
||||||
addInstructions(
|
"""
|
||||||
0,
|
const/4 v0, 0x1
|
||||||
"""
|
return v0
|
||||||
const/4 v0, 0x1
|
"""
|
||||||
return v0
|
) ?: throw IsPlusUnlockedFingerprint.exception
|
||||||
"""
|
|
||||||
)
|
|
||||||
} ?: return IsPlusUnlockedFingerprint.toErrorResult()
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,10 @@
|
|||||||
package app.revanced.patches.pixiv.ads.patch
|
package app.revanced.patches.pixiv.ads.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.*
|
import app.revanced.patcher.annotation.*
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.pixiv.ads.fingerprints.IsNotPremiumFingerprint
|
import app.revanced.patches.pixiv.ads.fingerprints.IsNotPremiumFingerprint
|
||||||
|
|
||||||
@@ -15,7 +13,7 @@ import app.revanced.patches.pixiv.ads.fingerprints.IsNotPremiumFingerprint
|
|||||||
@Description("Hides ads.")
|
@Description("Hides ads.")
|
||||||
@Compatibility([Package("jp.pxv.android")])
|
@Compatibility([Package("jp.pxv.android")])
|
||||||
class HideAdsPatch : BytecodePatch(listOf(IsNotPremiumFingerprint)) {
|
class HideAdsPatch : BytecodePatch(listOf(IsNotPremiumFingerprint)) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
// Always return false in the "isNotPremium" method which normally returns !this.accountManager.isPremium.
|
// Always return false in the "isNotPremium" method which normally returns !this.accountManager.isPremium.
|
||||||
// However, this is not the method that controls the user's premium status.
|
// However, this is not the method that controls the user's premium status.
|
||||||
// Instead, this method is used to determine whether ads should be shown.
|
// Instead, this method is used to determine whether ads should be shown.
|
||||||
@@ -25,8 +23,6 @@ class HideAdsPatch : BytecodePatch(listOf(IsNotPremiumFingerprint)) {
|
|||||||
const/4 v0, 0x0
|
const/4 v0, 0x0
|
||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
) ?: return IsNotPremiumFingerprint.toErrorResult()
|
) ?: throw IsNotPremiumFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,14 +3,12 @@ package app.revanced.patches.reddit.ad.banner.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.ResourceContext
|
import app.revanced.patcher.data.ResourceContext
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.ResourcePatch
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
|
|
||||||
@Name("Hide subreddit banner")
|
@Name("Hide subreddit banner")
|
||||||
@Description("Hides banner ads from comments on subreddits.")
|
@Description("Hides banner ads from comments on subreddits.")
|
||||||
class HideBannerPatch : ResourcePatch {
|
class HideBannerPatch : ResourcePatch {
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext) {
|
||||||
context.xmlEditor[RESOURCE_FILE_PATH].use {
|
context.xmlEditor[RESOURCE_FILE_PATH].use {
|
||||||
it.file.getElementsByTagName("merge").item(0).childNodes.apply {
|
it.file.getElementsByTagName("merge").item(0).childNodes.apply {
|
||||||
val attributes = arrayOf("height", "width")
|
val attributes = arrayOf("height", "width")
|
||||||
@@ -30,8 +28,6 @@ class HideBannerPatch : ResourcePatch {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patches.reddit.ad.comments.fingerprints.HideCommentAdsFingerprint
|
import app.revanced.patches.reddit.ad.comments.fingerprints.HideCommentAdsFingerprint
|
||||||
|
|
||||||
@Name("Hide comment ads")
|
@Name("Hide comment ads")
|
||||||
@@ -14,7 +12,7 @@ import app.revanced.patches.reddit.ad.comments.fingerprints.HideCommentAdsFinger
|
|||||||
class HideCommentAdsPatch : BytecodePatch(
|
class HideCommentAdsPatch : BytecodePatch(
|
||||||
listOf(HideCommentAdsFingerprint)
|
listOf(HideCommentAdsFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
val method = HideCommentAdsFingerprint.result!!.mutableMethod
|
val method = HideCommentAdsFingerprint.result!!.mutableMethod
|
||||||
// Returns a blank object instead of the comment ad.
|
// Returns a blank object instead of the comment ad.
|
||||||
method.addInstructions(
|
method.addInstructions(
|
||||||
@@ -25,6 +23,5 @@ class HideCommentAdsPatch : BytecodePatch(
|
|||||||
return-object v0
|
return-object v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import app.revanced.patcher.data.BytecodeContext
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.annotations.RequiresIntegrations
|
import app.revanced.patcher.patch.annotations.RequiresIntegrations
|
||||||
@@ -31,7 +29,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
|||||||
class HideAdsPatch : BytecodePatch(
|
class HideAdsPatch : BytecodePatch(
|
||||||
listOf(AdPostFingerprint, NewAdPostFingerprint)
|
listOf(AdPostFingerprint, NewAdPostFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
// region Filter promoted ads (does not work in popular or latest feed)
|
// region Filter promoted ads (does not work in popular or latest feed)
|
||||||
|
|
||||||
AdPostFingerprint.result?.mutableMethod?.apply {
|
AdPostFingerprint.result?.mutableMethod?.apply {
|
||||||
@@ -78,8 +76,6 @@ class HideAdsPatch : BytecodePatch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
package app.revanced.patches.reddit.customclients
|
package app.revanced.patches.reddit.customclients
|
||||||
|
|
||||||
import android.os.Environment
|
import android.os.Environment
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||||
import app.revanced.patcher.patch.*
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.OptionsContainer
|
||||||
|
import app.revanced.patcher.patch.PatchException
|
||||||
|
import app.revanced.patcher.patch.PatchOption
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
abstract class AbstractSpoofClientPatch(
|
abstract class AbstractSpoofClientPatch(
|
||||||
@@ -17,13 +20,13 @@ abstract class AbstractSpoofClientPatch(
|
|||||||
addAll(clientIdFingerprints)
|
addAll(clientIdFingerprints)
|
||||||
userAgentFingerprints?.let(::addAll)
|
userAgentFingerprints?.let(::addAll)
|
||||||
}) {
|
}) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
if (options.clientId == null) {
|
if (options.clientId == null) {
|
||||||
// Ensure device runs Android.
|
// Ensure device runs Android.
|
||||||
try {
|
try {
|
||||||
Class.forName("android.os.Environment")
|
Class.forName("android.os.Environment")
|
||||||
} catch (e: ClassNotFoundException) {
|
} catch (e: ClassNotFoundException) {
|
||||||
return PatchResultError("No client ID provided")
|
throw PatchException("No client ID provided")
|
||||||
}
|
}
|
||||||
|
|
||||||
File(Environment.getExternalStorageDirectory(), "reddit_client_id_revanced.txt").also {
|
File(Environment.getExternalStorageDirectory(), "reddit_client_id_revanced.txt").also {
|
||||||
@@ -38,22 +41,16 @@ abstract class AbstractSpoofClientPatch(
|
|||||||
The application type has to be "Installed app" and the redirect URI has to be set to "$redirectUri".
|
The application type has to be "Installed app" and the redirect URI has to be set to "$redirectUri".
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
|
||||||
return PatchResultError(error)
|
throw PatchException(error)
|
||||||
}.let { options.clientId = it.readText().trim() }
|
}.let { options.clientId = it.readText().trim() }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun List<MethodFingerprint>?.executePatch(
|
fun List<MethodFingerprint>?.executePatch(
|
||||||
patch: List<MethodFingerprintResult>.(BytecodeContext) -> PatchResult
|
patch: List<MethodFingerprintResult>.(BytecodeContext) -> Unit
|
||||||
) {
|
) = this?.map { it.result ?: throw it.exception }?.patch(context)
|
||||||
when (val result = this?.map { it.result ?: throw it.toErrorResult() }?.patch(context)) {
|
|
||||||
is PatchResultError -> throw result
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
clientIdFingerprints.executePatch { patchClientId(context) }
|
clientIdFingerprints.executePatch { patchClientId(context) }
|
||||||
userAgentFingerprints.executePatch { patchUserAgent(context) }
|
userAgentFingerprints.executePatch { patchUserAgent(context) }
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -62,7 +59,7 @@ abstract class AbstractSpoofClientPatch(
|
|||||||
* @param context The current [BytecodeContext].
|
* @param context The current [BytecodeContext].
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
abstract fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult
|
abstract fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Patch the user agent. The fingerprints are guaranteed to be in the same order as in [userAgentFingerprints].
|
* Patch the user agent. The fingerprints are guaranteed to be in the same order as in [userAgentFingerprints].
|
||||||
@@ -70,8 +67,7 @@ abstract class AbstractSpoofClientPatch(
|
|||||||
* @param context The current [BytecodeContext].
|
* @param context The current [BytecodeContext].
|
||||||
*/
|
*/
|
||||||
// Not every client needs to patch the user agent.
|
// Not every client needs to patch the user agent.
|
||||||
open fun List<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext): PatchResult =
|
open fun List<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext) {}
|
||||||
PatchResultSuccess()
|
|
||||||
|
|
||||||
companion object Options {
|
companion object Options {
|
||||||
open class SpoofClientOptionsContainer : OptionsContainer() {
|
open class SpoofClientOptionsContainer : OptionsContainer() {
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import app.revanced.patcher.data.BytecodeContext
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||||
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
||||||
import app.revanced.patches.reddit.customclients.baconreader.api.fingerprints.GetAuthorizationUrlFingerprint
|
import app.revanced.patches.reddit.customclients.baconreader.api.fingerprints.GetAuthorizationUrlFingerprint
|
||||||
@@ -30,7 +28,7 @@ class SpoofClientPatch : AbstractSpoofClientPatch(
|
|||||||
"http://baconreader.com/auth", Options, listOf(GetAuthorizationUrlFingerprint, RequestTokenFingerprint)
|
"http://baconreader.com/auth", Options, listOf(GetAuthorizationUrlFingerprint, RequestTokenFingerprint)
|
||||||
) {
|
) {
|
||||||
|
|
||||||
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult {
|
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
||||||
fun MethodFingerprintResult.patch(replacementString: String) {
|
fun MethodFingerprintResult.patch(replacementString: String) {
|
||||||
val clientIdIndex = scanResult.stringsScanResult!!.matches.first().index
|
val clientIdIndex = scanResult.stringsScanResult!!.matches.first().index
|
||||||
|
|
||||||
@@ -48,8 +46,6 @@ class SpoofClientPatch : AbstractSpoofClientPatch(
|
|||||||
|
|
||||||
// Patch client id for access token request.
|
// Patch client id for access token request.
|
||||||
last().patch(clientId!!)
|
last().patch(clientId!!)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import app.revanced.patcher.annotation.Package
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||||
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
||||||
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint
|
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint
|
||||||
@@ -20,7 +18,7 @@ import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints
|
|||||||
class SpoofClientPatch : AbstractSpoofClientPatch(
|
class SpoofClientPatch : AbstractSpoofClientPatch(
|
||||||
"http://rubenmayayo.com", Options, listOf(GetClientIdFingerprint)
|
"http://rubenmayayo.com", Options, listOf(GetClientIdFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult {
|
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
||||||
first().mutableMethod.addInstructions(
|
first().mutableMethod.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
@@ -28,8 +26,6 @@ class SpoofClientPatch : AbstractSpoofClientPatch(
|
|||||||
return-object v0
|
return-object v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
package app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints
|
package app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.iface.ClassDef
|
||||||
|
import com.android.tools.smali.dexlib2.iface.Method
|
||||||
|
|
||||||
abstract class AbstractClientIdFingerprint(classTypeSuffix: String, methodName: String) : MethodFingerprint(
|
/**
|
||||||
strings = listOf("NOe2iKrPPzwscA"),
|
* Fingerprint for a method that has the client id hardcoded in it.
|
||||||
customFingerprint = custom@{ methodDef, classDef ->
|
* The first string in the fingerprint is the client id.
|
||||||
if (!classDef.type.endsWith(classTypeSuffix)) return@custom false
|
*
|
||||||
|
* @param customFingerprint A custom fingerprint.
|
||||||
methodDef.name == methodName
|
* @param additionalStrings Additional strings to add to the fingerprint.
|
||||||
}
|
*/
|
||||||
)
|
abstract class AbstractClientIdFingerprint(
|
||||||
|
customFingerprint: ((methodDef: Method, classDef: ClassDef) -> Boolean)? = null,
|
||||||
|
vararg additionalStrings: String
|
||||||
|
) : MethodFingerprint(strings = listOf("NOe2iKrPPzwscA", *additionalStrings), customFingerprint = customFingerprint)
|
||||||
@@ -1,6 +1,3 @@
|
|||||||
package app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints
|
package app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints
|
||||||
|
|
||||||
object GetHttpBasicAuthHeaderFingerprint : AbstractClientIdFingerprint(
|
object GetHttpBasicAuthHeaderFingerprint : AbstractClientIdFingerprint(additionalStrings = arrayOf("Authorization"))
|
||||||
"APIUtils;",
|
|
||||||
"getHttpBasicAuthHeader"
|
|
||||||
)
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints
|
package app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints
|
||||||
|
|
||||||
object LoginActivityOnCreateFingerprint : AbstractClientIdFingerprint(
|
object LoginActivityOnCreateFingerprint : AbstractClientIdFingerprint(custom@{ methodDef, classDef ->
|
||||||
"LoginActivity;",
|
methodDef.name == "onCreate" && classDef.type.endsWith("LoginActivity;")
|
||||||
"onCreate"
|
})
|
||||||
)
|
|
||||||
@@ -7,8 +7,6 @@ import app.revanced.patcher.data.BytecodeContext
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||||
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
||||||
import app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints.GetHttpBasicAuthHeaderFingerprint
|
import app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints.GetHttpBasicAuthHeaderFingerprint
|
||||||
@@ -25,8 +23,9 @@ class SpoofClientPatch : AbstractSpoofClientPatch(
|
|||||||
Options,
|
Options,
|
||||||
listOf(GetHttpBasicAuthHeaderFingerprint, LoginActivityOnCreateFingerprint)
|
listOf(GetHttpBasicAuthHeaderFingerprint, LoginActivityOnCreateFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult {
|
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
||||||
forEach {
|
forEach {
|
||||||
|
// First is index of the clientId string.
|
||||||
val clientIdIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
val clientIdIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
val oAuthClientIdRegister = getInstruction<OneRegisterInstruction>(clientIdIndex).registerA
|
val oAuthClientIdRegister = getInstruction<OneRegisterInstruction>(clientIdIndex).registerA
|
||||||
@@ -37,8 +36,6 @@ class SpoofClientPatch : AbstractSpoofClientPatch(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package app.revanced.patches.reddit.customclients.joeyforreddit.ads.patch
|
package app.revanced.patches.reddit.customclients.joeyforreddit.ads.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Package
|
import app.revanced.patcher.annotation.Package
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.reddit.customclients.joeyforreddit.ads.fingerprints.IsAdFreeUserFingerprint
|
import app.revanced.patches.reddit.customclients.joeyforreddit.ads.fingerprints.IsAdFreeUserFingerprint
|
||||||
@@ -19,15 +17,13 @@ import app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.
|
|||||||
@DependsOn([DisablePiracyDetectionPatch::class])
|
@DependsOn([DisablePiracyDetectionPatch::class])
|
||||||
@Compatibility([Package("o.o.joey")])
|
@Compatibility([Package("o.o.joey")])
|
||||||
class DisableAdsPatch : BytecodePatch(listOf(IsAdFreeUserFingerprint)) {
|
class DisableAdsPatch : BytecodePatch(listOf(IsAdFreeUserFingerprint)) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
IsAdFreeUserFingerprint.result?.mutableMethod?.addInstructions(
|
IsAdFreeUserFingerprint.result?.mutableMethod?.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
const/4 v0, 0x1
|
const/4 v0, 0x1
|
||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
) ?: return IsAdFreeUserFingerprint.toErrorResult()
|
) ?: throw IsAdFreeUserFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,8 +6,6 @@ import app.revanced.patcher.annotation.Package
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||||
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
||||||
@@ -31,7 +29,7 @@ import app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.
|
|||||||
class SpoofClientPatch : AbstractSpoofClientPatch(
|
class SpoofClientPatch : AbstractSpoofClientPatch(
|
||||||
"https://127.0.0.1:65023/authorize_callback", Options, listOf(GetClientIdFingerprint)
|
"https://127.0.0.1:65023/authorize_callback", Options, listOf(GetClientIdFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult {
|
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
||||||
first().mutableMethod.addInstructions(
|
first().mutableMethod.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
@@ -39,8 +37,6 @@ class SpoofClientPatch : AbstractSpoofClientPatch(
|
|||||||
return-object v0
|
return-object v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
||||||
|
|||||||
@@ -1,22 +1,18 @@
|
|||||||
package app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.patch
|
package app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.fingerprints.PiracyDetectionFingerprint
|
import app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.fingerprints.PiracyDetectionFingerprint
|
||||||
|
|
||||||
class DisablePiracyDetectionPatch : BytecodePatch(listOf(PiracyDetectionFingerprint)) {
|
class DisablePiracyDetectionPatch : BytecodePatch(listOf(PiracyDetectionFingerprint)) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
PiracyDetectionFingerprint.result?.mutableMethod?.addInstruction(
|
PiracyDetectionFingerprint.result?.mutableMethod?.addInstruction(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
return-void
|
return-void
|
||||||
"""
|
"""
|
||||||
) ?: return PiracyDetectionFingerprint.toErrorResult()
|
) ?: throw PiracyDetectionFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,8 +9,6 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult.MethodFingerprintScanResult.StringsScanResult.StringMatch
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult.MethodFingerprintScanResult.StringsScanResult.StringMatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||||
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
||||||
import app.revanced.patches.reddit.customclients.redditisfun.api.fingerprints.BasicAuthorizationFingerprint
|
import app.revanced.patches.reddit.customclients.redditisfun.api.fingerprints.BasicAuthorizationFingerprint
|
||||||
@@ -29,7 +27,7 @@ class SpoofClientPatch : AbstractSpoofClientPatch(
|
|||||||
listOf(BuildAuthorizationStringFingerprint, BasicAuthorizationFingerprint),
|
listOf(BuildAuthorizationStringFingerprint, BasicAuthorizationFingerprint),
|
||||||
listOf(GetUserAgentFingerprint)
|
listOf(GetUserAgentFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult {
|
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
||||||
/**
|
/**
|
||||||
* Replaces a one register instruction with a const-string instruction
|
* Replaces a one register instruction with a const-string instruction
|
||||||
* at the index returned by [getReplacementIndex].
|
* at the index returned by [getReplacementIndex].
|
||||||
@@ -53,11 +51,9 @@ class SpoofClientPatch : AbstractSpoofClientPatch(
|
|||||||
|
|
||||||
// Path basic authorization.
|
// Path basic authorization.
|
||||||
last().replaceWith("$clientId:") { last().index + 7 }
|
last().replaceWith("$clientId:") { last().index + 7 }
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun List<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext): PatchResult {
|
override fun List<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext) {
|
||||||
// Use a random user agent.
|
// Use a random user agent.
|
||||||
val randomName = (0..100000).random()
|
val randomName = (0..100000).random()
|
||||||
val userAgent = "android:app.revanced.$randomName:v1.0.0 (by /u/revanced)"
|
val userAgent = "android:app.revanced.$randomName:v1.0.0 (by /u/revanced)"
|
||||||
@@ -69,8 +65,6 @@ class SpoofClientPatch : AbstractSpoofClientPatch(
|
|||||||
return-object v0
|
return-object v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import app.revanced.patcher.data.BytecodeContext
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||||
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
||||||
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.GetLoggedInBearerTokenFingerprint
|
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.GetLoggedInBearerTokenFingerprint
|
||||||
@@ -32,7 +30,7 @@ class SpoofClientPatch : AbstractSpoofClientPatch(
|
|||||||
GetRefreshTokenFingerprint
|
GetRefreshTokenFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult {
|
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
||||||
forEach {
|
forEach {
|
||||||
val clientIdIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
val clientIdIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
@@ -44,8 +42,6 @@ class SpoofClientPatch : AbstractSpoofClientPatch(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import app.revanced.patcher.annotation.Package
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||||
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
||||||
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint
|
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint
|
||||||
@@ -20,7 +18,7 @@ import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints
|
|||||||
class SpoofClientPatch : AbstractSpoofClientPatch(
|
class SpoofClientPatch : AbstractSpoofClientPatch(
|
||||||
"http://www.ccrama.me", Options, listOf(GetClientIdFingerprint)
|
"http://www.ccrama.me", Options, listOf(GetClientIdFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult {
|
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
||||||
first().mutableMethod.addInstructions(
|
first().mutableMethod.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
@@ -28,8 +26,6 @@ class SpoofClientPatch : AbstractSpoofClientPatch(
|
|||||||
return-object v0
|
return-object v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
package app.revanced.patches.reddit.customclients.syncforreddit.ads.patch
|
package app.revanced.patches.reddit.customclients.syncforreddit.ads.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.*
|
import app.revanced.patcher.annotation.*
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.reddit.customclients.syncforreddit.ads.fingerprints.IsAdsEnabledFingerprint
|
import app.revanced.patches.reddit.customclients.syncforreddit.ads.fingerprints.IsAdsEnabledFingerprint
|
||||||
@@ -17,7 +15,7 @@ import app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.
|
|||||||
@DependsOn([DisablePiracyDetectionPatch::class])
|
@DependsOn([DisablePiracyDetectionPatch::class])
|
||||||
@Compatibility([Package("com.laurencedawson.reddit_sync")])
|
@Compatibility([Package("com.laurencedawson.reddit_sync")])
|
||||||
class DisableAdsPatch : BytecodePatch(listOf(IsAdsEnabledFingerprint)) {
|
class DisableAdsPatch : BytecodePatch(listOf(IsAdsEnabledFingerprint)) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
IsAdsEnabledFingerprint.result?.mutableMethod?.apply {
|
IsAdsEnabledFingerprint.result?.mutableMethod?.apply {
|
||||||
addInstructions(
|
addInstructions(
|
||||||
0,
|
0,
|
||||||
@@ -26,9 +24,7 @@ class DisableAdsPatch : BytecodePatch(listOf(IsAdsEnabledFingerprint)) {
|
|||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
} ?: return IsAdsEnabledFingerprint.toErrorResult()
|
} ?: throw IsAdsEnabledFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7,8 +7,6 @@ import app.revanced.patcher.annotation.Package
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.reddit.customclients.syncforreddit.annoyances.startup.fingerprints.MainActivityOnCreate
|
import app.revanced.patches.reddit.customclients.syncforreddit.annoyances.startup.fingerprints.MainActivityOnCreate
|
||||||
|
|
||||||
@@ -23,13 +21,11 @@ import app.revanced.patches.reddit.customclients.syncforreddit.annoyances.startu
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
class DisableSyncForLemmyBottomSheetPatch : BytecodePatch(listOf(MainActivityOnCreate)) {
|
class DisableSyncForLemmyBottomSheetPatch : BytecodePatch(listOf(MainActivityOnCreate)) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
MainActivityOnCreate.result?.mutableMethod?.apply {
|
MainActivityOnCreate.result?.mutableMethod?.apply {
|
||||||
val showBottomSheetIndex = implementation!!.instructions.lastIndex - 1
|
val showBottomSheetIndex = implementation!!.instructions.lastIndex - 1
|
||||||
|
|
||||||
removeInstruction(showBottomSheetIndex)
|
removeInstruction(showBottomSheetIndex)
|
||||||
}
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package app.revanced.patches.reddit.customclients.syncforreddit.api.patch
|
package app.revanced.patches.reddit.customclients.syncforreddit.api.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Package
|
import app.revanced.patcher.annotation.Package
|
||||||
@@ -10,8 +10,6 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||||
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
||||||
@@ -38,7 +36,7 @@ import java.util.*
|
|||||||
class SpoofClientPatch : AbstractSpoofClientPatch(
|
class SpoofClientPatch : AbstractSpoofClientPatch(
|
||||||
"http://redditsync/auth", Options, listOf(GetAuthorizationStringFingerprint)
|
"http://redditsync/auth", Options, listOf(GetAuthorizationStringFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult {
|
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
||||||
forEach { fingerprintResult ->
|
forEach { fingerprintResult ->
|
||||||
fingerprintResult.also { result ->
|
fingerprintResult.also { result ->
|
||||||
GetBearerTokenFingerprint.also { it.resolve(context, result.classDef) }.result?.mutableMethod?.apply {
|
GetBearerTokenFingerprint.also { it.resolve(context, result.classDef) }.result?.mutableMethod?.apply {
|
||||||
@@ -50,7 +48,7 @@ class SpoofClientPatch : AbstractSpoofClientPatch(
|
|||||||
return-object v0
|
return-object v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
} ?: return GetBearerTokenFingerprint.toErrorResult()
|
} ?: throw GetBearerTokenFingerprint.exception
|
||||||
}.let {
|
}.let {
|
||||||
val occurrenceIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
val occurrenceIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
||||||
|
|
||||||
@@ -71,8 +69,6 @@ class SpoofClientPatch : AbstractSpoofClientPatch(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
||||||
|
|||||||
@@ -4,13 +4,11 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.fingerprints.PiracyDetectionFingerprint
|
import app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.fingerprints.PiracyDetectionFingerprint
|
||||||
|
|
||||||
@Description("Disables detection of modified versions.")
|
@Description("Disables detection of modified versions.")
|
||||||
class DisablePiracyDetectionPatch : BytecodePatch(listOf(PiracyDetectionFingerprint)) {
|
class DisablePiracyDetectionPatch : BytecodePatch(listOf(PiracyDetectionFingerprint)) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
// Do not return an error if the fingerprint is not resolved.
|
// Do not return an error if the fingerprint is not resolved.
|
||||||
// This is fine because new versions of the target app do not need this patch.
|
// This is fine because new versions of the target app do not need this patch.
|
||||||
PiracyDetectionFingerprint.result?.mutableMethod?.apply {
|
PiracyDetectionFingerprint.result?.mutableMethod?.apply {
|
||||||
@@ -21,7 +19,5 @@ class DisablePiracyDetectionPatch : BytecodePatch(listOf(PiracyDetectionFingerpr
|
|||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,11 @@
|
|||||||
package app.revanced.patches.reddit.layout.disablescreenshotpopup.patch
|
package app.revanced.patches.reddit.layout.disablescreenshotpopup.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.reddit.layout.disablescreenshotpopup.annotations.DisableScreenshotPopupCompatibility
|
import app.revanced.patches.reddit.layout.disablescreenshotpopup.annotations.DisableScreenshotPopupCompatibility
|
||||||
import app.revanced.patches.reddit.layout.disablescreenshotpopup.fingerprints.DisableScreenshotPopupFingerprint
|
import app.revanced.patches.reddit.layout.disablescreenshotpopup.fingerprints.DisableScreenshotPopupFingerprint
|
||||||
@@ -19,10 +17,8 @@ import app.revanced.patches.reddit.layout.disablescreenshotpopup.fingerprints.Di
|
|||||||
class DisableScreenshotPopupPatch : BytecodePatch(
|
class DisableScreenshotPopupPatch : BytecodePatch(
|
||||||
listOf(DisableScreenshotPopupFingerprint)
|
listOf(DisableScreenshotPopupFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
DisableScreenshotPopupFingerprint.result?.mutableMethod?.addInstruction(0, "return-void")
|
DisableScreenshotPopupFingerprint.result?.mutableMethod?.addInstruction(0, "return-void")
|
||||||
?: return DisableScreenshotPopupFingerprint.toErrorResult()
|
?: throw DisableScreenshotPopupFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.reddit.layout.premiumicon.annotations.PremiumIconCompatibility
|
import app.revanced.patches.reddit.layout.premiumicon.annotations.PremiumIconCompatibility
|
||||||
import app.revanced.patches.reddit.layout.premiumicon.fingerprints.PremiumIconFingerprint
|
import app.revanced.patches.reddit.layout.premiumicon.fingerprints.PremiumIconFingerprint
|
||||||
@@ -20,7 +18,7 @@ class PremiumIconPatch : BytecodePatch(
|
|||||||
PremiumIconFingerprint
|
PremiumIconFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
val method = PremiumIconFingerprint.result!!.mutableMethod
|
val method = PremiumIconFingerprint.result!!.mutableMethod
|
||||||
method.addInstructions(
|
method.addInstructions(
|
||||||
0,
|
0,
|
||||||
@@ -29,6 +27,5 @@ class PremiumIconPatch : BytecodePatch(
|
|||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package app.revanced.patches.reddit.misc.tracking.url.patch
|
package app.revanced.patches.reddit.misc.tracking.url.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.reddit.misc.tracking.url.annotations.SanitizeUrlQueryCompatibility
|
import app.revanced.patches.reddit.misc.tracking.url.annotations.SanitizeUrlQueryCompatibility
|
||||||
import app.revanced.patches.reddit.misc.tracking.url.fingerprints.ShareLinkFormatterFingerprint
|
import app.revanced.patches.reddit.misc.tracking.url.fingerprints.ShareLinkFormatterFingerprint
|
||||||
@@ -19,14 +17,12 @@ import app.revanced.patches.reddit.misc.tracking.url.fingerprints.ShareLinkForma
|
|||||||
class SanitizeUrlQueryPatch : BytecodePatch(
|
class SanitizeUrlQueryPatch : BytecodePatch(
|
||||||
listOf(ShareLinkFormatterFingerprint)
|
listOf(ShareLinkFormatterFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
|
|
||||||
ShareLinkFormatterFingerprint.result?.mutableMethod?.addInstructions(
|
ShareLinkFormatterFingerprint.result?.mutableMethod?.addInstructions(
|
||||||
0,
|
0,
|
||||||
"return-object p0"
|
"return-object p0"
|
||||||
) ?: return ShareLinkFormatterFingerprint.toErrorResult()
|
) ?: throw ShareLinkFormatterFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.scbeasy.detection.debugging.annotations.RemoveDebuggingDetectionCompatibility
|
import app.revanced.patches.scbeasy.detection.debugging.annotations.RemoveDebuggingDetectionCompatibility
|
||||||
import app.revanced.patches.scbeasy.detection.debugging.fingerprints.DebuggingDetectionFingerprint
|
import app.revanced.patches.scbeasy.detection.debugging.fingerprints.DebuggingDetectionFingerprint
|
||||||
@@ -18,7 +16,7 @@ import app.revanced.patches.scbeasy.detection.debugging.fingerprints.DebuggingDe
|
|||||||
class RemoveDebuggingDetectionPatch : BytecodePatch(
|
class RemoveDebuggingDetectionPatch : BytecodePatch(
|
||||||
listOf(DebuggingDetectionFingerprint)
|
listOf(DebuggingDetectionFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
DebuggingDetectionFingerprint.result!!.mutableMethod.addInstructions(
|
DebuggingDetectionFingerprint.result!!.mutableMethod.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
@@ -26,6 +24,5 @@ class RemoveDebuggingDetectionPatch : BytecodePatch(
|
|||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package app.revanced.patches.shared.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
object LayoutConstructorFingerprint : MethodFingerprint(
|
||||||
|
returnType = "V",
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
parameters = emptyList(),
|
||||||
|
strings = listOf("1.0x")
|
||||||
|
)
|
||||||
@@ -5,9 +5,7 @@ import app.revanced.patcher.data.BytecodeContext
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchException
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patches.shared.integrations.patch.AbstractIntegrationsPatch.IntegrationsFingerprint.RegisterResolver
|
import app.revanced.patches.shared.integrations.patch.AbstractIntegrationsPatch.IntegrationsFingerprint.RegisterResolver
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
import com.android.tools.smali.dexlib2.iface.ClassDef
|
import com.android.tools.smali.dexlib2.iface.ClassDef
|
||||||
@@ -40,7 +38,7 @@ abstract class AbstractIntegrationsPatch(
|
|||||||
strings,
|
strings,
|
||||||
customFingerprint
|
customFingerprint
|
||||||
) {
|
) {
|
||||||
fun invoke(integrationsDescriptor: String): PatchResult {
|
fun invoke(integrationsDescriptor: String) {
|
||||||
result?.mutableMethod?.let { method ->
|
result?.mutableMethod?.let { method ->
|
||||||
val contextRegister = contextRegisterResolver(method)
|
val contextRegister = contextRegisterResolver(method)
|
||||||
|
|
||||||
@@ -49,9 +47,7 @@ abstract class AbstractIntegrationsPatch(
|
|||||||
"sput-object v$contextRegister, " +
|
"sput-object v$contextRegister, " +
|
||||||
"$integrationsDescriptor->context:Landroid/content/Context;"
|
"$integrationsDescriptor->context:Landroid/content/Context;"
|
||||||
)
|
)
|
||||||
} ?: return PatchResultError("Could not find hook target fingerprint.")
|
} ?: throw PatchException("Could not find hook target fingerprint.")
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RegisterResolver : (Method) -> Int {
|
interface RegisterResolver : (Method) -> Int {
|
||||||
@@ -59,20 +55,11 @@ abstract class AbstractIntegrationsPatch(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
if (context.findClass(integrationsDescriptor) == null) return MISSING_INTEGRATIONS
|
if (context.findClass(integrationsDescriptor) == null) throw PatchException(
|
||||||
|
"Integrations have not been merged yet. This patch can not succeed without merging the integrations."
|
||||||
for (hook in hooks) hook.invoke(integrationsDescriptor).let {
|
|
||||||
if (it is PatchResultError) return it
|
|
||||||
}
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
|
|
||||||
private companion object {
|
|
||||||
val MISSING_INTEGRATIONS = PatchResultError(
|
|
||||||
"Integrations have not been merged yet. " +
|
|
||||||
"This patch can not succeed without merging the integrations."
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for (hook in hooks) hook.invoke(integrationsDescriptor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
package app.revanced.patches.shared.mapping.misc.patch
|
package app.revanced.patches.shared.mapping.misc.patch
|
||||||
|
|
||||||
import app.revanced.patcher.data.ResourceContext
|
import app.revanced.patcher.data.ResourceContext
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.ResourcePatch
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
import org.w3c.dom.Element
|
import org.w3c.dom.Element
|
||||||
import java.util.*
|
import java.util.*
|
||||||
@@ -19,7 +17,7 @@ class ResourceMappingPatch : ResourcePatch {
|
|||||||
private val threadPoolExecutor = Executors.newFixedThreadPool(THREAD_COUNT)
|
private val threadPoolExecutor = Executors.newFixedThreadPool(THREAD_COUNT)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext) {
|
||||||
// save the file in memory to concurrently read from
|
// save the file in memory to concurrently read from
|
||||||
val resourceXmlFile = context["res/values/public.xml"].readBytes()
|
val resourceXmlFile = context["res/values/public.xml"].readBytes()
|
||||||
|
|
||||||
@@ -59,8 +57,6 @@ class ResourceMappingPatch : ResourcePatch {
|
|||||||
.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS)
|
.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS)
|
||||||
|
|
||||||
resourceMappings = mappings
|
resourceMappings = mappings
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package app.revanced.patches.shared.misc.fix.verticalscroll.patch
|
package app.revanced.patches.shared.misc.fix.verticalscroll.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patches.shared.misc.fix.verticalscroll.annotations.VerticalScrollCompatibility
|
import app.revanced.patches.shared.misc.fix.verticalscroll.annotations.VerticalScrollCompatibility
|
||||||
import app.revanced.patches.shared.misc.fix.verticalscroll.fingerprints.CanScrollVerticallyFingerprint
|
import app.revanced.patches.shared.misc.fix.verticalscroll.fingerprints.CanScrollVerticallyFingerprint
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
@@ -17,7 +15,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
class VerticalScrollPatch : BytecodePatch(
|
class VerticalScrollPatch : BytecodePatch(
|
||||||
listOf(CanScrollVerticallyFingerprint)
|
listOf(CanScrollVerticallyFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
CanScrollVerticallyFingerprint.result?.let {
|
CanScrollVerticallyFingerprint.result?.let {
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
val moveResultIndex = it.scanResult.patternScanResult!!.endIndex
|
val moveResultIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
@@ -29,8 +27,6 @@ class VerticalScrollPatch : BytecodePatch(
|
|||||||
"const/4 v$moveResultRegister, 0x0"
|
"const/4 v$moveResultRegister, 0x0"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} ?: return CanScrollVerticallyFingerprint.toErrorResult()
|
} ?: throw CanScrollVerticallyFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
package app.revanced.patches.shared.settings.resource.patch
|
package app.revanced.patches.shared.settings.resource.patch
|
||||||
|
|
||||||
import app.revanced.patcher.data.DomFileEditor
|
|
||||||
import app.revanced.patcher.data.ResourceContext
|
import app.revanced.patcher.data.ResourceContext
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.ResourcePatch
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
|
import app.revanced.patcher.util.DomFileEditor
|
||||||
import app.revanced.patches.shared.settings.preference.BasePreference
|
import app.revanced.patches.shared.settings.preference.BasePreference
|
||||||
import app.revanced.patches.shared.settings.preference.BaseResource
|
import app.revanced.patches.shared.settings.preference.BaseResource
|
||||||
import app.revanced.patches.shared.settings.preference.addPreference
|
import app.revanced.patches.shared.settings.preference.addPreference
|
||||||
@@ -26,7 +24,7 @@ abstract class AbstractSettingsResourcePatch(
|
|||||||
private val preferenceFileName: String,
|
private val preferenceFileName: String,
|
||||||
private val sourceDirectory: String,
|
private val sourceDirectory: String,
|
||||||
) : ResourcePatch, Closeable {
|
) : ResourcePatch, Closeable {
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext) {
|
||||||
/*
|
/*
|
||||||
* used for self-restart
|
* used for self-restart
|
||||||
* TODO: do this only, when necessary
|
* TODO: do this only, when necessary
|
||||||
@@ -51,8 +49,6 @@ abstract class AbstractSettingsResourcePatch(
|
|||||||
stringsEditor = context.xmlEditor["res/values/strings.xml"]
|
stringsEditor = context.xmlEditor["res/values/strings.xml"]
|
||||||
arraysEditor = context.xmlEditor["res/values/arrays.xml"]
|
arraysEditor = context.xmlEditor["res/values/arrays.xml"]
|
||||||
revancedPreferencesEditor = context.xmlEditor["res/xml/$preferenceFileName.xml"]
|
revancedPreferencesEditor = context.xmlEditor["res/xml/$preferenceFileName.xml"]
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal companion object {
|
internal companion object {
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package app.revanced.patches.solidexplorer2.functionality.filesize.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
object OnReadyFingerprint : MethodFingerprint(
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.CONST_WIDE_32, // Constant storing the 2MB limit
|
||||||
|
Opcode.CMP_LONG,
|
||||||
|
Opcode.IF_LEZ,
|
||||||
|
),
|
||||||
|
customFingerprint = { methodDef, _ ->
|
||||||
|
methodDef.definingClass == "Lpl/solidexplorer/plugins/texteditor/TextEditor;" && methodDef.name == "onReady"
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package app.revanced.patches.solidexplorer2.functionality.filesize.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.exception
|
||||||
|
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.getInstruction
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.solidexplorer2.functionality.filesize.fingerprints.OnReadyFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.iface.instruction.ThreeRegisterInstruction
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("Remove file size limit")
|
||||||
|
@Description("Allows opening files larger than 2 MB in the text editor.")
|
||||||
|
@Compatibility([Package("pl.solidexplorer2")])
|
||||||
|
class RemoveFileSizeLimitPatch : BytecodePatch(listOf(OnReadyFingerprint)) {
|
||||||
|
override fun execute(context: BytecodeContext) = OnReadyFingerprint.result?.let { result ->
|
||||||
|
val cmpIndex = result.scanResult.patternScanResult!!.startIndex + 1
|
||||||
|
val cmpResultRegister = result.mutableMethod.getInstruction<ThreeRegisterInstruction>(cmpIndex).registerA
|
||||||
|
|
||||||
|
result.mutableMethod.replaceInstruction(cmpIndex, "const/4 v${cmpResultRegister}, 0x0")
|
||||||
|
} ?: throw OnReadyFingerprint.exception
|
||||||
|
}
|
||||||
@@ -1,14 +1,12 @@
|
|||||||
package app.revanced.patches.songpal.badge.patch
|
package app.revanced.patches.songpal.badge.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.songpal.badge.annotations.BadgeCompatibility
|
import app.revanced.patches.songpal.badge.annotations.BadgeCompatibility
|
||||||
import app.revanced.patches.songpal.badge.fingerprints.CreateTabsFingerprint
|
import app.revanced.patches.songpal.badge.fingerprints.CreateTabsFingerprint
|
||||||
@@ -20,7 +18,7 @@ import app.revanced.patches.songpal.badge.fingerprints.CreateTabsFingerprint
|
|||||||
class BadgeTabPatch : BytecodePatch(
|
class BadgeTabPatch : BytecodePatch(
|
||||||
listOf(CreateTabsFingerprint)
|
listOf(CreateTabsFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext) {
|
||||||
CreateTabsFingerprint.result?.mutableMethod?.apply {
|
CreateTabsFingerprint.result?.mutableMethod?.apply {
|
||||||
removeInstructions(0, 2)
|
removeInstructions(0, 2)
|
||||||
|
|
||||||
@@ -52,9 +50,7 @@ class BadgeTabPatch : BytecodePatch(
|
|||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
} ?: return CreateTabsFingerprint.toErrorResult()
|
} ?: throw CreateTabsFingerprint.exception
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user