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..f83207c 100755 --- a/yt.sh +++ b/yt.sh @@ -66,6 +66,19 @@ clone_tools() { CLIVER=$(grep version $CURDIR/revanced-cli/gradle.properties | tr -dc .0-9) } +patch_tools() { +echo "Patching Tools" +PATCHFILE=$CURDIR/revanced-integrations/app/src/main/java/app/revanced/integrations/shared/checks/CheckEnvironmentPatch.java +FIND_START=" public static void check(Activity context) {" +FIND_END=" }" +oldStr=`sed -n "/$FIND_START/,/^$FIND_END/p" $PATCHFILE` +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 +160,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 {} \;