diff --git a/src/main/kotlin/app/revanced/patches/idaustria/detection/root/fingerprints/RootDetectionFingerprint.kt b/src/main/kotlin/app/revanced/patches/idaustria/detection/root/fingerprints/RootDetectionFingerprint.kt new file mode 100644 index 000000000..a64808a5f --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/idaustria/detection/root/fingerprints/RootDetectionFingerprint.kt @@ -0,0 +1,12 @@ +package app.revanced.patches.idaustria.detection.root.fingerprints + +import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint +import org.jf.dexlib2.AccessFlags + +object RootDetectionFingerprint : MethodFingerprint( + "V", + access = AccessFlags.PUBLIC.value, + customFingerprint = { methodDef -> + methodDef.definingClass.endsWith("/DeviceIntegrityCheck;") + } +) diff --git a/src/main/kotlin/app/revanced/patches/idaustria/detection/root/patch/RootDetectionPatch.kt b/src/main/kotlin/app/revanced/patches/idaustria/detection/root/patch/RootDetectionPatch.kt new file mode 100644 index 000000000..41f5929de --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/idaustria/detection/root/patch/RootDetectionPatch.kt @@ -0,0 +1,25 @@ +package app.revanced.patches.idaustria.detection.root.patch + +import app.revanced.patcher.annotation.* +import app.revanced.patcher.data.BytecodeContext +import app.revanced.patcher.extensions.addInstructions +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.idaustria.detection.root.fingerprints.RootDetectionFingerprint +import app.revanced.patches.idaustria.detection.shared.annotations.DetectionCompatibility + +@Patch +@Name("remove-root-detection") +@Description("Removes the check for root permissions and unlocked bootloader.") +@DetectionCompatibility +@Version("0.0.1") +class RootDetectionPatch : BytecodePatch( + listOf(RootDetectionFingerprint) +) { + override fun execute(context: BytecodeContext): PatchResult { + RootDetectionFingerprint.result!!.mutableMethod.addInstructions(0, "return-void") + return PatchResultSuccess() + } +} diff --git a/src/main/kotlin/app/revanced/patches/idaustria/detection/shared/annotations/DetectionCompatibility.kt b/src/main/kotlin/app/revanced/patches/idaustria/detection/shared/annotations/DetectionCompatibility.kt new file mode 100644 index 000000000..4d8008058 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/idaustria/detection/shared/annotations/DetectionCompatibility.kt @@ -0,0 +1,9 @@ +package app.revanced.patches.idaustria.detection.shared.annotations + +import app.revanced.patcher.annotation.Compatibility +import app.revanced.patcher.annotation.Package + +@Compatibility([Package("at.gv.oe.app", arrayOf("2.5.2"))]) +@Target(AnnotationTarget.CLASS) +@Retention(AnnotationRetention.RUNTIME) +internal annotation class DetectionCompatibility \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/idaustria/detection/signature/patch/SpoofSignaturePatch.kt b/src/main/kotlin/app/revanced/patches/idaustria/detection/signature/patch/SpoofSignaturePatch.kt index c1903383b..71d713763 100644 --- a/src/main/kotlin/app/revanced/patches/idaustria/detection/signature/patch/SpoofSignaturePatch.kt +++ b/src/main/kotlin/app/revanced/patches/idaustria/detection/signature/patch/SpoofSignaturePatch.kt @@ -7,12 +7,13 @@ 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.idaustria.detection.shared.annotations.DetectionCompatibility import app.revanced.patches.idaustria.detection.signature.fingerprints.SpoofSignatureFingerprint @Patch @Name("spoof-signature") @Description("Spoofs the signature of the app.") -@Compatibility([Package("at.gv.oe.app", arrayOf("2.5.2"))]) +@DetectionCompatibility @Version("0.0.1") class SpoofSignaturePatch : BytecodePatch( listOf(SpoofSignatureFingerprint)