@@ -18,7 +18,7 @@ import app.revanced.patches.shared.misc.gms.fingerprints.GooglePlayUtilityFinger
1818import app.revanced.patches.shared.misc.gms.fingerprints.ServiceCheckFingerprint
1919import app.revanced.util.exception
2020import app.revanced.util.getReference
21- import app.revanced.util.indexOfFirstInstructionOrThrow
21+ import app.revanced.util.indexOfFirstInstruction
2222import app.revanced.util.returnEarly
2323import com.android.tools.smali.dexlib2.Opcode
2424import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction21c
@@ -115,15 +115,16 @@ abstract class BaseGmsCoreSupportPatch(
115115
116116 // Verify GmsCore is installed and whitelisted for power optimizations and background usage.
117117 mainActivityOnCreateFingerprint.result?.mutableMethod?.apply {
118- val setContextIndex = indexOfFirstInstructionOrThrow {
119- val reference = getReference<MethodReference >() ? : return @indexOfFirstInstructionOrThrow false
118+ // Temporary fix for Google photos integration.
119+ var setContextIndex = indexOfFirstInstruction {
120+ val reference = getReference<MethodReference >() ? : return @indexOfFirstInstruction false
120121
121122 reference.toString() == " Lapp/revanced/integrations/shared/Utils;->setContext(Landroid/content/Context;)V"
122123 }
123124
124125 // Add after setContext call, because this patch needs the context.
125126 addInstructions(
126- setContextIndex + 1 ,
127+ if (setContextIndex < 0 ) 0 else setContextIndex + 1 ,
127128 " invoke-static/range { p0 .. p0 }, Lapp/revanced/integrations/shared/GmsCoreSupport;->" +
128129 " checkGmsCore(Landroid/app/Activity;)V" ,
129130 )
0 commit comments