diff options
author | utzcoz <utzcoz@outlook.com> | 2023-06-02 23:11:56 +0800 |
---|---|---|
committer | utzcoz <43091780+utzcoz@users.noreply.github.com> | 2023-06-02 23:37:26 +0800 |
commit | 40d0f779fc6cf8bef7676591d11e8b5977ad330c (patch) | |
tree | 8eaee6cca03610b52ecce68d8ba52b846d7217fd /sandbox | |
parent | fbfe32209b2bf4fc6978a287f9934086005fa22a (diff) | |
download | robolectric-40d0f779fc6cf8bef7676591d11e8b5977ad330c.tar.gz |
Revert "Intercept Cipher#getCurrentSpi to avoid running error"
This reverts commit 1ef305844cee51479bc27d56f129589cec0831fb.
Before we find a proper method to test and fix it, the original commit
will be reverted first.
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/src/main/java/org/robolectric/interceptors/AndroidInterceptors.java | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/sandbox/src/main/java/org/robolectric/interceptors/AndroidInterceptors.java b/sandbox/src/main/java/org/robolectric/interceptors/AndroidInterceptors.java index 842107f17..219b8fcf6 100644 --- a/sandbox/src/main/java/org/robolectric/interceptors/AndroidInterceptors.java +++ b/sandbox/src/main/java/org/robolectric/interceptors/AndroidInterceptors.java @@ -24,8 +24,6 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Locale; import javax.annotation.Nullable; -import javax.crypto.Cipher; -import javax.crypto.CipherSpi; import org.robolectric.fakes.CleanerCompat; import org.robolectric.internal.bytecode.Interceptor; import org.robolectric.internal.bytecode.MethodRef; @@ -48,7 +46,6 @@ public class AndroidInterceptors { new FileDescriptorInterceptor(), new NoOpInterceptor(), new SocketInterceptor(), - new CipherInterceptor(), new ReferenceRefersToInterceptor())); if (Util.getJavaVersion() >= 9) { @@ -468,35 +465,6 @@ public class AndroidInterceptors { } } - /** Intercepts calls to methods in {@link javax.crypto.Cipher} not present in the OpenJDK. */ - public static class CipherInterceptor extends Interceptor { - public CipherInterceptor() { - super(new MethodRef(Cipher.class, "getCurrentSpi")); - } - - @Nullable - static CipherSpi getCurrentSpi() { - return null; - } - - @Override - public Function<Object, Object> handle(MethodSignature methodSignature) { - return new Function<Object, Object>() { - @Override - public Object call(Class<?> theClass, Object value, Object[] params) { - return getCurrentSpi(); - } - }; - } - - @Override - public MethodHandle getMethodHandle(String methodName, MethodType type) - throws NoSuchMethodException, IllegalAccessException { - return lookup.findStatic( - getClass(), "getCurrentSpi", methodType(CipherSpi.class, void.class)); - } - } - /** AndroidInterceptor for Reference.refersTo which is not available until JDK 16. */ public static class ReferenceRefersToInterceptor extends Interceptor { private static final String METHOD = "refersTo"; |