This repository was archived by the owner on May 13, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
app/src/main/java/com/virb3/trustmealready Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 1717
1818public class Main implements IXposedHookZygoteInit {
1919
20- private final String SSL_CLASS_NAME = "com.android.org.conscrypt.TrustManagerImpl" ;
21- private final String SSL_METHOD_NAME = "checkTrustedRecursive" ;
20+ private static final String SSL_CLASS_NAME = "com.android.org.conscrypt.TrustManagerImpl" ;
21+ private static final String SSL_METHOD_NAME = "checkTrustedRecursive" ;
22+ private static final Class <?> SSL_RETURN_TYPE = List .class ;
23+ private static final Class <?> SSL_RETURN_PARAM_TYPE = X509Certificate .class ;
2224
2325 @ Override
2426 public void initZygote (StartupParam startupParam ) throws Throwable {
@@ -53,13 +55,20 @@ private boolean checkSSLMethod(Method method) {
5355 return false ;
5456 }
5557
58+ // check return type
59+ if (!SSL_RETURN_TYPE .isAssignableFrom (method .getReturnType ())) {
60+ return false ;
61+ }
62+
63+ // check if parameterized return type
5664 Type returnType = method .getGenericReturnType ();
5765 if (!(returnType instanceof ParameterizedType )) {
5866 return false ;
5967 }
6068
69+ // check parameter type
6170 Type [] args = ((ParameterizedType ) returnType ).getActualTypeArguments ();
62- if (args .length != 1 || args [0 ] instanceof X509Certificate ) {
71+ if (args .length != 1 || !( args [0 ]. equals ( SSL_RETURN_PARAM_TYPE )) ) {
6372 return false ;
6473 }
6574
You can’t perform that action at this time.
0 commit comments