-
-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Google News): Add Google News Patches, CustomTabs and GMSCore Integration #3111
base: dev
Are you sure you want to change the base?
Conversation
depends on this pullrequest in revanced-integrations: otherwise i get an error in the onCreate method of StartActivity |
...in/kotlin/app/revanced/patches/magazines/customtabs/fingerprints/UseCustomTabsFingerprint.kt
Show resolved
Hide resolved
...in/kotlin/app/revanced/patches/magazines/customtabs/fingerprints/UseCustomTabsFingerprint.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/app/revanced/patches/magazines/misc/gms/ClientSpoofPatch.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/app/revanced/patches/magazines/misc/gms/ClientSpoofPatch.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/app/revanced/patches/magazines/misc/gms/ClientSpoofPatch.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/app/revanced/patches/magazines/misc/gms/GmsCoreSupportPatch.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/app/revanced/patches/magazines/misc/gms/GmsCoreSupportPatch.kt
Outdated
Show resolved
Hide resolved
...pp/revanced/patches/magazines/misc/integrations/fingerprints/StartActivityInitFingerprint.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/app/revanced/patches/shared/misc/gms/BaseGmsCoreSupportPatch.kt
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,26 @@ | |||
package app.revanced.patches.magazines.misc.customtabs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably better to move the package from magazines to "googlenews". I was thinking about moving everything under the respective app's package, so for YouTube, the patches would be in: app.revanced.patches.com.google.android.youtube
. For now, naming it "googlenews" is conventional with how we named the other packages.
Opcode.IPUT_BOOLEAN | ||
), | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.definingClass == "Lcom/google/apps/dots/android/modules/reading/customtabs/CustomTabsArticleLauncher;" && methodDef.accessFlags == AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably an .endsWith() check is simpler here.
Opcode.IPUT_BOOLEAN | ||
), | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.definingClass == "Lcom/google/apps/dots/android/modules/reading/customtabs/CustomTabsArticleLauncher;" && methodDef.accessFlags == AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AccessFlags is a field in MethodFingerprint. Use that.
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
import com.android.tools.smali.dexlib2.AccessFlags | ||
|
||
internal object GooglePlayUtilityFingerprint : MethodFingerprint( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fingerprint looks similar to another. Might remove one and move the other to a shared location under app.revanced.patches package similar to other shared fingerprints. The fingerprint can then be used in both patches.
Opcode.MOVE_RESULT_OBJECT, // move-result-object v2 | ||
), | ||
insertIndexResolver = { method -> | ||
instructions = method.toMutable().getInstructions() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A toMutabe call should not be necessary. You can simply get the methods instructions via method.implementation.instructions
import com.android.tools.smali.dexlib2.iface.instruction.Instruction | ||
|
||
private var index: Int = -1 | ||
private var instructions: List<Instruction> = listOf() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field is not necessary. contextRegisterResolver has a reference to the method.
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable | ||
import com.android.tools.smali.dexlib2.iface.instruction.Instruction | ||
|
||
private var index: Int = -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this field into the fingerprint object.
This Patch implements CustomTabs in Google News (com.google.android.apps.magazines).
This sets a flag that is otherwise false to true -> Instead of opening articles in ChromeWebView it uses the Default Browser
This also implements Basic GMSCore Support.
Login and Logout works.
Clicking on "Manager your Google Account" doesn't open the GMSCore settings -> same problem as in Youtube.