diff --git a/src/main/kotlin/app/revanced/patches/youtube/navigation/homepage/ChangeHomePagePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/navigation/homepage/ChangeHomePagePatch.kt deleted file mode 100644 index 89971afab..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/navigation/homepage/ChangeHomePagePatch.kt +++ /dev/null @@ -1,96 +0,0 @@ -package app.revanced.patches.youtube.navigation.homepage - -import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.InstructionExtensions.addInstructions -import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels -import app.revanced.patcher.extensions.InstructionExtensions.getInstruction -import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.annotation.CompatiblePackage -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patcher.util.smali.ExternalLabel -import app.revanced.patches.youtube.navigation.homepage.fingerprints.IntentExceptionFingerprint -import app.revanced.patches.youtube.navigation.homepage.fingerprints.LauncherActivityFingerprint -import app.revanced.patches.youtube.utils.integrations.Constants.NAVIGATION -import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.exception - -@Patch( - name = "Change homepage", - description = "Change home page to subscription feed.", - dependencies = [SettingsPatch::class], - compatiblePackages = [ - CompatiblePackage( - "com.google.android.youtube", - [ - "18.25.40", - "18.27.36", - "18.29.38", - "18.30.37", - "18.31.40", - "18.32.39", - "18.33.40", - "18.34.38", - "18.35.36", - "18.36.39", - "18.37.36", - "18.38.44", - "18.39.41", - "18.40.34", - "18.41.39", - "18.42.41", - "18.43.45", - "18.44.41", - "18.45.43" - ] - ) - ] -) -@Suppress("unused") -object ChangeHomePagePatch : BytecodePatch( - setOf( - IntentExceptionFingerprint, - LauncherActivityFingerprint - ) -) { - override fun execute(context: BytecodeContext) { - - LauncherActivityFingerprint.result?.let { - it.mutableMethod.apply { - addInstructions( - implementation!!.instructions.size - 1, """ - move-object/from16 v0, p1 - invoke-static {v0}, $NAVIGATION->changeHomePage(Landroid/app/Activity;)V - """ - ) - } - } ?: throw LauncherActivityFingerprint.exception - - IntentExceptionFingerprint.result?.let { - it.mutableMethod.apply { - val index = it.scanResult.patternScanResult!!.endIndex + 1 - - addInstructionsWithLabels( - index, """ - invoke-static {}, $NAVIGATION->changeHomePage()Z - move-result v0 - if-eqz v0, :default - return-void - """, ExternalLabel("default", getInstruction(index)) - ) - } - } ?: throw IntentExceptionFingerprint.exception - - /** - * Add settings - */ - SettingsPatch.addPreference( - arrayOf( - "PREFERENCE: NAVIGATION_SETTINGS", - "SETTINGS: CHANGE_HOMEPAGE_TO_SUBSCRIPTION" - ) - ) - - SettingsPatch.updatePatchStatus("Change homepage") - - } -} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/navigation/homepage/fingerprints/IntentExceptionFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/navigation/homepage/fingerprints/IntentExceptionFingerprint.kt deleted file mode 100644 index 3faf216c2..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/navigation/homepage/fingerprints/IntentExceptionFingerprint.kt +++ /dev/null @@ -1,11 +0,0 @@ -package app.revanced.patches.youtube.navigation.homepage.fingerprints - -import app.revanced.patcher.fingerprint.MethodFingerprint -import com.android.tools.smali.dexlib2.Opcode - -object IntentExceptionFingerprint : MethodFingerprint( - returnType = "V", - parameters = listOf("L", "L"), - opcodes = listOf(Opcode.MOVE_EXCEPTION), - strings = listOf("Failed to resolve intent") -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/navigation/homepage/fingerprints/LauncherActivityFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/navigation/homepage/fingerprints/LauncherActivityFingerprint.kt deleted file mode 100644 index 7cd805a95..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/navigation/homepage/fingerprints/LauncherActivityFingerprint.kt +++ /dev/null @@ -1,8 +0,0 @@ -package app.revanced.patches.youtube.navigation.homepage.fingerprints - -import app.revanced.patcher.fingerprint.MethodFingerprint - -object LauncherActivityFingerprint : MethodFingerprint( - returnType = "V", - strings = listOf("forLauncherActivity", "Launcher config used on invalid activity: %s") -) \ No newline at end of file diff --git a/src/main/resources/youtube/settings/host/values/strings.xml b/src/main/resources/youtube/settings/host/values/strings.xml index fe73e5624..7e3009b03 100644 --- a/src/main/resources/youtube/settings/host/values/strings.xml +++ b/src/main/resources/youtube/settings/host/values/strings.xml @@ -55,9 +55,6 @@ Tap here to learn more about DeArrow." Ambient mode is disabled in battery saver mode. Ambient mode is enabled in battery saver mode. Bypass ambient mode restrictions - Current homepage: Home. - Current homepage: Subscriptions. - Change homepage to subscriptions Default Explore History diff --git a/src/main/resources/youtube/settings/xml/revanced_prefs.xml b/src/main/resources/youtube/settings/xml/revanced_prefs.xml index 0e2b47c78..79213634e 100644 --- a/src/main/resources/youtube/settings/xml/revanced_prefs.xml +++ b/src/main/resources/youtube/settings/xml/revanced_prefs.xml @@ -439,7 +439,6 @@ - @@ -511,9 +510,6 @@ PREFERENCE: NAVIGATION_SETTINGS --> - -