refactor(hide-shorts-navbar): no longer use dummy class - PivotBar in integrations

This commit is contained in:
inotia00 2023-04-28 11:49:50 +09:00
parent 7b0d5f5111
commit 0266725e6e

View File

@ -47,14 +47,11 @@ class ShortsNavBarPatch : BytecodePatch(
with (it.mutableMethod) {
val startIndex = it.scanResult.patternScanResult!!.startIndex
val instructions = implementation!!.instructions
val indexReference = ((instructions[startIndex] as ReferenceInstruction).reference as DexBackedTypeReference).toString()
if (indexReference != targetReference) return SetPivotBarFingerprint.toErrorResult()
val register = (instructions[startIndex] as OneRegisterInstruction).registerA
addInstruction(
startIndex + 1,
"sput-object v$register, $NAVIGATION->pivotbar:$targetReference"
"sput-object v$register, $NAVIGATION->pivotBar:Ljava/lang/Object;"
)
}
} ?: return SetPivotBarFingerprint.toErrorResult()
@ -119,9 +116,4 @@ class ShortsNavBarPatch : BytecodePatch(
return PatchResultSuccess()
}
private companion object {
const val targetReference =
"Lcom/google/android/apps/youtube/app/ui/pivotbar/PivotBar;"
}
}