forked from inotia00/revanced-patches
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(YouTube/YT Music - GmsCore support): unimplemented service in Gms…
…Core causes memory leak
- Loading branch information
Showing
8 changed files
with
115 additions
and
44 deletions.
There are no files selected for viewing
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
7 changes: 0 additions & 7 deletions
7
...main/kotlin/app/revanced/patches/shared/gms/fingerprints/CastDynamiteModuleFingerprint.kt
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...in/kotlin/app/revanced/patches/shared/gms/fingerprints/CastDynamiteModuleV2Fingerprint.kt
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
src/main/kotlin/app/revanced/patches/shared/gms/fingerprints/GmsServiceBrokerFingerprint.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package app.revanced.patches.shared.gms.fingerprints | ||
|
||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
|
||
internal object GmsServiceBrokerFingerprint : MethodFingerprint( | ||
returnType = "V", | ||
strings = listOf("mServiceBroker is null, client disconnected") | ||
) |
7 changes: 0 additions & 7 deletions
7
src/main/kotlin/app/revanced/patches/shared/gms/fingerprints/PrimeMethodFingerprint.kt
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
src/main/kotlin/app/revanced/patches/shared/gms/fingerprints/PrimesApiFingerprint.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package app.revanced.patches.shared.gms.fingerprints | ||
|
||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
import com.android.tools.smali.dexlib2.util.MethodUtil | ||
|
||
internal object PrimesApiFingerprint : MethodFingerprint( | ||
returnType = "V", | ||
strings = listOf("PrimesApiImpl.java"), | ||
customFingerprint = { methodDef, _ -> | ||
MethodUtil.isConstructor(methodDef) | ||
} | ||
) |
18 changes: 18 additions & 0 deletions
18
...app/revanced/patches/shared/gms/fingerprints/PrimesBackgroundInitializationFingerprint.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package app.revanced.patches.shared.gms.fingerprints | ||
|
||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
import app.revanced.util.getReference | ||
import app.revanced.util.indexOfFirstInstruction | ||
import com.android.tools.smali.dexlib2.Opcode | ||
import com.android.tools.smali.dexlib2.iface.reference.StringReference | ||
|
||
internal object PrimesBackgroundInitializationFingerprint : MethodFingerprint( | ||
opcodes = listOf(Opcode.NEW_INSTANCE), | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.indexOfFirstInstruction { | ||
opcode == Opcode.CONST_STRING && | ||
getReference<StringReference>() | ||
?.string.toString().startsWith("Primes init triggered from background in package:") | ||
} >= 0 | ||
} | ||
) |
23 changes: 23 additions & 0 deletions
23
...in/kotlin/app/revanced/patches/shared/gms/fingerprints/PrimesLifecycleEventFingerprint.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package app.revanced.patches.shared.gms.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
import app.revanced.util.getReference | ||
import app.revanced.util.indexOfFirstInstruction | ||
import com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
import com.android.tools.smali.dexlib2.iface.reference.StringReference | ||
|
||
internal object PrimesLifecycleEventFingerprint : MethodFingerprint( | ||
returnType = "V", | ||
accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL, | ||
parameters = emptyList(), | ||
opcodes = listOf(Opcode.NEW_INSTANCE), | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.indexOfFirstInstruction { | ||
opcode == Opcode.CONST_STRING && | ||
getReference<StringReference>() | ||
?.string.toString().startsWith("Primes did not observe lifecycle events in the expected order.") | ||
} >= 0 | ||
} | ||
) |