Info Call to Reflection API

Description

List of calls allowing the application to examine and modify the structure and behavior of an object at runtime.

Recommendation

This entry is informative, no recommendations applicable.

Technical details

Method com.millennialmedia.android.MMAdView.callSetTranslationY() calling method java.lang.reflect.Method.invoke()


    private void callSetTranslationY(int p7)
    {
        try {
            Integer v3_2 = new Class[1];
            v3_2[0] = Float.TYPE;
            reflect.Method v0 = android.view.View.getMethod("setTranslationY", v3_2);
            Exception v1_1 = new Object[1];
            v1_1[0] = Integer.valueOf(p7);
            v0.invoke(this, v1_1);
        } catch (Exception v1) {
        }
        return;
    }

Method com.millennialmedia.android.MMAdView.callSetTranslationX() calling method java.lang.reflect.Method.invoke()


    private void callSetTranslationX(int p7)
    {
        try {
            Integer v3_2 = new Class[1];
            v3_2[0] = Float.TYPE;
            reflect.Method v0 = android.view.View.getMethod("setTranslationX", v3_2);
            Exception v1_1 = new Object[1];
            v1_1[0] = Integer.valueOf(p7);
            v0.invoke(this, v1_1);
        } catch (Exception v1) {
        }
        return;
    }

Method com.millennialmedia.google.gson.internal.UnsafeAllocator$3.newInstance() calling method java.lang.reflect.Method.invoke()


    public Object newInstance(Class p6)
    {
        Object v0_0 = this.val$newInstance;
        Object[] v2_1 = new Object[2];
        v2_1[0] = p6;
        v2_1[1] = Integer.valueOf(this.val$constructorId);
        return v0_0.invoke(0, v2_1);
    }

Method com.millennialmedia.google.gson.internal.UnsafeAllocator$2.newInstance() calling method java.lang.reflect.Method.invoke()


    public Object newInstance(Class p6)
    {
        Object v0_0 = this.val$newInstance;
        Object[] v2_1 = new Object[2];
        v2_1[0] = p6;
        v2_1[1] = Object;
        return v0_0.invoke(0, v2_1);
    }

Method com.millennialmedia.google.gson.internal.UnsafeAllocator$1.newInstance() calling method java.lang.reflect.Method.invoke()


    public Object newInstance(Class p5)
    {
        Object v0_0 = this.val$allocateInstance;
        Object v1 = this.val$unsafe;
        Object[] v2_1 = new Object[1];
        v2_1[0] = p5;
        return v0_0.invoke(v1, v2_1);
    }

Method goldenshorestechnologies.brightestflashlight.free.CameraWrapper.setDisplayOrientation() calling method java.lang.reflect.Method.invoke()


    public void setDisplayOrientation(android.hardware.Camera p11, int p12)
    {
        try {
            String v6_3 = new Class[1];
            v6_3[0] = Integer.TYPE;
            goldenshorestechnologies.brightestflashlight.free.CameraWrapper.mCamera_setDisplayOrientation = android.hardware.Camera.getDeclaredMethod("setDisplayOrientation", v6_3);
            goldenshorestechnologies.brightestflashlight.free.CameraWrapper.bSetDisplayOrientationSupported = 1;
        } catch (NoSuchMethodException v3) {
            goldenshorestechnologies.brightestflashlight.free.CameraWrapper.bSetDisplayOrientationSupported = 0;
            android.util.Log.e("CameraWrapper", "setDisplayOrientation not supported.");
            return;
        }
        if (p11 == null) {
            return;
        } else {
            try {
                String v5_3 = new Object[1];
                v5_3[0] = Integer.valueOf(p12);
                goldenshorestechnologies.brightestflashlight.free.CameraWrapper.mCamera_setDisplayOrientation.invoke(p11, v5_3);
            } catch (IllegalAccessException v1) {
                android.util.Log.e("CameraWrapper", new StringBuilder("Unexpected Exception ").append(v1).toString());
            } catch (reflect.InvocationTargetException v2) {
                Throwable v0 = v2.getCause();
                if (!(v0 instanceof java.io.IOException)) {
                    if (!(v0 instanceof RuntimeException)) {
                        if (!(v0 instanceof Error)) {
                            android.util.Log.e("CameraWrapper", new StringBuilder("Unexpected Exception ").append(v2).toString());
                        } else {
                            android.util.Log.e("CameraWrapper", new StringBuilder("Error  ").append(v0).toString());
                        }
                    } else {
                        android.util.Log.e("CameraWrapper", new StringBuilder("RuntimeException ").append(v0).toString());
                    }
                } else {
                    android.util.Log.e("CameraWrapper", new StringBuilder("IOException ").append(v0).toString());
                }
            }
            return;
        }
    }

Method goldenshorestechnologies.brightestflashlight.free.BrightestFlashlightMain.enableFlashlight() calling method java.lang.reflect.Method.invoke()


    private void enableFlashlight(boolean p15)
    {
        try {
            Class v8 = Class.forName("android.os.ServiceManager");
            String v10_10 = new Class[1];
            v10_10[0] = String;
            String v9_1 = v8.getMethod("getService", v10_10);
            int v11_1 = new Object[1];
            v11_1[0] = "hardware";
            android.os.IBinder v4_0 = v9_1.invoke(0, v11_1);
            Class v5 = Class.forName("android.os.IHardwareService$Stub");
            String v10_4 = new Class[1];
            v10_4[0] = android.os.IBinder;
            reflect.Method v0 = v5.getMethod("asInterface", v10_4);
            String v10_6 = new Object[1];
            v10_6[0] = ((android.os.IBinder) v4_0);
            this.svc = v0.invoke(0, v10_6);
            Class v7 = this.svc.getClass();
            String v10_9 = new Class[1];
            v10_9[0] = Boolean.TYPE;
            this.setFlashlightEnabled = v7.getMethod("setFlashlightEnabled", v10_9);
            this.getFlashlightEnabled = v7.getMethod("getFlashlightEnabled", 0);
            try {
                String v9_17 = this.setFlashlightEnabled;
                String v10_13 = this.svc;
                int v11_7 = new Object[1];
                v11_7[0] = Boolean.valueOf(p15);
                v9_17.invoke(v10_13, v11_7);
                try {
                    if (!((Boolean) this.getFlashlightEnabled.invoke(this.svc, 0)).booleanValue()) {
                        this.sendFlurryEvent(goldenshorestechnologies.brightestflashlight.free.Globals.strFlurryID_setFlashlightEnabledFailed, 0);
                        android.util.Log.w("BrightestFlashlightMain", "Failed to turn on camera LED with setFlashlightEnabled()");
                        return;
                    } else {
                        goldenshorestechnologies.brightestflashlight.free.Globals.bSuccessfullyUsingSetFlashlightEnabled = 1;
                        android.util.Log.d("BrightestFlashlightMain", "Successfully turned on camera LED with setFlashlightEnabled()");
                        return;
                    }
                } catch (Exception v2_1) {
                    android.util.Log.e("BrightestFlashlightMain", "Invoke of getFlashlightEnabled() failed", v2_1);
                    v2_1.printStackTrace();
                    return;
                }
            } catch (Exception v2_1) {
                android.util.Log.e("BrightestFlashlightMain", "Invoke of setFlashlightEnabled() failed", v2_1);
                v2_1.printStackTrace();
            }
        } catch (Exception v2_1) {
            this.setFlashlightEnabled = 0;
            android.util.Log.e("BrightestFlashlightMain", "Failed to acquire setFlashlightEnabled() via reflection", v2_1);
            v2_1.printStackTrace();
        } catch (String v9_2) {
            Exception v2_0 = v9_2;
            android.util.Log.e("BrightestFlashlightMain", "enableFlashlight() failed", v2_0);
            v2_0.printStackTrace();
            this.sendFlurryEvent(goldenshorestechnologies.brightestflashlight.free.Globals.strFlurryIDExceptionEnableFlashlightFailed, 0);
            return;
        }
    }

Method com.millennialmedia.google.gson.internal.UnsafeAllocator.create() calling method java.lang.reflect.Method.invoke()


    public static com.millennialmedia.google.gson.internal.UnsafeAllocator create()
    {
        try {
            Class v6 = Class.forName("sun.misc.Unsafe");
            reflect.Field v2 = v6.getDeclaredField("theUnsafe");
            v2.setAccessible(1);
            Object v5 = v2.get(0);
            String v8_1 = new Class[1];
            v8_1[0] = Class;
            com.millennialmedia.google.gson.internal.UnsafeAllocator$4 v7_3 = new com.millennialmedia.google.gson.internal.UnsafeAllocator$1(v6.getMethod("allocateInstance", v8_1), v5);
        } catch (com.millennialmedia.google.gson.internal.UnsafeAllocator$4 v7) {
            try {
                Class[] v9_2 = new Class[2];
                v9_2[0] = Class;
                v9_2[1] = Class;
                reflect.Method v4_0 = java.io.ObjectInputStream.getDeclaredMethod("newInstance", v9_2);
                v4_0.setAccessible(1);
                v7_3 = new com.millennialmedia.google.gson.internal.UnsafeAllocator$2(v4_0);
            } catch (com.millennialmedia.google.gson.internal.UnsafeAllocator$4 v7) {
                try {
                    Class[] v9_4 = new Class[1];
                    v9_4[0] = Class;
                    reflect.Method v3 = java.io.ObjectStreamClass.getDeclaredMethod("getConstructorId", v9_4);
                    v3.setAccessible(1);
                    String v8_5 = new Object[1];
                    v8_5[0] = Object;
                    int v1 = ((Integer) v3.invoke(0, v8_5)).intValue();
                    Class[] v9_7 = new Class[2];
                    v9_7[0] = Class;
                    v9_7[1] = Integer.TYPE;
                    reflect.Method v4_1 = java.io.ObjectStreamClass.getDeclaredMethod("newInstance", v9_7);
                    v4_1.setAccessible(1);
                    v7_3 = new com.millennialmedia.google.gson.internal.UnsafeAllocator$3(v4_1, v1);
                } catch (com.millennialmedia.google.gson.internal.UnsafeAllocator$4 v7) {
                    v7_3 = new com.millennialmedia.google.gson.internal.UnsafeAllocator$4();
                }
            }
        }
        return v7_3;
    }

Method com.millennialmedia.android.MMWebView.setMediaPlaybackRequiresUserGesture() calling method java.lang.reflect.Method.invoke()


    void setMediaPlaybackRequiresUserGesture(boolean p7)
    {
        try {
            Boolean v3_2 = new Class[1];
            v3_2[0] = Boolean.TYPE;
            reflect.Method v0 = android.webkit.WebView.getMethod("setMediaPlaybackRequiresUserGesture", v3_2);
            Exception v1_1 = new Object[1];
            v1_1[0] = Boolean.valueOf(p7);
            v0.invoke(this, v1_1);
        } catch (Exception v1) {
        }
        return;
    }

Method com.millennialmedia.android.MMWebView.onResumeWebViewVideo() calling method java.lang.reflect.Method.invoke()


    public void onResumeWebViewVideo()
    {
        try {
            Class[] v3_1 = new Class[0];
            Exception v1_2 = new Object[0];
            android.webkit.WebView.getMethod("onResume", v3_1).invoke(this, v1_2);
        } catch (Exception v1) {
        }
        return;
    }

Method com.millennialmedia.android.MMWebView.onPauseWebViewVideo() calling method java.lang.reflect.Method.invoke()


    public void onPauseWebViewVideo()
    {
        try {
            Class[] v3_1 = new Class[0];
            Exception v1_2 = new Object[0];
            android.webkit.WebView.getMethod("onPause", v3_1).invoke(this, v1_2);
        } catch (Exception v1) {
        }
        return;
    }

Method com.millennialmedia.android.MMWebView.enableSoftwareAcceleration() calling method java.lang.reflect.Method.invoke()


    void enableSoftwareAcceleration()
    {
        try {
            int v3_4 = new Class[2];
            v3_4[0] = Integer.TYPE;
            v3_4[1] = android.graphics.Paint;
            reflect.Method v0 = android.webkit.WebView.getMethod("setLayerType", v3_4);
            Exception v1_2 = new Object[2];
            v1_2[0] = Integer.valueOf(1);
            v1_2[1] = 0;
            v0.invoke(this, v1_2);
            com.millennialmedia.android.MMSDK$Log.d("Remove allAcceleration");
        } catch (Exception v1) {
        }
        return;
    }

Method com.millennialmedia.android.MMWebView.enableHardwareAcceleration() calling method java.lang.reflect.Method.invoke()


    void enableHardwareAcceleration()
    {
        try {
            int v3_4 = new Class[2];
            v3_4[0] = Integer.TYPE;
            v3_4[1] = android.graphics.Paint;
            reflect.Method v0 = android.webkit.WebView.getMethod("setLayerType", v3_4);
            Exception v1_2 = new Object[2];
            v1_2[0] = Integer.valueOf(2);
            v1_2[1] = 0;
            v0.invoke(this, v1_2);
            com.millennialmedia.android.MMSDK$Log.d("Enabled hardwareAcceleration");
        } catch (Exception v1) {
        }
        return;
    }

Method com.millennialmedia.android.MMWebView.disableAllAcceleration() calling method java.lang.reflect.Method.invoke()


    void disableAllAcceleration()
    {
        try {
            int v3_4 = new Class[2];
            v3_4[0] = Integer.TYPE;
            v3_4[1] = android.graphics.Paint;
            reflect.Method v0 = android.webkit.WebView.getMethod("setLayerType", v3_4);
            Exception v1_2 = new Object[2];
            v1_2[0] = Integer.valueOf(0);
            v1_2[1] = 0;
            v0.invoke(this, v1_2);
            com.millennialmedia.android.MMSDK$Log.d("Remove allAcceleration");
        } catch (Exception v1) {
        }
        return;
    }

Method com.millennialmedia.android.MMSDK.getDpiWidth() calling method java.lang.reflect.Method.invoke()


    static String getDpiWidth(android.content.Context p10)
    {
        android.util.DisplayMetrics v5 = com.millennialmedia.android.MMSDK.getMetrics(p10);
        if (com.millennialmedia.android.MMSDK.needsRealDisplayMethod()) {
            try {
                Class[] v9_3 = new Class[0];
                String v7_1 = new Object[0];
                android.view.Display.getMethod("getRealMetrics", v9_3).invoke(v5, v7_1);
            } catch (String v7) {
            }
        }
        if ((!com.millennialmedia.android.MMSDK.needsRawDisplayMethod()) || (!(p10 instanceof android.app.Activity))) {
            String v7_5 = Integer.toString(v5.widthPixels);
        } else {
            try {
                Class[] v9_1 = new Class[0];
                String v7_10 = new Object[0];
                v7_5 = String.valueOf(((Integer) android.view.Display.getMethod("getRawWidth", v9_1).invoke(((android.app.Activity) p10).getWindowManager().getDefaultDisplay(), v7_10)).intValue());
            } catch (Exception v2) {
                v7_5 = Integer.toString(v5.widthPixels);
            }
        }
        return v7_5;
    }

Method com.millennialmedia.android.MMSDK.getDpiHeight() calling method java.lang.reflect.Method.invoke()


    static String getDpiHeight(android.content.Context p10)
    {
        android.util.DisplayMetrics v5 = com.millennialmedia.android.MMSDK.getMetrics(p10);
        if (com.millennialmedia.android.MMSDK.needsRealDisplayMethod()) {
            try {
                Class[] v9_3 = new Class[0];
                String v7_1 = new Object[0];
                android.view.Display.getMethod("getRealMetrics", v9_3).invoke(v5, v7_1);
            } catch (String v7) {
            }
        }
        if ((!com.millennialmedia.android.MMSDK.needsRawDisplayMethod()) || (!(p10 instanceof android.app.Activity))) {
            String v7_5 = Integer.toString(v5.heightPixels);
        } else {
            try {
                Class[] v9_1 = new Class[0];
                String v7_10 = new Object[0];
                v7_5 = String.valueOf(((Integer) android.view.Display.getMethod("getRawHeight", v9_1).invoke(((android.app.Activity) p10).getWindowManager().getDefaultDisplay(), v7_10)).intValue());
            } catch (Exception v2) {
                v7_5 = Integer.toString(v5.heightPixels);
            }
        }
        return v7_5;
    }

Method com.millennialmedia.android.MMCommand.run() calling method java.lang.reflect.Method.invoke()


    public void run()
    {
        try {
            if ((this.cls == null) || (this.method == null)) {
                if (!android.text.TextUtils.isEmpty(this.callback)) {
                    com.millennialmedia.android.MMJSResponse v2 = com.millennialmedia.android.MMJSResponse.responseWithError("No class or method found");
                    String v10_4 = new Object[2];
                    v10_4[0] = this.callback;
                    v10_4[1] = v2.toJSONString();
                    String v0_1 = String.format("javascript:%s(%s);", v10_4);
                    com.millennialmedia.android.MMSDK$Log.v(new StringBuilder().append("Executing JS bridge failed callback: ").append(v0_1).toString());
                    com.millennialmedia.android.MMSDK.runOnUiThread(new com.millennialmedia.android.MMCommand$2(this, ((com.millennialmedia.android.MMWebView) this.webViewRef.get()), v0_1));
                }
            } else {
                int v7_1 = ((com.millennialmedia.android.MMWebView) this.webViewRef.get());
                if (v7_1 != 0) {
                    com.millennialmedia.android.MMJSObject v4_1 = ((com.millennialmedia.android.MMJSObject) this.cls.newInstance());
                    v4_1.setContext(v7_1.getContext());
                    v4_1.setMMWebView(v7_1);
                    v7_1.updateArgumentsWithSettings(this.arguments);
                    com.millennialmedia.android.MMCommand$1 v9_27 = this.method;
                    String v10_9 = new Object[1];
                    v10_9[0] = this.arguments;
                    com.millennialmedia.android.MMJSResponse v5_1 = ((com.millennialmedia.android.MMJSResponse) v9_27.invoke(v4_1, v10_9));
                    if ((this.callback != null) && (this.callback.length() > 0)) {
                        com.millennialmedia.android.MMWebView v8_3 = ((com.millennialmedia.android.MMWebView) this.webViewRef.get());
                        if (v8_3 != null) {
                            if (v5_1 == null) {
                                v5_1 = com.millennialmedia.android.MMJSResponse.responseWithError(this.method.getName());
                            }
                            if (v5_1.methodName == null) {
                                v5_1.methodName = this.method.getName();
                            }
                            if (v5_1.className == null) {
                                v5_1.className = this.getBridgeStrippedClassName();
                            }
                            String v10_1 = new Object[2];
                            v10_1[0] = this.callback;
                            v10_1[1] = v5_1.toJSONString();
                            String v0_0 = String.format("javascript:%s(%s);", v10_1);
                            com.millennialmedia.android.MMSDK$Log.v(new StringBuilder().append("Executing JS bridge callback: ").append(v0_0).toString());
                            com.millennialmedia.android.MMSDK.runOnUiThread(new com.millennialmedia.android.MMCommand$1(this, v8_3, v0_0));
                        }
                    }
                }
            }
        } catch (Exception v1) {
            String v10_6 = new Object[2];
            v10_6[0] = this.method.toString();
            v10_6[1] = v1.getMessage();
            com.millennialmedia.android.MMSDK$Log.e("Exception while executing javascript call %s %s", v10_6);
            v1.printStackTrace();
        }
        return;
    }