generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Infinity for Reddit - Spoof client): Support latest version
- Loading branch information
Showing
4 changed files
with
18 additions
and
16 deletions.
There are no files selected for viewing
21 changes: 13 additions & 8 deletions
21
...es/reddit/customclients/infinityforreddit/api/fingerprints/AbstractClientIdFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
5 changes: 1 addition & 4 deletions
5
...dit/customclients/infinityforreddit/api/fingerprints/GetHttpBasicAuthHeaderFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
package app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints | ||
|
||
object GetHttpBasicAuthHeaderFingerprint : AbstractClientIdFingerprint( | ||
"APIUtils;", | ||
"getHttpBasicAuthHeader" | ||
) | ||
object GetHttpBasicAuthHeaderFingerprint : AbstractClientIdFingerprint(additionalStrings = arrayOf("Authorization")) |
7 changes: 3 additions & 4 deletions
7
...ddit/customclients/infinityforreddit/api/fingerprints/LoginActivityOnCreateFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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;") | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters