Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhawat2 committed Oct 19, 2024
1 parent 0d674a2 commit 3e87e4f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions repstr.py
Original file line number Diff line number Diff line change
@@ -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))

16 changes: 16 additions & 0 deletions yt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {} \;
Expand Down

0 comments on commit 3e87e4f

Please sign in to comment.