|
24 | 24 | import org.luckypray.dexkit.query.enums.StringMatchType; |
25 | 25 | import org.luckypray.dexkit.query.matchers.ClassMatcher; |
26 | 26 | import org.luckypray.dexkit.query.matchers.MethodMatcher; |
| 27 | +import org.luckypray.dexkit.query.matchers.MethodsMatcher; |
27 | 28 | import org.luckypray.dexkit.query.matchers.base.OpCodesMatcher; |
28 | 29 | import org.luckypray.dexkit.result.ClassData; |
29 | 30 | import org.luckypray.dexkit.result.ClassDataList; |
@@ -763,12 +764,20 @@ public synchronized static Field loadStatusPlaybackViewField(ClassLoader loader) |
763 | 764 | ClassMatcher.create().methodCount(1).addFieldForType(class1) |
764 | 765 | )); |
765 | 766 | if (classView.isEmpty()) classView = dexkit.findClass(FindClass.create().matcher( |
766 | | - ClassMatcher.create().methodCount(1, 2) |
767 | | - .addMethod(MethodMatcher.create().paramTypes(View.class, boolean.class, boolean.class)) |
| 767 | + ClassMatcher.create() |
| 768 | + .addMethod(MethodMatcher.create().invokeMethods( |
| 769 | + MethodsMatcher.create().methods( |
| 770 | + Collections.singletonList( |
| 771 | + MethodMatcher.create().declaredClass(ClassMatcher.create().addUsingString("INVOKE_RETURN")) |
| 772 | + .paramTypes(View.class, int.class) |
| 773 | + ) |
| 774 | + ) |
| 775 | + )) |
768 | 776 | .addFieldForType(class1) |
769 | 777 | )); |
770 | 778 | if (classView.isEmpty()) throw new Exception("StatusPlaybackView field not found"); |
771 | | - Class<?> clsViewStatus = classView.get(0).getInstance(loader); |
| 779 | + Class<?> clsViewStatus = classView.single(classData -> classData.getSuperClass().getSimpleName().equals("Object")).getInstance(loader); |
| 780 | + if (classView.isEmpty()) throw new Exception("StatusPlaybackView field not found 2"); |
772 | 781 | Class<?> class2 = XposedHelpers.findClass("com.whatsapp.status.playback.fragment.StatusPlaybackBaseFragment", loader); |
773 | 782 | return Arrays.stream(class2.getDeclaredFields()).filter(f -> f.getType() == clsViewStatus).findFirst().orElse(null); |
774 | 783 | }); |
@@ -1585,10 +1594,22 @@ public synchronized static Class loadListChannelItemClass(ClassLoader classLoade |
1585 | 1594 | } |
1586 | 1595 |
|
1587 | 1596 | public synchronized static Method loadTextStatusComposer(ClassLoader classLoader) throws Exception { |
1588 | | - var methods = dexkit.findMethod(FindMethod.create().matcher(MethodMatcher.create().addUsingString("background_color_key", StringMatchType.Equals).paramCount(1))); |
1589 | | - if (methods.isEmpty()) |
1590 | | - return null; |
1591 | | - return methods.single().getMethodInstance(classLoader); |
| 1597 | + return UnobfuscatorCache.getInstance().getMethod(classLoader, () -> { |
| 1598 | + var methods = dexkit.findMethod(FindMethod.create().matcher(MethodMatcher.create().addUsingString("background_color_key", StringMatchType.Equals))); |
| 1599 | + for (MethodData method : methods) { |
| 1600 | + var targetMethod = method.getDeclaredClass().findMethod( |
| 1601 | + FindMethod.create().matcher( |
| 1602 | + MethodMatcher.create().returnType(int.class).paramCount(1) |
| 1603 | + ) |
| 1604 | + ); |
| 1605 | + |
| 1606 | + if (!targetMethod.isEmpty()) { |
| 1607 | + return targetMethod.single().getMethodInstance(classLoader); |
| 1608 | + } |
| 1609 | + } |
| 1610 | + |
| 1611 | + throw new RuntimeException("TextStatusComposer class not found"); |
| 1612 | + }); |
1592 | 1613 | } |
1593 | 1614 |
|
1594 | 1615 | public synchronized static Method loadTextStatusComposer2(ClassLoader classLoader) throws Exception { |
|
0 commit comments