fix: organize imports

This commit is contained in:
LisoUseInAIKyrios 2024-03-04 21:01:28 +04:00
parent 014885443c
commit ab0af3ec57

View File

@ -8,7 +8,13 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
import app.revanced.patches.youtube.layout.hide.shorts.fingerprints.* import app.revanced.patches.youtube.layout.hide.shorts.fingerprints.BottomNavigationBarFingerprint
import app.revanced.patches.youtube.layout.hide.shorts.fingerprints.CreateShortsButtonsFingerprint
import app.revanced.patches.youtube.layout.hide.shorts.fingerprints.ReelConstructorFingerprint
import app.revanced.patches.youtube.layout.hide.shorts.fingerprints.RenderBottomNavigationBarFingerprint
import app.revanced.patches.youtube.layout.hide.shorts.fingerprints.RenderBottomNavigationBarParentFingerprint
import app.revanced.patches.youtube.layout.hide.shorts.fingerprints.SetPivotBarVisibilityFingerprint
import app.revanced.patches.youtube.layout.hide.shorts.fingerprints.SetPivotBarVisibilityParentFingerprint
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
import app.revanced.util.exception import app.revanced.util.exception
@ -25,7 +31,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
IntegrationsPatch::class, IntegrationsPatch::class,
LithoFilterPatch::class, LithoFilterPatch::class,
HideShortsComponentsResourcePatch::class, HideShortsComponentsResourcePatch::class,
ResourceMappingPatch::class, ResourceMappingPatch::class
], ],
compatiblePackages = [ compatiblePackages = [
CompatiblePackage( CompatiblePackage(
@ -43,10 +49,10 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"19.02.39", "19.02.39",
"19.03.35", "19.03.35",
"19.03.36", "19.03.36",
"19.04.37", "19.04.37"
], ]
), )
], ]
) )
@Suppress("unused") @Suppress("unused")
object HideShortsComponentsPatch : BytecodePatch( object HideShortsComponentsPatch : BytecodePatch(
@ -55,8 +61,8 @@ object HideShortsComponentsPatch : BytecodePatch(
ReelConstructorFingerprint, ReelConstructorFingerprint,
BottomNavigationBarFingerprint, BottomNavigationBarFingerprint,
RenderBottomNavigationBarParentFingerprint, RenderBottomNavigationBarParentFingerprint,
SetPivotBarVisibilityParentFingerprint, SetPivotBarVisibilityParentFingerprint
), )
) { ) {
private const val FILTER_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/components/ShortsFilter;" private const val FILTER_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/components/ShortsFilter;"
@ -74,7 +80,7 @@ object HideShortsComponentsPatch : BytecodePatch(
insertIndex, insertIndex,
viewRegister, viewRegister,
FILTER_CLASS_DESCRIPTOR, FILTER_CLASS_DESCRIPTOR,
"hideShortsShelf", "hideShortsShelf"
) )
} }
} // Do not throw an exception if not resolved. } // Do not throw an exception if not resolved.
@ -111,7 +117,7 @@ object HideShortsComponentsPatch : BytecodePatch(
addInstruction( addInstruction(
insertIndex, insertIndex,
"sput-object v$viewRegister, $FILTER_CLASS_DESCRIPTOR->pivotBar:" + "sput-object v$viewRegister, $FILTER_CLASS_DESCRIPTOR->pivotBar:" +
"Lcom/google/android/libraries/youtube/rendering/ui/pivotbar/PivotBar;", "Lcom/google/android/libraries/youtube/rendering/ui/pivotbar/PivotBar;"
) )
} }
} }
@ -138,7 +144,7 @@ object HideShortsComponentsPatch : BytecodePatch(
addInstruction( addInstruction(
insertIndex, insertIndex,
"invoke-static { v$viewRegister }, $FILTER_CLASS_DESCRIPTOR->" + "invoke-static { v$viewRegister }, $FILTER_CLASS_DESCRIPTOR->" +
"hideNavigationBar(Landroid/view/View;)Landroid/view/View;", "hideNavigationBar(Landroid/view/View;)Landroid/view/View;"
) )
} }
} ?: throw BottomNavigationBarFingerprint.exception } ?: throw BottomNavigationBarFingerprint.exception
@ -149,7 +155,7 @@ object HideShortsComponentsPatch : BytecodePatch(
private enum class ShortsButtons(private val resourceName: String, private val methodName: String) { private enum class ShortsButtons(private val resourceName: String, private val methodName: String) {
COMMENTS("reel_dyn_comment", "hideShortsCommentsButton"), COMMENTS("reel_dyn_comment", "hideShortsCommentsButton"),
REMIX("reel_dyn_remix", "hideShortsRemixButton"), REMIX("reel_dyn_remix", "hideShortsRemixButton"),
SHARE("reel_dyn_share", "hideShortsShareButton"), SHARE("reel_dyn_share", "hideShortsShareButton")
; ;
fun injectHideCall(method: MutableMethod) { fun injectHideCall(method: MutableMethod) {