diff --git a/repstr.py b/repstr.py new file mode 100755 index 0000000..c18361b --- /dev/null +++ b/repstr.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 +import sys +file=sys.argv[1] +old=sys.argv[2] +new=sys.argv[3] + +with open(file, 'r+') as f: + content = f.read() + f.seek(0,0) + f.truncate() + f.write(content.replace(old, new)) + diff --git a/yt.sh b/yt.sh index 99d2c61..c5c1861 100755 --- a/yt.sh +++ b/yt.sh @@ -66,6 +66,16 @@ clone_tools() { CLIVER=$(grep version $CURDIR/revanced-cli/gradle.properties | tr -dc .0-9) } +patch_tools() { +PATCHFILE=$CURDIR/revanced-integrations/app/src/main/java/app/revanced/integrations/shared/checks/CheckEnvironmentPatch.java +oldStr=" public static void check(Activity context) {" +newStr=" public static void check(Activity context) { + Check.disableForever(); + return; +" +$CURDIR/repstr.py "$PATCHFILE" "$oldStr" "$newStr" +} + build_tools() { cd $CURDIR/revanced-patcher && sh gradlew build >/dev/null cd $CURDIR/revanced-patches && sh gradlew build >/dev/null @@ -147,6 +157,9 @@ rm -rf revanced-patches.json # Clone Tools clone_tools +# Patch Tools +patch_tools + # Cleanup find $CURDIR -type f -name "*.apk" -exec rm -rf {} \; find $CURDIR -type f -name "*.zip" -exec rm -rf {} \;