diff --git a/src/main/kotlin/app/revanced/patches/nova/prime/annotations/UnlockPrimeCompatibility.kt b/src/main/kotlin/app/revanced/patches/nova/prime/annotations/UnlockPrimeCompatibility.kt deleted file mode 100644 index 8ab3cc7808..0000000000 --- a/src/main/kotlin/app/revanced/patches/nova/prime/annotations/UnlockPrimeCompatibility.kt +++ /dev/null @@ -1,12 +0,0 @@ -package app.revanced.patches.nova.prime.annotations - -import app.revanced.patcher.annotation.Compatibility -import app.revanced.patcher.annotation.Package - -@Compatibility( - [ - Package("com.teslacoilsw.launcher") - ] -) -@Target(AnnotationTarget.CLASS) -internal annotation class UnlockPrimeCompatibility \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/nova/prime/fingerprints/UnlockPrimeFingerprint.kt b/src/main/kotlin/app/revanced/patches/nova/prime/fingerprints/UnlockPrimeFingerprint.kt deleted file mode 100644 index 69d2902a4d..0000000000 --- a/src/main/kotlin/app/revanced/patches/nova/prime/fingerprints/UnlockPrimeFingerprint.kt +++ /dev/null @@ -1,16 +0,0 @@ -package app.revanced.patches.nova.prime.fingerprints - -import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint -import org.jf.dexlib2.Opcode - -object UnlockPrimeFingerprint : MethodFingerprint( - "V", - opcodes = listOf( - Opcode.IPUT_OBJECT, - Opcode.CONST_STRING, - Opcode.CONST_4, - Opcode.INVOKE_INTERFACE, - Opcode.MOVE_RESULT - ), - strings = listOf("1") -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/nova/prime/patch/UnlockPrimePatch.kt b/src/main/kotlin/app/revanced/patches/nova/prime/patch/UnlockPrimePatch.kt deleted file mode 100644 index 4c1546041b..0000000000 --- a/src/main/kotlin/app/revanced/patches/nova/prime/patch/UnlockPrimePatch.kt +++ /dev/null @@ -1,48 +0,0 @@ -package app.revanced.patches.nova.prime.patch - -import app.revanced.extensions.toErrorResult -import app.revanced.patcher.annotation.Description -import app.revanced.patcher.annotation.Name -import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.InstructionExtensions.addInstruction -import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.PatchResult -import app.revanced.patcher.patch.PatchResultSuccess -import app.revanced.patcher.patch.annotations.Patch -import app.revanced.patches.nova.prime.annotations.UnlockPrimeCompatibility -import app.revanced.patches.nova.prime.fingerprints.UnlockPrimeFingerprint -import org.jf.dexlib2.builder.instruction.BuilderInstruction11x - -@Patch -@Name("Unlock prime") -@Description("Unlocks Nova Prime and all functions of the app.") -@UnlockPrimeCompatibility -class UnlockPrimePatch : BytecodePatch( - listOf( - UnlockPrimeFingerprint - ) -) { - private companion object { - // Any value except 0 unlocks prime, but 512 is needed for a protection mechanism - // which would reset the preferences if the value on disk had changed after a restart. - const val PRIME_STATUS: Int = 512 - } - - override fun execute(context: BytecodeContext): PatchResult { - UnlockPrimeFingerprint.result?.apply { - val insertIndex = scanResult.patternScanResult!!.endIndex + 1 - - val primeStatusRegister = - (mutableMethod.implementation!!.instructions[insertIndex - 1] as BuilderInstruction11x).registerA - - mutableMethod.addInstruction( - insertIndex, - """ - const/16 v$primeStatusRegister, $PRIME_STATUS - """ - ) - } ?: return UnlockPrimeFingerprint.toErrorResult() - - return PatchResultSuccess() - } -}