Skip to content

Commit

Permalink
Support YouTube beta versions
Browse files Browse the repository at this point in the history
Tested against YT beta 17.41.36
  • Loading branch information
wanam authored Oct 16, 2022
1 parent 4ede7df commit 8315c5c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/src/main/java/ma/wanam/youtubeadaway/BFAsync.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ private void findAndHookInvideoAds(char a1, char a2, char a3, char a4, ClassLoad
Class<?> aClass;
Field[] fields;
Method[] methods;
final String lCRegex = "[a-z]+";
final Pattern lCPatern = Pattern.compile(lCRegex);

try {
aClass = XposedHelpers.findClass(new StringBuffer().append(a1).append(a2).append(a3).append(a4).toString(), cl);
Expand Down Expand Up @@ -117,8 +115,6 @@ private void findAndHookVideoBGP(char a1, char a2, char a3, ClassLoader cl) {
Class<?> aClass;
Field[] fields;
Method[] methods;
final String lCRegex = "[a-z]+";
final Pattern lCPatern = Pattern.compile(lCRegex);

try {
aClass = XposedHelpers.findClass(new StringBuffer().append(a1).append(a2).append(a3).toString(), cl);
Expand All @@ -142,9 +138,11 @@ private void findAndHookVideoBGP(char a1, char a2, char a3, ClassLoader cl) {

if (sigBgFound) {
fMethod = Arrays.asList(methods).parallelStream().filter(method -> method.getParameterTypes().length == 1
&& method.getParameterTypes()[0].getName().length() == 4
&& method.getReturnType().equals(boolean.class)
&& lCPatern.matcher(method.getName()).matches()
&& method.getName().equals(method.getName().toLowerCase())
&& java.lang.reflect.Modifier.isStatic(method.getModifiers())
&& java.lang.reflect.Modifier.isPublic(method.getModifiers())
).findFirst();

sigBgFound = sigBgFound && fMethod.isPresent();
Expand Down

0 comments on commit 8315c5c

Please sign in to comment.