Search in sources :

Example 21 with HookAnnotation

use of com.kunpeng.pit.HookAnnotation in project GT by Tencent.

the class ViewBuildHookList method inflate.

/**
 * View构建相关: *
 */
@HookAnnotation(className = "android.view.LayoutInflater", methodName = "inflate", methodSig = "(ILandroid/view/ViewGroup;)Landroid/view/View;")
public static View inflate(Object thiz, int resource, ViewGroup root) {
    GTRLog.e(TAG, "LayoutInflater.inflate");
    String resourceName = "未知";
    if (GTRCollector.applicationContext != null) {
        try {
            resourceName = GTRCollector.applicationContext.getResources().getResourceName(resource);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    long start = System.currentTimeMillis();
    View view = inflate_backup(thiz, resource, root);
    long end = System.currentTimeMillis();
    GTRClient.pushData(new StringBuilder().append("LayoutInflater.inflate").append(GTConfig.separator).append(resourceName).append(GTConfig.separator).append(start).append(GTConfig.separator).append(end).toString());
    return view;
}
Also used : View(android.view.View) HookAnnotation(com.kunpeng.pit.HookAnnotation)

Example 22 with HookAnnotation

use of com.kunpeng.pit.HookAnnotation in project GT by Tencent.

the class FragmentHookList method performStart.

@HookAnnotation(className = "android.app.Fragment", methodName = "performStart", methodSig = "()V")
public static void performStart(Object thiz) {
    GTRLog.e(TAG, "performStart");
    long start = System.currentTimeMillis();
    performStart_backup(thiz);
    long end = System.currentTimeMillis();
    String activityClassName = "";
    String activityHashCode = "";
    String fragmentClassName = "";
    String fragmentHashCode = "";
    Object fragment = thiz;
    if (fragment instanceof android.app.Fragment) {
        fragmentClassName = ((android.app.Fragment) fragment).getClass().getName();
        fragmentHashCode = "" + thiz.hashCode();
        Activity activity = ((android.app.Fragment) fragment).getActivity();
        if (activity != null) {
            activityClassName = activity.getClass().getName();
            activityHashCode = "" + activity.hashCode();
        }
    }
    GTRClient.pushData(new StringBuilder().append("Fragment.performStart").append(GTConfig.separator).append(activityClassName).append(GTConfig.separator).append(activityHashCode).append(GTConfig.separator).append(fragmentClassName).append(GTConfig.separator).append(fragmentHashCode).append(GTConfig.separator).append(start).append(GTConfig.separator).append(end).toString());
}
Also used : Activity(android.app.Activity) HookAnnotation(com.kunpeng.pit.HookAnnotation)

Example 23 with HookAnnotation

use of com.kunpeng.pit.HookAnnotation in project GT by Tencent.

the class FragmentHookList method onAttach.

/**
 * Fragment 生命周期: *
 */
@HookAnnotation(className = "android.app.Fragment", methodName = "onAttach", methodSig = "(Landroid/content/Context;)V")
public static void onAttach(Object thiz, Context context) {
    GTRLog.e(TAG, "onAttach");
    long start = System.currentTimeMillis();
    onAttach_backup(thiz, context);
    long end = System.currentTimeMillis();
    String activityClassName = "";
    String activityHashCode = "";
    String fragmentClassName = "";
    String fragmentHashCode = "";
    Object fragment = thiz;
    if (fragment instanceof android.app.Fragment) {
        fragmentClassName = ((android.app.Fragment) fragment).getClass().getName();
        fragmentHashCode = "" + thiz.hashCode();
        Activity activity = ((android.app.Fragment) fragment).getActivity();
        if (activity != null) {
            activityClassName = activity.getClass().getName();
            activityHashCode = "" + activity.hashCode();
        }
    }
    GTRClient.pushData(new StringBuilder().append("Fragment.onAttach").append(GTConfig.separator).append(activityClassName).append(GTConfig.separator).append(activityHashCode).append(GTConfig.separator).append(fragmentClassName).append(GTConfig.separator).append(fragmentHashCode).append(GTConfig.separator).append(start).append(GTConfig.separator).append(end).toString());
}
Also used : Activity(android.app.Activity) HookAnnotation(com.kunpeng.pit.HookAnnotation)

Example 24 with HookAnnotation

use of com.kunpeng.pit.HookAnnotation in project GT by Tencent.

the class FragmentHookList method performDestroyView.

@HookAnnotation(className = "android.app.Fragment", methodName = "performDestroyView", methodSig = "()V")
public static void performDestroyView(Object thiz) {
    GTRLog.e(TAG, "performDestroyView");
    long start = System.currentTimeMillis();
    performDestroyView_backup(thiz);
    long end = System.currentTimeMillis();
    String activityClassName = "";
    String activityHashCode = "";
    String fragmentClassName = "";
    String fragmentHashCode = "";
    Object fragment = thiz;
    if (fragment instanceof android.app.Fragment) {
        fragmentClassName = ((android.app.Fragment) fragment).getClass().getName();
        fragmentHashCode = "" + thiz.hashCode();
        Activity activity = ((android.app.Fragment) fragment).getActivity();
        if (activity != null) {
            activityClassName = activity.getClass().getName();
            activityHashCode = "" + activity.hashCode();
        }
    }
    GTRClient.pushData(new StringBuilder().append("Fragment.performDestroyView").append(GTConfig.separator).append(activityClassName).append(GTConfig.separator).append(activityHashCode).append(GTConfig.separator).append(fragmentClassName).append(GTConfig.separator).append(fragmentHashCode).append(GTConfig.separator).append(start).append(GTConfig.separator).append(end).toString());
}
Also used : Activity(android.app.Activity) HookAnnotation(com.kunpeng.pit.HookAnnotation)

Example 25 with HookAnnotation

use of com.kunpeng.pit.HookAnnotation in project GT by Tencent.

the class FragmentHookList method performPause.

@HookAnnotation(className = "android.app.Fragment", methodName = "performPause", methodSig = "()V")
public static void performPause(Object thiz) {
    GTRLog.e(TAG, "performPause");
    long start = System.currentTimeMillis();
    performPause_backup(thiz);
    long end = System.currentTimeMillis();
    String activityClassName = "";
    String activityHashCode = "";
    String fragmentClassName = "";
    String fragmentHashCode = "";
    Object fragment = thiz;
    if (fragment instanceof android.app.Fragment) {
        fragmentClassName = ((android.app.Fragment) fragment).getClass().getName();
        fragmentHashCode = "" + thiz.hashCode();
        Activity activity = ((android.app.Fragment) fragment).getActivity();
        if (activity != null) {
            activityClassName = activity.getClass().getName();
            activityHashCode = "" + activity.hashCode();
        }
    }
    GTRClient.pushData(new StringBuilder().append("Fragment.performPause").append(GTConfig.separator).append(activityClassName).append(GTConfig.separator).append(activityHashCode).append(GTConfig.separator).append(fragmentClassName).append(GTConfig.separator).append(fragmentHashCode).append(GTConfig.separator).append(start).append(GTConfig.separator).append(end).toString());
}
Also used : Activity(android.app.Activity) HookAnnotation(com.kunpeng.pit.HookAnnotation)

Aggregations

HookAnnotation (com.kunpeng.pit.HookAnnotation)30 Activity (android.app.Activity)26 View (android.view.View)3 Instrumentation (android.app.Instrumentation)1 ActivityResult (android.app.Instrumentation.ActivityResult)1 Cursor (android.database.Cursor)1 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)1