generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(id-austria):
remove-root-detection
patch
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
- Loading branch information
Showing
4 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
...in/app/revanced/patches/idaustria/detection/root/fingerprints/RootDetectionFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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;") | ||
} | ||
) |
25 changes: 25 additions & 0 deletions
25
src/main/kotlin/app/revanced/patches/idaustria/detection/root/patch/RootDetectionPatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...lin/app/revanced/patches/idaustria/detection/shared/annotations/DetectionCompatibility.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters