public static void fix(Activity activity) {

        if (android.os.Build.VERSION.SDK_INT != 26){
            return;
        }

        try {
            int[] styleableRes = (int[]) ReflectUtils.getClass("com.android.internal.R$styleable").getField("Window").get(null);
            final TypedArray ta = activity.obtainStyledAttributes(styleableRes);
            Method m = ActivityInfo.class.getMethod("isTranslucentOrFloating", TypedArray.class);
            m.setAccessible(true);
            boolean isTranslucentOrFloating = (boolean) m.invoke(null, ta);
            m.setAccessible(false);

            LogDebug.d(TAG, "activity create before: " + activity.getClass().getName() + " isTranslucentOrFloating =" + isTranslucentOrFloating);

            if (!isTranslucentOrFloating) {
                return;
            }

            Field field = Activity.class.getDeclaredField("mActivityInfo");
            field.setAccessible(true);
            ActivityInfo o = (ActivityInfo) field.get(activity);
            o.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
            field.setAccessible(false);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
@Description: Only fullscreen opaque activities can request orientation
replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/utils/FixOTranslucentOrientation.java