酷狗概念版 v2.5.5版本的 MD5 值为:782d327088fca4e58310f35a56f41319

以下内容为反编译后的 d.java 源代码,内容仅作参考


package com.kugou.common.base.e;

import android.app.Activity;
import android.graphics.Rect;
import android.os.SystemClock;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import com.kugou.common.base.AbsFrameworkFragment;
import com.kugou.common.base.MainFragmentContainer;
import com.kugou.common.base.g;
import com.kugou.common.base.w;
import com.kugou.common.utils.ao;
import com.kugou.common.utils.as;
import com.kugou.common.widget.CommonLoadingView;
import com.kugou.datashow.utils.f;
import java.util.ArrayList;

public class d {
    public static String a(Class cls, View view) {
        w wVar;
        int i;
        AbsFrameworkFragment[] absFrameworkFragmentArr;
        String[] split;
        AbsFrameworkFragment a2;
        StringBuilder sb = new StringBuilder();
        StringBuilder sb2 = new StringBuilder();
        sb2.append("/");
        try {
            wVar = g.c();
        } catch (Exception e2) {
            as.e(e2);
            sb2.append(-1);
            wVar = null;
        }
        if (wVar != null && (absFrameworkFragmentArr = wVar.f47591a) != null) {
            int length = absFrameworkFragmentArr.length - 1;
            View view2 = null;
            int i2 = 528178838;
            int i3 = -1;
            boolean z = true;
            for (int i4 = 0; i4 <= length; i4++) {
                AbsFrameworkFragment absFrameworkFragment = absFrameworkFragmentArr[i4];
                if (i4 != length || (absFrameworkFragment != null && !absFrameworkFragment.isLeaving())) {
                    if (absFrameworkFragment != null) {
                        view2 = absFrameworkFragment.getView();
                        if (view2 != null) {
                            i2 = a(view2);
                        }
                        if (i2 == 528178838) {
                            i2 = a(absFrameworkFragment);
                        }
                        if ((absFrameworkFragment instanceof MainFragmentContainer) && length >= 0 && (a2 = ((MainFragmentContainer) absFrameworkFragment).a()) != null) {
                            View view3 = a2.getView();
                            if (view3 != null) {
                                i3 = a(view3);
                            }
                            if (i3 == 528178838) {
                                i3 = a(a2);
                            }
                        }
                    }
                    if (z) {
                        sb2.append(i2);
                        z = false;
                    } else {
                        sb2.append("/");
                        sb2.append(i2);
                    }
                    if (i3 > 0) {
                        sb2.append("/");
                        sb2.append(i3);
                        i3 = -1;
                    }
                    if (as.f54365e) {
                        if (absFrameworkFragment != null) {
                            view2 = absFrameworkFragment.getView();
                        }
                        String str = "null";
                        if (view2 == null) {
                            sb.append("null");
                        } else {
                            String f = f(view2);
                            if (f != null) {
                                String[] split2 = f.split("\\.");
                                str = split2.length > 0 ? split2[split2.length - 1] : f;
                            }
                            if (!TextUtils.isEmpty(str) && (split = str.split("\\.")) != null && split.length > 0) {
                                str = split[split.length - 1];
                            }
                            sb.append("/" + str);
                        }
                    }
                }
            }
            i = a(view);
            if (i == 528178838) {
                i = a(cls);
            }
            if (i != 528178838 && i != i2) {
                sb2.append("/");
                sb2.append(i);
            }
        }
        i = 528178838;
        sb2.append("/");
        if (as.f54365e) {
            as.b("burone-source-id", "PageId.nameStack = " + sb.toString() + "\nPageId.idStack   = " + sb2.toString() + "\nPageId.currentId = " + i + "\nPageId.currentNm = " + cls.getSimpleName() + "\n ");
        }
        return sb2.toString();
    }

    public static void b(@NonNull Class cls, @NonNull View view) {
        c cVar = (c) cls.getAnnotation(c.class);
        if (cVar != null) {
            view.setTag(805306114, Integer.valueOf(cVar.a()));
        } else if (as.f54365e && !b.a().b(cls.getName()) && !b.a().a(cls.getName())) {
            ao.a(cls.getName() + "没有添加PageInfoAnnotation注解,请先添加注解。添加注解参考: http://kgmedit.kugou.net/wiki/android/?incsub_wiki=%E7%BA%A2%E8%8F%8A%E7%8E%87%E4%B8%8A%E6%8A%A5%E4%BD%BF%E7%94%A8%E6%96%87%E6%A1%A3");
        }
        view.setTag(805306113, cls.getName());
        view.setTag(805306115, Long.valueOf(SystemClock.elapsedRealtime()));
        view.setTag(805306116, a(cls, view));
    }

    public static String e(View view) {
        if (view != null) {
            return (String) view.getTag(805306116);
        }
        return null;
    }

    public static int a(View view) {
        Object parent;
        while (view != null && (parent = view.getParent()) != null) {
            Object tag = view.getTag(805306114);
            if (tag != null && (tag instanceof Integer)) {
                return ((Integer) tag).intValue();
            }
            if (!(parent instanceof View)) {
                break;
            }
            view = (View) parent;
        }
        return 528178838;
    }

    public static int a(Fragment fragment) {
        return a(fragment.getClass());
    }

    public static int a(Activity activity) {
        return a(activity.getClass());
    }

    private static int a(Class cls) {
        c cVar = (c) cls.getAnnotation(c.class);
        if (cVar != null) {
            return cVar.a();
        }
        return 528178838;
    }

    public static int a(CommonLoadingView commonLoadingView) {
        ArrayList<View> a2 = f.a();
        if (a2 == null || a2.size() < 2) {
            return 528178838;
        }
        View[] viewArr = new View[1];
        a(a2.get(a2.size() - 2), viewArr, d(commonLoadingView));
        return a(viewArr[0]);
    }

    private static boolean a(View view, View[] viewArr, Rect rect) {
        boolean z;
        boolean z2;
        if (view == null || !(view instanceof ViewGroup)) {
            return false;
        }
        ViewGroup viewGroup = (ViewGroup) view;
        int childCount = viewGroup.getChildCount();
        loop0: while (true) {
            z = false;
            while (true) {
                childCount--;
                if (childCount < 0 || z) {
                    break loop0;
                }
                View childAt = viewGroup.getChildAt(childCount);
                if (childAt.getVisibility() != 8) {
                    if (childAt.isClickable() || childAt.isLongClickable()) {
                        Rect d2 = d(childAt);
                        if (d2.contains(rect) || d2.intersect(rect)) {
                            viewArr[0] = childAt;
                            z2 = true;
                        }
                    } else {
                        z2 = false;
                    }
                    if (a(childAt, viewArr, rect) || z2) {
                        z = true;
                    }
                }
            }
        }
        return z;
    }

    private static Rect d(View view) {
        Rect rect = new Rect();
        if (view != null) {
            int[] iArr = new int[2];
            view.getDrawingRect(rect);
            view.getLocationOnScreen(iArr);
            rect.offset(iArr[0], iArr[1]);
        }
        return rect;
    }

    public static String f(View view) {
        Object parent;
        while (view != null && (parent = view.getParent()) != null) {
            Object tag = view.getTag(805306113);
            if (tag != null && (tag instanceof String)) {
                return (String) tag;
            }
            if (!(parent instanceof View)) {
                break;
            }
            view = (View) parent;
        }
        return null;
    }

    public static long b(View view) {
        while (view != null) {
            Object parent = view.getParent();
            if (parent == null) {
                return 0L;
            }
            Object tag = view.getTag(805306115);
            if (tag != null && (tag instanceof Long)) {
                return ((Long) tag).longValue();
            }
            if (!(parent instanceof View)) {
                return 0L;
            }
            view = (View) parent;
        }
        return 0L;
    }

    public static boolean c(View view) {
        while (view != null) {
            Object parent = view.getParent();
            if (parent == null) {
                return false;
            }
            if (!(parent instanceof View)) {
                return true;
            }
            view = (View) parent;
        }
        return false;
    }
}