chore: merge branch dev to main (#2893)

This commit is contained in:
oSumAtrIX 2023-09-03 05:40:57 +02:00 committed by GitHub
commit 0d49450096
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 137 additions and 60 deletions

View File

@ -1,3 +1,24 @@
# [2.190.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v2.190.0-dev.2...v2.190.0-dev.3) (2023-09-02)
### Features
* **Twitch:** Support version `16.1.0` ([#2923](https://github.com/ReVanced/revanced-patches/issues/2923)) ([d9834a9](https://github.com/ReVanced/revanced-patches/commit/d9834a9abb43390af4cb33f5dd5a0e2d3b7060e2))
# [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)

View File

@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
kotlin.code.style = official
version = 2.189.0
version = 2.190.0-dev.3

File diff suppressed because one or more lines are too long

View File

@ -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()
)

View File

@ -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
}

View File

@ -1,19 +1,11 @@
package app.revanced.patches.photomath.detection.signature.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 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(
"packageInfo.signatures",
"currentSignature"
),
opcodes = listOf(

View File

@ -23,5 +23,4 @@ class SignatureDetectionPatch : BytecodePatch(
mutableMethod.replaceInstruction(signatureCheckInstruction.location.index, "const/4 v$checkRegister, 0x1")
} ?: throw CheckSignatureFingerprint.exception
}
}

View File

@ -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"
)
)

View File

@ -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
}

View File

@ -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

View File

@ -1,37 +1,30 @@
package app.revanced.patches.photomath.misc.unlockplus.patch
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.Package
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
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.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
@Patch
@Name("Unlock plus")
@DependsOn([SignatureDetectionPatch::class])
@Description("Unlocks plus features.")
@UnlockPlusCompatibilty
@DependsOn([SignatureDetectionPatch::class, EnableBookpointPatch::class])
@Compatibility([Package("com.microblink.photomath")])
class UnlockPlusPatch : BytecodePatch(
listOf(
IsPlusUnlockedFingerprint
)
listOf(IsPlusUnlockedFingerprint)
) {
override fun execute(context: BytecodeContext) {
IsPlusUnlockedFingerprint.result?.mutableMethod?.apply {
addInstructions(
0,
"""
const/4 v0, 0x1
return v0
"""
)
} ?: throw IsPlusUnlockedFingerprint.exception
}
override fun execute(context: BytecodeContext) = IsPlusUnlockedFingerprint.result?.mutableMethod?.addInstructions(
0,
"""
const/4 v0, 0x1
return v0
"""
) ?: throw IsPlusUnlockedFingerprint.exception
}

View File

@ -1,12 +1,17 @@
package app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints
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"),
customFingerprint = custom@{ methodDef, classDef ->
if (!classDef.type.endsWith(classTypeSuffix)) return@custom false
methodDef.name == methodName
}
)
/**
* Fingerprint for a method that has the client id hardcoded in it.
* The first string in the fingerprint is the client id.
*
* @param customFingerprint A custom fingerprint.
* @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)

View File

@ -1,6 +1,3 @@
package app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints
object GetHttpBasicAuthHeaderFingerprint : AbstractClientIdFingerprint(
"APIUtils;",
"getHttpBasicAuthHeader"
)
object GetHttpBasicAuthHeaderFingerprint : AbstractClientIdFingerprint(additionalStrings = arrayOf("Authorization"))

View File

@ -1,6 +1,5 @@
package app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints
object LoginActivityOnCreateFingerprint : AbstractClientIdFingerprint(
"LoginActivity;",
"onCreate"
)
object LoginActivityOnCreateFingerprint : AbstractClientIdFingerprint(custom@{ methodDef, classDef ->
methodDef.name == "onCreate" && classDef.type.endsWith("LoginActivity;")
})

View File

@ -25,6 +25,7 @@ class SpoofClientPatch : AbstractSpoofClientPatch(
) {
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
forEach {
// First is index of the clientId string.
val clientIdIndex = it.scanResult.stringsScanResult!!.matches.first().index
it.mutableMethod.apply {
val oAuthClientIdRegister = getInstruction<OneRegisterInstruction>(clientIdIndex).registerA

View File

@ -3,7 +3,7 @@ package app.revanced.patches.twitch.ad.embedded.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("tv.twitch.android.app", arrayOf("15.4.1"))])
@Compatibility([Package("tv.twitch.android.app", arrayOf("15.4.1", "16.1.0"))])
@Target(AnnotationTarget.CLASS)
internal annotation class EmbeddedAdsCompatibility

View File

@ -3,7 +3,7 @@ package app.revanced.patches.twitch.ad.video.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("tv.twitch.android.app", arrayOf("15.4.1"))])
@Compatibility([Package("tv.twitch.android.app", arrayOf("15.4.1", "16.1.0"))])
@Target(AnnotationTarget.CLASS)
internal annotation class VideoAdsCompatibility

View File

@ -3,7 +3,7 @@ package app.revanced.patches.twitch.chat.antidelete.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("tv.twitch.android.app", arrayOf("15.4.1"))])
@Compatibility([Package("tv.twitch.android.app", arrayOf("15.4.1", "16.1.0"))])
@Target(AnnotationTarget.CLASS)
internal annotation class ShowDeletedMessagesCompatibility

View File

@ -3,6 +3,6 @@ package app.revanced.patches.twitch.chat.autoclaim.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("tv.twitch.android.app", arrayOf("15.4.1"))])
@Compatibility([Package("tv.twitch.android.app", arrayOf("15.4.1", "16.1.0"))])
@Target(AnnotationTarget.CLASS)
internal annotation class AutoClaimChannelPointsCompatibility