Skip to content

Commit

Permalink
feat(id-austria): remove-root-detection patch
Browse files Browse the repository at this point in the history
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
  • Loading branch information
1fexd authored and oSumAtrIX committed Jan 17, 2023
1 parent 355a847 commit 3cf77cd
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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;")
}
)
Original file line number Diff line number Diff line change
@@ -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()
}
}
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3cf77cd

Please sign in to comment.