package com.tencent.mm.app;

import android.content.Intent;
import android.os.Message;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.ytcommon.BuildConfig;
import java.lang.reflect.Field;

public final class o$a {
    private static boolean ceZ = false;
    private static Class cfa;
    private static Field cfb;
    private static Class cfc;
    private static Field cfd;

    public static String h(Message message) {
        AppMethodBeat.i(137991);
        if (!ceZ) {
            try {
                Class cls = Class.forName("android.app.ActivityThread$ReceiverData");
                cfa = cls;
                Field declaredField = cls.getDeclaredField("intent");
                cfb = declaredField;
                declaredField.setAccessible(true);
                cls = Class.forName("android.app.ActivityThread$CreateServiceData");
                cfc = cls;
                declaredField = cls.getDeclaredField("intent");
                cfd = declaredField;
                declaredField.setAccessible(true);
                ceZ = true;
            } catch (Throwable th) {
                ab.printErrStackTrace("MicroMsg.PreventAccountNotReady", th, BuildConfig.FLAVOR, new Object[0]);
            }
        }
        if (ceZ) {
            Intent intent;
            try {
                if (cfa.isInstance(message.obj)) {
                    intent = (Intent) cfb.get(message.obj);
                } else {
                    if (cfc.isInstance(message.obj)) {
                        intent = (Intent) cfd.get(message.obj);
                    }
                    intent = null;
                }
            } catch (Throwable th2) {
                ab.printErrStackTrace("MicroMsg.PreventAccountNotReady", th2, BuildConfig.FLAVOR, new Object[0]);
            }
            if (intent != null) {
                String className = intent.getComponent().getClassName();
                AppMethodBeat.o(137991);
                return className;
            }
            AppMethodBeat.o(137991);
            return null;
        }
        AppMethodBeat.o(137991);
        return null;
    }
}
