Search in sources :

Example 1 with HookAnnotation

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

the class ActivityHookList method execStartActivity.

/**
 * Activity 的开始+生命周期: *
 */
@HookAnnotation(className = "android.app.Instrumentation", methodName = "execStartActivity", methodSig = "(Landroid/content/Context;" + "Landroid/os/IBinder;" + "Landroid/os/IBinder;" + "Landroid/app/Activity;" + "Landroid/content/Intent;" + "ILandroid/os/Bundle;)" + "Landroid/app/Instrumentation$ActivityResult;")
public static ActivityResult execStartActivity(Object thiz, Context who, IBinder contextThread, IBinder token, Activity target, Intent intent, int requestCode, Bundle options) {
    GTRLog.e(TAG, "Instrumentation.execStartActivity");
    long start = System.currentTimeMillis();
    Instrumentation.ActivityResult activityResult = execStartActivity_backup(thiz, who, contextThread, token, target, intent, requestCode, options);
    long end = System.currentTimeMillis();
    GTRClient.pushData(new StringBuilder().append("Instrumentation.execStartActivity").append(GTConfig.separator).append(start).append(GTConfig.separator).append(end).toString());
    return activityResult;
}
Also used : ActivityResult(android.app.Instrumentation.ActivityResult) Instrumentation(android.app.Instrumentation) HookAnnotation(com.kunpeng.pit.HookAnnotation)

Example 2 with HookAnnotation

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

the class FragmentHookList method performDetach.

@HookAnnotation(className = "android.app.Fragment", methodName = "performDetach", methodSig = "()V")
public static void performDetach(Object thiz) {
    GTRLog.e(TAG, "performDetach");
    long start = System.currentTimeMillis();
    performDetach_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.performDetach").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 3 with HookAnnotation

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

the class FragmentHookList method performDestroy.

@HookAnnotation(className = "android.app.Fragment", methodName = "performDestroy", methodSig = "()V")
public static void performDestroy(Object thiz) {
    GTRLog.e(TAG, "performDestroy");
    long start = System.currentTimeMillis();
    performDestroy_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.performDestroy").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 4 with HookAnnotation

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

the class FragmentHookList method performCreate.

@HookAnnotation(className = "android.app.Fragment", methodName = "performCreate", methodSig = "(Landroid/os/Bundle;)V")
public static void performCreate(Object thiz, Bundle savedInstanceState) {
    GTRLog.e(TAG, "performCreate");
    long start = System.currentTimeMillis();
    performCreate_backup(thiz, savedInstanceState);
    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.performCreate").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 5 with HookAnnotation

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

the class FragmentHookList method performResume.

@HookAnnotation(className = "android.app.Fragment", methodName = "performResume", methodSig = "()V")
public static void performResume(Object thiz) {
    GTRLog.e(TAG, "performResume");
    long start = System.currentTimeMillis();
    performResume_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.performResume").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