11 |
12 |
13 | @protocol GTPopoverTouchesDelegate
14 |
15 | @optional
16 | - (void)view:(UIView*)view touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event;
17 |
18 | @end
19 | #endif
20 |
--------------------------------------------------------------------------------
/android/GT_SDK/yhook/src/test/java/lab/galaxy/yahfa/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package lab.galaxy.yahfa;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/java/com/gtr/test/MyApplication.java:
--------------------------------------------------------------------------------
1 | package com.gtr.test;
2 |
3 | import android.app.Application;
4 |
5 | import com.tencent.wstt.gt.controller.GTRController;
6 |
7 | /**
8 | * Created by elvis on 2016/11/19.
9 | * 自定义Application
10 | */
11 | public class MyApplication extends Application {
12 |
13 | @Override
14 | public void onCreate() {
15 | super.onCreate();
16 |
17 | // GTRLog.isOpen = true;
18 | GTRController.init(getApplicationContext());
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/analysis4/obj/PageLoadState.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.analysis4.obj;
2 |
3 | /**
4 | * Created by p_hongjcong on 2017/7/31.
5 | *
6 | * 代表页面切换的区间
7 | *
8 | */
9 |
10 | public class PageLoadState {
11 |
12 | public long time;
13 | public boolean isLoad;
14 |
15 | public PageLoadState(){
16 | }
17 |
18 | public PageLoadState(long time,boolean isLoad){
19 | this.time = time;
20 | this.isLoad = isLoad;
21 | }
22 |
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/src/main/java/com/tencent/wstt/gt/datatool/obj/PageLoadState.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.datatool.obj;
2 |
3 | /**
4 | * Created by p_hongjcong on 2017/7/31.
5 | *
6 | * 代表页面切换的区间
7 | */
8 |
9 | public class PageLoadState {
10 |
11 | public long time;
12 | public boolean isLoad;
13 |
14 | public PageLoadState() {
15 | }
16 |
17 | public PageLoadState(long time, boolean isLoad) {
18 | this.time = time;
19 | this.isLoad = isLoad;
20 | }
21 |
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/src/test/java/brian/com/datatool/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package brian.com.datatool;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/android/GT_SDK/gtrsdk/src/main/java/com/tencent/wstt/gt/collector/monitor/yhook/WhiteList.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.collector.monitor.yhook;
2 |
3 | import android.os.Build;
4 |
5 | /**
6 | * @author p_xcli
7 | * Created on 2018/1/20.
8 | */
9 |
10 | public class WhiteList {
11 | /**
12 | * Whether the OS is powered by YunOS,
13 | * the list is still far from being completed.
14 | * @return
15 | */
16 | public static boolean isYunOS() {
17 | return Build.DISPLAY.startsWith("Flyme");
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/test/java/com/example/p_svengong/gt_kp/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.p_svengong.gt_kp;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/dao/DetailListData.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.dao;
2 |
3 | /**
4 | * Created by p_hongjcong on 2017/8/28.
5 | */
6 |
7 | public class DetailListData {
8 |
9 | public static final int Normal =0;
10 | public static final int Warning =1;
11 | public static final int Error =2;
12 |
13 | public String string;
14 | public int type;
15 |
16 | public DetailListData(String string,int type){
17 | this.string = string;
18 | this.type = type;
19 | }
20 |
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/analysis4/obj/DBInfo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.analysis4.obj;
2 |
3 |
4 | /**
5 | * Created by p_hongjcong on 2017/6/28.
6 | *
7 | */
8 |
9 | public class DBInfo {
10 |
11 | public int dbHashCode = 0;
12 | public String dbPath = "";
13 | public String dbName = "";
14 |
15 | public String actionName = "";
16 | public String sql = "";
17 | public long startTime = 0;
18 | public long endTime = 0;
19 |
20 | public String threadName = "";
21 | public int threadId = -1;
22 |
23 |
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/analysis4/obj/DBActionInfo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.analysis4.obj;
2 |
3 |
4 | /**
5 | * Created by p_hongjcong on 2017/6/28.
6 | *
7 | */
8 |
9 | public class DBActionInfo {
10 |
11 | public int dbHashCode = 0;
12 | public String dbPath = "";
13 | public String dbName = "";
14 |
15 | public String actionName = "";
16 | public String sql = "";
17 | public long startTime = 0;
18 | public long endTime = 0;
19 |
20 | public String threadName = "";
21 | public int threadId = -1;
22 |
23 |
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/src/main/java/com/tencent/wstt/gt/datatool/obj/DBInfo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.datatool.obj;
2 |
3 |
4 | /**
5 | * Created by p_hongjcong on 2017/6/28.
6 | */
7 |
8 | public class DBInfo {
9 |
10 | public int dbHashCode = 0;
11 | public String dbPath = "";
12 | public String dbName = "";
13 |
14 | public String actionName = "";
15 | public String sql = "";
16 | public long startTime = 0;
17 | public long endTime = 0;
18 |
19 | public String threadName = "";
20 | public int threadId = -1;
21 |
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/android/GT_SDK/yhook/src/main/jni/common.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by liuruikai756 on 05/07/2017.
3 | //
4 | #include
5 |
6 | #ifndef YAHFA_COMMON_H
7 | #define YAHFA_COMMON_H
8 |
9 | #define LOG_TAG "YAHFA-Native"
10 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
11 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)
12 | #define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__)
13 | #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
14 |
15 | #endif //YAHFA_COMMON_H
16 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/src/main/java/com/tencent/wstt/gt/datatool/obj/DBActionInfo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.datatool.obj;
2 |
3 |
4 | /**
5 | * Created by p_hongjcong on 2017/6/28.
6 | */
7 |
8 | public class DBActionInfo {
9 |
10 | public int dbHashCode = 0;
11 | public String dbPath = "";
12 | public String dbName = "";
13 |
14 | public String actionName = "";
15 | public String sql = "";
16 | public long startTime = 0;
17 | public long endTime = 0;
18 |
19 | public String threadName = "";
20 | public int threadId = -1;
21 |
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/APT_Eclipse_Plugin/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/APT_Eclipse_Plugin/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Bundle-ManifestVersion: 2
3 | Bundle-Name: APT_Eclipse_Plugin
4 | Bundle-SymbolicName: APT_Eclipse_Plugin;singleton:=true
5 | Bundle-Version: 1.1.9
6 | Bundle-Activator: com.tencent.wstt.apt.Activator
7 | Require-Bundle: org.eclipse.ui,
8 | org.eclipse.core.runtime,
9 | org.eclipse.ui.console;bundle-version="3.5.100"
10 | Bundle-ActivationPolicy: lazy
11 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6
12 | Bundle-ClassPath: .,
13 | libs/jcommon-1.0.17.jar,
14 | libs/jfreechart-1.0.14.jar,
15 | libs/ddmlib-r16.jar
16 | Bundle-Vendor: com.tencent.wstt
17 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/res/layout/gtr_item_detail_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/src/main/java/com/tencent/wstt/gt/datatool/obj/DrawInfo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.datatool.obj;
2 |
3 | /**
4 | * 视图的一次完整绘制(包含了子视图的绘制)
5 | * Created by elvis on 2017/1/22.
6 | */
7 |
8 | public class DrawInfo {
9 |
10 |
11 | //绘制属性
12 | public String drawClassName = "";//当前绘制类名(包含包名)
13 | public String objectHashCode = "";//当前绘制的对象名(包含包名和对象地址)
14 | public long drawBegin = 0;
15 | public long drawEnd = 0;
16 | public int drawDeep = 0;
17 | public String drawPath = "";
18 | //Activty相关
19 | public int drawOrderId = 0;//当前是页面的第几次绘制
20 |
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/ios/GT/Sources/Kit/Common/Controller/popview/GTPopoverSearchView.h:
--------------------------------------------------------------------------------
1 | //
2 | // GTPopoverSearchView.h
3 | // GTKit
4 | //
5 | // Created on 13-4-3.
6 | // Copyright (c) 2013年 Tencent. All rights reserved.
7 | //
8 | #ifndef GT_DEBUG_DISABLE
9 | #import
10 |
11 | @interface GTPopoverSearchView : UITableViewController
12 | {
13 | UITextField *_textField;
14 | NSMutableArray *_list;
15 | }
16 |
17 | @property (nonatomic, retain) UITextField *textField;
18 | @property (nonatomic, retain) NSMutableArray *list;
19 |
20 |
21 | - (id)initWithArray:(NSMutableArray *)array;
22 |
23 | @end
24 | #endif
25 |
--------------------------------------------------------------------------------
/android/GT_SDK/gtrsdk/src/main/java/com/tencent/wstt/gt/Env.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt;
2 |
3 | import android.os.Environment;
4 |
5 | import java.io.File;
6 |
7 | public class Env {
8 | public static String GT_SERVICE_PACKAGE = "com.tencent.wstt.gt";
9 | public static String GT_SERVICE_ACTION = "GTR.GTRService";
10 | public static String GTR_SERVICE_NAME = "com.tencent.wstt.gt.service.GTRService";
11 |
12 | public static String STORAGE_PATH = Environment.getExternalStorageDirectory().getAbsolutePath();
13 | public static String GTR_CONFIG_PATH = STORAGE_PATH + File.separator + "GTR/config/";
14 | }
15 |
--------------------------------------------------------------------------------
/APT_Eclipse_Plugin/contexts.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | This is the context help for the sample view with a table viewer. It was generated by a PDE template.
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/share/AppRegisterToWX.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.share;
2 |
3 | import android.content.BroadcastReceiver;
4 | import android.content.Context;
5 | import android.content.Intent;
6 |
7 | import com.tencent.mm.opensdk.openapi.IWXAPI;
8 | import com.tencent.mm.opensdk.openapi.WXAPIFactory;
9 |
10 | public class AppRegisterToWX extends BroadcastReceiver {
11 |
12 | @Override
13 | public void onReceive(Context context, Intent intent) {
14 | final IWXAPI api = WXAPIFactory.createWXAPI(context, null);
15 |
16 | // 将该app注册到微信
17 | api.registerApp(Constants.APP_ID);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/res/layout/activity_test_file.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/log/logcat/LogcatReader.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.log.logcat;
2 |
3 | import java.io.IOException;
4 | import java.util.List;
5 |
6 | public interface LogcatReader {
7 |
8 | /**
9 | * Read a single log line, ala BufferedReader.readLine().
10 | * @return
11 | * @throws IOException
12 | */
13 | public String readLine() throws IOException;
14 |
15 | /**
16 | * Kill the reader and close all resources without throwing any exceptions.
17 | */
18 | public void killQuietly();
19 |
20 | public boolean readyToRecord();
21 |
22 | public List getProcesses();
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/src/main/java/com/tencent/wstt/gt/datatool/obj/DeviceInfo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.datatool.obj;
2 |
3 | import java.util.HashMap;
4 |
5 | public class DeviceInfo {
6 |
7 |
8 | public String vendor;
9 | public String model;
10 |
11 | public String sdkName;
12 | public int sdkInt;
13 |
14 |
15 | //蓝牙版本:bluetoothVersion
16 | //内存大小:ramSize
17 | //传感器列表:sensors(格式:{typeID,sensorName;typeID,sensorName...})
18 | //GPU版本:gpuVersion
19 | //GPU厂商:gpuVendor
20 | //GPU提供商:gpuRender
21 | //...
22 | public HashMap hardwareInfos = new HashMap<>();
23 |
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/res/layout/activity_test_operation.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/analysis4/obj/DrawInfo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.analysis4.obj;
2 |
3 | /**
4 | * 视图的一次完整绘制(包含了子视图的绘制)
5 | * Created by elvis on 2017/1/22.
6 | */
7 |
8 | public class DrawInfo {
9 |
10 |
11 | //绘制属性
12 | public String drawClassName = "";//当前绘制类名(包含包名)
13 | public String objectHashCode = "";//当前绘制的对象名(包含包名和对象地址)
14 | public long drawBegin = 0;
15 | public long drawEnd = 0;
16 | public int drawDeep= 0;
17 | public String drawPath = "";
18 | //Activty相关
19 | public int drawOrderId = 0;//当前是页面的第几次绘制
20 |
21 |
22 |
23 |
24 |
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/APT_Eclipse_Plugin/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5 | org.eclipse.jdt.core.compiler.compliance=1.6
6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11 | org.eclipse.jdt.core.compiler.source=1.6
12 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/res/layout/activity_test_db.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/android/GT_SDK/yhook/src/main/jni/trampoline.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by liuruikai756 on 05/07/2017.
3 | //
4 |
5 | #ifndef YAHFA_TAMPOLINE_H
6 | #define YAHFA_TAMPOLINE_H
7 |
8 | extern unsigned int hookCap; // capacity for trampolines
9 | extern unsigned int hookCount; // current count of used trampolines
10 |
11 | extern unsigned char trampoline1[];
12 | extern unsigned char trampoline2[];
13 |
14 | int doInitHookCap(unsigned int cap);
15 |
16 | void *genTrampoline1(void *hookMethod);
17 |
18 | void *genTrampoline2(void *originMethod, void *entryPoint);
19 |
20 | #define DEFAULT_CAP 64 //size of each trampoline area would be no more than 4k Bytes(one page)
21 |
22 | #endif //YAHFA_TAMPOLINE_H
23 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/java/com/gtr/test/Test_Operation_Activity.java:
--------------------------------------------------------------------------------
1 | package com.gtr.test;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 | import android.view.KeyEvent;
6 |
7 | import com.tencent.wstt.gtr.sdkdemo.R;
8 |
9 | public class Test_Operation_Activity extends Activity {
10 |
11 |
12 |
13 | @Override
14 | protected void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 | setContentView(R.layout.activity_test_operation);
17 |
18 | }
19 |
20 |
21 |
22 | @Override
23 | public boolean onKeyDown(int keyCode, KeyEvent event) {
24 | return super.onKeyDown(keyCode, event);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/analysis4/obj/DeviceInfo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.analysis4.obj;
2 |
3 | import java.util.HashMap;
4 |
5 | public class DeviceInfo {
6 |
7 |
8 | public String vendor;
9 | public String model;
10 |
11 | public String sdkName;
12 | public int sdkInt;
13 |
14 |
15 | //蓝牙版本:bluetoothVersion
16 | //内存大小:ramSize
17 | //传感器列表:sensors(格式:{typeID,sensorName;typeID,sensorName...})
18 | //GPU版本:gpuVersion
19 | //GPU厂商:gpuVendor
20 | //GPU提供商:gpuRender
21 | //...
22 | public HashMap hardwareInfos = new HashMap<>();
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/java/com/gtr/test/Test_ViewBuild_Activity.java:
--------------------------------------------------------------------------------
1 | package com.gtr.test;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 |
8 | import com.tencent.wstt.gtr.sdkdemo.R;
9 |
10 | public class Test_ViewBuild_Activity extends Activity {
11 |
12 |
13 |
14 | @Override
15 | protected void onCreate(Bundle savedInstanceState) {
16 | super.onCreate(savedInstanceState);
17 | setContentView(R.layout.activity_test_viewbuild);
18 |
19 | LayoutInflater inflater = getLayoutInflater();
20 | View v = inflater.inflate(R.layout.activity_main,null);
21 |
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/res/layout/test_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/android/GTDemo/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | ext {
3 | compileSdkVersion = 26
4 | buildToolsVersion = '26.0.2'
5 | minSdkVersion = 21
6 | targetSdkVersion = 26
7 | supportLibVersion = '26.0.0+'
8 | }
9 |
10 | buildscript {
11 |
12 | repositories {
13 | jcenter()
14 | }
15 | dependencies {
16 | classpath 'com.android.tools.build:gradle:3.0.1'
17 | }
18 |
19 |
20 | }
21 |
22 | allprojects {
23 | repositories {
24 | jcenter()
25 | google()
26 | }
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/src/main/java/com/tencent/wstt/gt/datatool/obj/LifecycleMethod.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.datatool.obj;
2 |
3 | /**
4 | * Created by elvis on 2017/2/16.
5 | */
6 |
7 | public class LifecycleMethod {
8 |
9 |
10 | public static final String EXECSTART = "execStart";
11 | public static final String ONCREATE = "onCreate";
12 | public static final String ONSTART = "onStart";
13 | public static final String ONRESUME = "onResume";
14 | public static final String ONPAUSE = "onPause";
15 | public static final String ONSTOP = "onStop";
16 |
17 | public String methodName;
18 | public long methodStartTime;
19 | public long methodEndTime;
20 |
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/android/GT_SDK/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | ext {
3 | compileSdkVersion = 26
4 | buildToolsVersion = '26.0.2'
5 | minSdkVersion = 21
6 | targetSdkVersion = 26
7 | supportLibVersion = '26.0.0+'
8 | }
9 |
10 | buildscript {
11 |
12 | repositories {
13 | jcenter()
14 | }
15 | dependencies {
16 | classpath 'com.android.tools.build:gradle:3.0.1'
17 | }
18 |
19 |
20 | }
21 |
22 | allprojects {
23 | repositories {
24 | jcenter()
25 | google()
26 | }
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/android/GT_SDK/yhook/src/main/java/com/kunpeng/pit/HookAnnotation.java:
--------------------------------------------------------------------------------
1 | package com.kunpeng.pit;
2 |
3 | import java.lang.annotation.Retention;
4 | import java.lang.annotation.RetentionPolicy;
5 |
6 | /**
7 | * Created by yuchaofei on 16/3/16.
8 | */
9 | @Retention(RetentionPolicy.RUNTIME)
10 | public @interface HookAnnotation {
11 |
12 | public final static byte MATACH_EQUAL = 0x01;
13 | public final static byte MATACH_LESS = 0x02;
14 | public final static byte MATACH_GREATER = 0x04;
15 |
16 | int sdkVersion() default -1;
17 |
18 | byte sdkType() default MATACH_EQUAL;//配合sdkVersion使用
19 |
20 | String className();
21 |
22 | String methodName();
23 |
24 | String methodSig();
25 | }
26 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/aidl/com/tencent/wstt/gt/IGTR.aidl:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt;
2 |
3 | import com.tencent.wstt.gt.IRemoteClient;
4 | import com.tencent.wstt.gt.GTRParam;
5 |
6 | //GTR的通信接口,负责GTRService与GTR交换数据
7 | interface IGTR {
8 |
9 | //GTRDK从GTRService拉取数据:
10 | GTRParam pullInPara();
11 |
12 | //GTRDK向GTRService推送数据:
13 | void pushData(in String packageName, long startTestTime, int pid, String data);
14 |
15 | /**
16 | * 将当前客户端注册到GT服务,GT目前支持1个被测应用的统计,后续被测应用在
17 | * 尝试注册失败后将暂停连接GT。等待下一次连接的机会。
18 | */
19 | int register(IRemoteClient client, String cookie);
20 |
21 | void startGTRAnalysis(String packageName, int pid);
22 |
23 | void stopGTRAnalysis();
24 | }
25 |
--------------------------------------------------------------------------------
/android/GT_SDK/gtrsdk/src/main/aidl/com/tencent/wstt/gt/IGTR.aidl:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt;
2 |
3 | import com.tencent.wstt.gt.IRemoteClient;
4 | import com.tencent.wstt.gt.GTRParam;
5 |
6 | //GTR的通信接口,负责GTRService与GTR交换数据
7 | interface IGTR {
8 |
9 | //GTRDK从GTRService拉取数据:
10 | GTRParam pullInPara();
11 |
12 | //GTRDK向GTRService推送数据:
13 | void pushData(in String packageName, long startTestTime, int pid, String data);
14 |
15 | /**
16 | * 将当前客户端注册到GT服务,GT目前支持1个被测应用的统计,后续被测应用在
17 | * 尝试注册失败后将暂停连接GT。等待下一次连接的机会。
18 | */
19 | int register(IRemoteClient client, String cookie);
20 |
21 | void startGTRAnalysis(String packageName, int pid);
22 |
23 | void stopGTRAnalysis();
24 | }
25 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/src/main/java/com/tencent/wstt/gt/datatool/obj/ViewBuildInfo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.datatool.obj;
2 |
3 |
4 | /**
5 | * View创建信息(new View; inflate; setContentView)
6 | * Created by elvis on 2017/2/10.
7 | */
8 |
9 | public class ViewBuildInfo {
10 |
11 |
12 | public static final String NEWVIEW = "newView";
13 | public static final String INFLATE = "inflate";
14 | public static final String SETCONTENTVIEW = "setContentView";
15 |
16 | //页面信息:
17 | public String method = "";//构建的方式(newView; inflate; setContentView)
18 | public String viewName = "";//resourceName 或 View的className
19 | public long startTime = 0;
20 | public long endTime = 0;
21 |
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/res/layout/activity_test_block.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/analysis4/obj/LifecycleMethod.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.analysis4.obj;
2 |
3 | /**
4 | *
5 | * Created by elvis on 2017/2/16.
6 | */
7 |
8 | public class LifecycleMethod {
9 |
10 |
11 | public static final String EXECSTART = "execStart";
12 | public static final String ONCREATE = "onCreate";
13 | public static final String ONSTART = "onStart";
14 | public static final String ONRESUME = "onResume";
15 | public static final String ONPAUSE = "onPause";
16 | public static final String ONSTOP = "onStop";
17 |
18 | public String methodName;
19 | public long methodStartTime;
20 | public long methodEndTime;
21 |
22 |
23 |
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 25
5 |
6 | defaultConfig {
7 | minSdkVersion 21
8 | targetSdkVersion 25
9 | versionCode 1
10 | versionName "1.0"
11 |
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 |
14 | }
15 |
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 |
23 | }
24 |
25 | dependencies {
26 | // implementation fileTree(include: ['*.jar'], dir: 'libs')
27 | provided files('libs/fastjson-1.2.2.jar')
28 | }
29 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/analysis4/UITest.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.analysis4;
2 |
3 | /**
4 | * Created by p_hongjcong on 2017/8/14.
5 | */
6 |
7 | public class UITest {
8 | public static void testStart() {
9 | // GTRAnalysis.start(context,"com.elvis.test");
10 | }
11 |
12 | public static void testStop() {
13 | GTRAnalysis.addCallBack(new GTRAnalysisCallback(){
14 | @Override
15 | public void refreshNormalInfo(GTRAnalysisResult gtrAnalysisResult) {
16 |
17 | }
18 |
19 | @Override
20 | public void refreshDeviceInfo(GTRAnalysisResult gtrAnalysisResult) {
21 |
22 | }
23 | });
24 | }
25 |
26 |
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/analysis4/obj/ViewBuildInfo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.analysis4.obj;
2 |
3 |
4 | /**
5 | * View创建信息(new View; inflate; setContentView)
6 | * Created by elvis on 2017/2/10.
7 | */
8 |
9 | public class ViewBuildInfo {
10 |
11 |
12 |
13 | public static final String NEWVIEW = "newView";
14 | public static final String INFLATE = "inflate";
15 | public static final String SETCONTENTVIEW = "setContentView";
16 |
17 | //页面信息:
18 | public String method = "";//构建的方式(newView; inflate; setContentView)
19 | public String viewName = "";//resourceName 或 View的className
20 | public long startTime=0;
21 | public long endTime=0;
22 |
23 |
24 |
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/src/main/java/com/tencent/wstt/gt/datatool/obj/FileInfo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.datatool.obj;
2 |
3 |
4 | /**
5 | * 一条文件数据
6 | *
7 | * @author p_hongjcong
8 | */
9 | public class FileInfo {
10 |
11 | public static final String OPEN = "open";
12 | public static final String WRITE = "write";
13 | public static final String READ = "read";
14 |
15 |
16 | public int fd;//文件ID
17 | public String filePath;//文件路径
18 | public String fileName;//文件名
19 |
20 | public String actionName;//执行函数名 open、read、write
21 | public long actionStart;//执行时间
22 | public long actionEnd;//执行时间
23 | public int actionSize;//数据大小
24 |
25 | public int threadID;//执行的线程
26 | public String threadName;//执行的线程
27 |
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/java/com/gtr/test/fragment/FragmentDemo2.java:
--------------------------------------------------------------------------------
1 | package com.gtr.test.fragment;
2 |
3 | import android.app.Fragment;
4 | import android.os.Bundle;
5 | import android.support.annotation.Nullable;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | import com.tencent.wstt.gtr.sdkdemo.R;
11 |
12 | /**
13 | * Created by p_hongjcong on 2017/4/20.
14 | */
15 |
16 | public class FragmentDemo2 extends Fragment{
17 |
18 |
19 | @Nullable
20 | @Override
21 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
22 |
23 | View view = inflater.inflate(R.layout.fragment_test, null);
24 |
25 | return view;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/android/GT_APP/build.gradle:
--------------------------------------------------------------------------------
1 | import javax.tools.JavaCompiler
2 |
3 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
4 |
5 | buildscript {
6 | repositories {
7 | jcenter()
8 | google()
9 | }
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.0.1'
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | jcenter()
21 | google()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
29 | tasks.withType(JavaCompiler) {
30 | options.encoding = "UTF-8"
31 | }
32 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/src/main/java/com/tencent/wstt/gt/datatool/obj/DiskIOInfo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.datatool.obj;
2 |
3 |
4 | /**
5 | * 一条文件数据
6 | *
7 | * @author p_hongjcong
8 | */
9 | public class DiskIOInfo {
10 |
11 | public static final String OPEN = "open";
12 | public static final String WRITE = "write";
13 | public static final String READ = "read";
14 |
15 |
16 | public int fd;//文件ID
17 | public String filePath;//文件路径
18 | public String fileName;//文件名
19 |
20 | public String actionName;//执行函数名 open、read、write
21 | public long actionStart;//执行时间
22 | public long actionEnd;//执行时间
23 | public int actionSize;//数据大小
24 |
25 | public int threadID;//执行的线程
26 | public String threadName;//执行的线程
27 |
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/java/com/gtr/test/fragment/FragmentDemo1_V4.java:
--------------------------------------------------------------------------------
1 | package com.gtr.test.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import com.tencent.wstt.gtr.sdkdemo.R;
10 |
11 | /**
12 | * Created by p_hongjcong on 2017/4/20.
13 | */
14 |
15 | public class FragmentDemo1_V4 extends Fragment{
16 |
17 |
18 | @Override
19 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
20 | Bundle savedInstanceState)
21 | {
22 | View view = inflater.inflate(R.layout.fragment_test, container, false);
23 |
24 | return view;
25 | }
26 |
27 |
28 |
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/ios/横屏启动的App使用说明.txt:
--------------------------------------------------------------------------------
1 | // 注意:目前横屏启动的App大部分UI显示能兼容,如果出现UI异常的情况,请设置GT支持竖屏,并且将设备垂直放置,切换到竖屏,则可解决
2 |
3 | // 初始化步骤:
4 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
5 | {
6 | GT_DEBUG_INIT;
7 | GT_DEBUG_SET_SUPPORT_ORIENTATIONS(UIInterfaceOrientationMaskLandscape); // 只支持横屏,如果需要都支持,则此项不用设置
8 | GT_LOGO_CALL_BACK_SET(onOpenCallBack, onCloseCallBack); // 如果是横屏,则需要设置回调,来控制rootViewController的Rotate,不然UI可能会显示异常
9 | }
10 |
11 | void onOpenCallBack(void)
12 | {
13 | // rootViewController里的shouldAutorotate方法返回NO
14 | [RootViewController setSupportRotate:NO];
15 | }
16 |
17 | void onCloseCallBack(void)
18 | {
19 | // rootViewController里的shouldAutorotate方法返回YES
20 | [RootViewController setSupportRotate:YES];
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/res/layout/activity_test_fragmentv4_switch.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/jni/com_tencent_wstt_gt_api_utils_MemFillTool.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class com_tencent_wstt_gt_api_utils_MemFillTool */
4 |
5 | #ifndef _Included_com_tencent_wstt_gt_api_utils_MemFillTool
6 | #define _Included_com_tencent_wstt_gt_api_utils_MemFillTool
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | /*
11 | * Class: com_tencent_wstt_gt_api_utils_MemFillTool
12 | * Method: fillMem
13 | * Signature: (II)I
14 | */
15 | JNIEXPORT jint JNICALL Java_com_tencent_wstt_gt_api_utils_MemFillTool_fillMem
16 | (JNIEnv *, jobject, jint);
17 |
18 | JNIEXPORT jint JNICALL Java_com_tencent_wstt_gt_api_utils_MemFillTool_freeMem
19 | (JNIEnv *, jobject);
20 |
21 | #ifdef __cplusplus
22 | }
23 | #endif
24 | #endif
25 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Windows image file caches
2 | Thumbs.db
3 | ehthumbs.db
4 |
5 | # Folder config file
6 | Desktop.ini
7 |
8 | # Recycle Bin used on file shares
9 | $RECYCLE.BIN/
10 |
11 | # Windows Installer files
12 | *.cab
13 | *.msi
14 | *.msm
15 | *.msp
16 |
17 | # Windows shortcuts
18 | *.lnk
19 |
20 | # =========================
21 | # Operating System Files
22 | # =========================
23 |
24 | # OSX
25 | # =========================
26 |
27 | .DS_Store
28 | .AppleDouble
29 | .LSOverride
30 |
31 | # Thumbnails
32 | ._*
33 |
34 | # Files that might appear on external disk
35 | .Spotlight-V100
36 | .Trashes
37 |
38 | # Directories potentially created on remote AFP share
39 | .AppleDB
40 | .AppleDesktop
41 | Network Trash Folder
42 | Temporary Items
43 | .apdisk
44 |
45 | # Android sdk project files
46 | .idea
--------------------------------------------------------------------------------
/ios/GT/Sources/Kit/Common/Controller/popview/GTPopoverTouchView.m:
--------------------------------------------------------------------------------
1 | //
2 | // GTPopoverTouchView.m
3 | //
4 | // Created Saito Takashi on 5/9/12.
5 | // Copyright (c) 2012 synetics ltd. All rights reserved.
6 | //
7 | // https://github.com/takashisite/TSPopover
8 | //
9 | #ifndef GT_DEBUG_DISABLE
10 | #import "GTPopoverTouchView.h"
11 |
12 | @implementation GTPopoverTouchView
13 |
14 | @synthesize delegate = _delegate;
15 |
16 | - (id)initWithFrame:(CGRect)frame
17 | {
18 | self = [super initWithFrame:frame];
19 | if (self) {
20 | self.backgroundColor = [UIColor clearColor];
21 | }
22 | return self;
23 | }
24 |
25 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
26 | {
27 | [self.delegate view:self touchesBegan:touches withEvent:event];
28 | }
29 |
30 | @end
31 | #endif
32 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/analysis4/obj/FileInfo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.analysis4.obj;
2 |
3 |
4 |
5 |
6 | /**
7 | * 一条文件数据
8 | * @author p_hongjcong
9 | *
10 | */
11 | public class FileInfo {
12 |
13 | public static final String OPEN = "open";
14 | public static final String WRITE = "initBufferedWriter";
15 | public static final String READ = "read";
16 |
17 |
18 | public int fd;//文件ID
19 | public String filePath;//文件路径
20 | public String fileName;//文件名
21 |
22 | public String actionName;//执行函数名 open、read、initBufferedWriter
23 | public long actionStart;//执行时间
24 | public long actionEnd;//执行时间
25 | public int actionSize;//数据大小
26 |
27 | public int threadID;//执行的线程
28 | public String threadName;//执行的线程
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/analysis4/obj/DiskIOInfo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.analysis4.obj;
2 |
3 |
4 |
5 |
6 | /**
7 | * 一条文件数据
8 | * @author p_hongjcong
9 | *
10 | */
11 | public class DiskIOInfo {
12 |
13 | public static final String OPEN = "open";
14 | public static final String WRITE = "initBufferedWriter";
15 | public static final String READ = "read";
16 |
17 |
18 | public int fd;//文件ID
19 | public String filePath;//文件路径
20 | public String fileName;//文件名
21 |
22 | public String actionName;//执行函数名 open、read、initBufferedWriter
23 | public long actionStart;//执行时间
24 | public long actionEnd;//执行时间
25 | public int actionSize;//数据大小
26 |
27 | public int threadID;//执行的线程
28 | public String threadName;//执行的线程
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/jni/log.h:
--------------------------------------------------------------------------------
1 | /*
2 | * log_util.h
3 | *
4 | * Created on: 2011-12-7
5 | * Author: boyliang
6 | */
7 |
8 | #ifndef LOG_UTIL_H_
9 | #define LOG_UTIL_H_
10 |
11 | #include
12 | #include
13 |
14 | #ifdef LOG_TAG
15 | #undef LOG_TAG
16 | #endif
17 |
18 | #define LOG_TAG "LOGGER"
19 |
20 | #ifdef DEBUG
21 |
22 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
23 |
24 | #define check_value(x) \
25 | __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "%s: %p", #x, x); \
26 | if(x == NULL){ \
27 | __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, "%s was NULL", #x); \
28 | exit(0); \
29 | }
30 |
31 | #else
32 |
33 | #define check_value(x) if(0)
34 |
35 | #endif
36 |
37 | #endif /* LOG_UTIL_H_ */
38 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/src/main/java/com/tencent/wstt/gt/datatool/analysis/DeviceAnalysis.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.datatool.analysis;
2 |
3 | import com.tencent.wstt.gt.datatool.GTRAnalysis;
4 | import com.tencent.wstt.gt.datatool.obj.DeviceInfo;
5 |
6 | /**
7 | * Created by p_hongjcong on 2017/8/1.
8 | */
9 |
10 | public class DeviceAnalysis {
11 |
12 |
13 | DeviceInfo deviceInfo;
14 |
15 | public DeviceAnalysis(GTRAnalysis gtrAnalysis, DeviceInfo deviceInfo) {
16 | this.deviceInfo = deviceInfo;
17 | }
18 |
19 | public void onCollectDeviceInfo(String vendor, String model, String sdkName, int sdkInt) {
20 |
21 | deviceInfo.vendor = vendor;
22 | deviceInfo.model = model;
23 | deviceInfo.sdkName = sdkName;
24 | deviceInfo.sdkInt = sdkInt;
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/android/GT_SDK/yhook/src/main/jni/env.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by liuruikai756 on 05/07/2017.
3 | //
4 |
5 | #ifndef YAHFA_ENV_H
6 | #define YAHFA_ENV_H
7 |
8 | #define ANDROID_L 21
9 | #define ANDROID_L2 22
10 | #define ANDROID_M 23
11 | #define ANDROID_N 24
12 | #define ANDROID_N2 25
13 | #define ANDROID_O 26
14 | #define ANDROID_O2 27
15 |
16 | #define roundUpTo4(v) ((v+4-1) - ((v+4-1)&3))
17 | #define roundUpTo8(v) ((v+8-1) - ((v+8-1)&7))
18 | #if defined(__i386__) || defined(__arm__)
19 | #define pointer_size 4
20 | #define readAddr(addr) read32(addr)
21 | #define roundUpToPtrSize(x) roundUpTo4(x)
22 | #elif defined(__aarch64__)
23 | #define pointer_size 8
24 | #define readAddr(addr) read64(addr)
25 | #define roundUpToPtrSize(x) roundUpTo8(x)
26 | #else
27 | #error Unsupported architecture
28 | #endif
29 |
30 | #endif //YAHFA_ENV_H
31 |
--------------------------------------------------------------------------------
/ios/GT/Sources/Kit/Common/Controller/popview/GTPopoverPopoverView.h:
--------------------------------------------------------------------------------
1 | //
2 | // GTPopoverPopoverView.h
3 | // GTKit
4 | //
5 | // Created Saito Takashi on 5/10/12.
6 | // Copyright (c) 2012 synetics ltd. All rights reserved.
7 | //
8 | // https://github.com/takashisite/TSPopover
9 | //
10 | #ifndef GT_DEBUG_DISABLE
11 | #import
12 | #import "GTPopoverController.h"
13 |
14 | @interface GTPopoverPopoverView : UIView
15 |
16 | @property (nonatomic, assign) int cornerRadius;
17 | @property (nonatomic, assign) CGPoint arrowPoint;
18 | @property (nonatomic, assign) BOOL isGradient;
19 | @property (nonatomic, strong) UIColor *baseColor;
20 | @property (nonatomic, readwrite) GTPopoverArrowDirection arrowDirection;
21 | @property (nonatomic, readwrite) GTPopoverArrowPosition arrowPosition;
22 |
23 |
24 |
25 | @end
26 | #endif
27 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/analysis4/obj/NormalInfo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.analysis4.obj;
2 |
3 | import java.util.HashMap;
4 |
5 | /**
6 | * Created by Elvis on 2017/1/4.
7 | * Email:elvis@21kunpeng.com
8 | * 用于保存后台定时采集的数据(流量、内存、CPU、电量)
9 | */
10 |
11 | public class NormalInfo {
12 |
13 |
14 | //(cpuApp - lastCpuApp) * 100L / (cpuTotal-lastCpuTotal);//计算cpu占用率
15 |
16 | public long time;//时间
17 | public long memory;
18 | public long flowUpload;
19 | public long flowDownload;
20 | public long cpuApp;
21 | public long cpuTotal;
22 | public HashMap threadCpus = new HashMap<>();//所有线程的CPU占用
23 |
24 |
25 | public static class ThreadCpu{
26 | String threadId;
27 | String ThreadName;
28 | long threadCpu;
29 | }
30 |
31 |
32 |
33 |
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/src/main/java/com/tencent/wstt/gt/datatool/analysis/ScreenAnalysis.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.datatool.analysis;
2 |
3 | import com.tencent.wstt.gt.datatool.obj.ScreenState;
4 | import com.tencent.wstt.gt.datatool.GTRAnalysis;
5 |
6 | import java.util.ArrayList;
7 |
8 | /**
9 | * Created by p_hongjcong on 2017/7/31.
10 | */
11 |
12 | public class ScreenAnalysis {
13 |
14 |
15 | ArrayList screenStates = new ArrayList<>();
16 |
17 | public ScreenAnalysis(GTRAnalysis gtrAnalysis, ArrayList screenStates) {
18 | this.screenStates = screenStates;
19 | }
20 |
21 | public void onCollectScreen(long time, boolean isOn) {
22 | ScreenState screenInfo = new ScreenState();
23 | screenInfo.time = time;
24 | screenInfo.isOn = isOn;
25 | screenStates.add(screenInfo);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/android/GT_SDK/gtrsdk/src/main/java/com/tencent/wstt/gt/collector/monitor/AbsMonitor.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.collector.monitor;
2 |
3 | import android.content.Context;
4 | import android.os.Handler;
5 | import android.os.HandlerThread;
6 |
7 | /**
8 | * Created by p_xcli on 2017/12/24.
9 | */
10 |
11 | public class AbsMonitor {
12 | protected HandlerThread thread;
13 | protected Handler handler;
14 | int threadId = -1;
15 |
16 | volatile boolean started;
17 |
18 | public void start() {
19 |
20 | }
21 |
22 | public void start(Context context) {
23 |
24 | }
25 |
26 | public void stop() {
27 |
28 | }
29 |
30 | public void stop(Context context) {
31 |
32 | }
33 |
34 | public int getWorkThreadId() {
35 | return threadId;
36 | }
37 |
38 | public Handler getHandler() {
39 | return handler;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/analysis4/analysis/DeviceAnalysis.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.analysis4.analysis;
2 |
3 | import com.tencent.wstt.gt.analysis4.GTRAnalysis;
4 | import com.tencent.wstt.gt.analysis4.GTRAnalysisResult;
5 |
6 | /**
7 | * Created by p_hongjcong on 2017/8/1.
8 | */
9 |
10 | public class DeviceAnalysis {
11 | GTRAnalysisResult gtrAnalysisResult = null;
12 |
13 | public DeviceAnalysis(GTRAnalysisResult gtrAnalysisResult) {
14 | this.gtrAnalysisResult = gtrAnalysisResult;
15 | }
16 |
17 | public void onCollectDeviceInfo(String vendor, String model, String sdkName, int sdkInt) {
18 | gtrAnalysisResult.vendor = vendor;
19 | gtrAnalysisResult.model = model;
20 | gtrAnalysisResult.sdkName = sdkName;
21 | gtrAnalysisResult.sdkInt = sdkInt;
22 | GTRAnalysis.refreshDeviceInfo();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/jni/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Sets the minimum version of CMake required to build your native library.
2 | # This ensures that a certain set of CMake features is available to
3 | # your build.
4 |
5 | cmake_minimum_required(VERSION 3.4.1)
6 |
7 | # Specifies a library name, specifies whether the library is STATIC or
8 | # SHARED, and provides relative paths to the source code. You can
9 | # define multiple libraries by adding multiple add.library() commands,
10 | # and CMake builds them for you. When you build your app, Gradle
11 | # automatically packages shared libraries with your APK.
12 |
13 | add_library( # Specifies the name of the library.
14 | mem_fill_tool
15 |
16 | # Sets the library as a shared library.
17 | SHARED
18 |
19 | # Provides a relative path to your source file(s).
20 | com_tencent_wstt_gt_api_utils_MemFillTool.c )
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/analysis4/analysis/OperationAnalysis.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.analysis4.analysis;
2 |
3 | import com.tencent.wstt.gt.analysis4.GTRAnalysisResult;
4 | import com.tencent.wstt.gt.analysis4.obj.OperationInfo;
5 |
6 | public class OperationAnalysis {
7 | GTRAnalysisResult gtrAnalysisResult = null;
8 |
9 | public OperationAnalysis(GTRAnalysisResult gtrAnalysisResult) {
10 | this.gtrAnalysisResult = gtrAnalysisResult;
11 | }
12 |
13 | OperationInfo physicsOperation;
14 |
15 | public void onActivity_onKeyDown(String operationName, long time) {
16 |
17 | }
18 |
19 |
20 | public void onActivity_onKeyUp(String operationName, long time) {
21 |
22 | }
23 |
24 | OperationInfo viewOperation;
25 |
26 | public void onView_dispatchTouchEvent(String viewType, String viewName, String action, long time) {
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/APT_Eclipse_Plugin/src/com/tencent/wstt/apt/data/PieChartDataItem.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Tencent is pleased to support the open source community by making APT available.
3 | * Copyright (C) 2014 THL A29 Limited, a Tencent company. All rights reserved.
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
7 | */
8 |
9 |
10 | package com.tencent.wstt.apt.data;
11 |
12 | public class PieChartDataItem {
13 | public String mapping;
14 | public Number value;
15 | }
16 |
--------------------------------------------------------------------------------
/android/GT_SDK/yhook/src/androidTest/java/lab/galaxy/yahfa/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package lab.galaxy.yahfa;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("lab.galaxy.yahfa.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/src/androidTest/java/brian/com/datatool/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package brian.com.datatool;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("brian.com.datatool.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/java/com/gtr/test/fragment/FragmentDemo2_V4.java:
--------------------------------------------------------------------------------
1 | package com.gtr.test.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | import com.tencent.wstt.gtr.sdkdemo.R;
11 |
12 | /**
13 | * Created by p_hongjcong on 2017/4/20.
14 | */
15 |
16 | public class FragmentDemo2_V4 extends Fragment {
17 |
18 |
19 | @Nullable
20 | @Override
21 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
22 |
23 | View view = inflater.inflate(R.layout.fragment_test, null);
24 |
25 | return view;
26 | }
27 |
28 | @Override
29 | public void onCreate(@Nullable Bundle savedInstanceState) {
30 | super.onCreate(savedInstanceState);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/java/com/gtr/test/fragment/FragmentDemo4_V4.java:
--------------------------------------------------------------------------------
1 | package com.gtr.test.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | import com.tencent.wstt.gtr.sdkdemo.R;
11 |
12 | /**
13 | * Created by p_hongjcong on 2017/4/20.
14 | */
15 |
16 | public class FragmentDemo4_V4 extends Fragment {
17 |
18 |
19 | @Nullable
20 | @Override
21 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
22 |
23 | View view = inflater.inflate(R.layout.fragment_test, null);
24 |
25 | return view;
26 | }
27 |
28 | @Override
29 | public void onCreate(@Nullable Bundle savedInstanceState) {
30 | super.onCreate(savedInstanceState);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/java/com/gtr/test/fragment/FragmentDemo5_V4.java:
--------------------------------------------------------------------------------
1 | package com.gtr.test.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | import com.tencent.wstt.gtr.sdkdemo.R;
11 |
12 | /**
13 | * Created by p_hongjcong on 2017/4/20.
14 | */
15 |
16 | public class FragmentDemo5_V4 extends Fragment {
17 |
18 |
19 | @Nullable
20 | @Override
21 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
22 |
23 | View view = inflater.inflate(R.layout.fragment_test, null);
24 |
25 | return view;
26 | }
27 |
28 | @Override
29 | public void onCreate(@Nullable Bundle savedInstanceState) {
30 | super.onCreate(savedInstanceState);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/analysis4/obj/FrontBackInfo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.analysis4.obj;
2 |
3 | import java.util.ArrayList;
4 |
5 | /**
6 | * Created by p_hongjcong on 2017/8/4.
7 | */
8 |
9 | public class FrontBackInfo {
10 |
11 |
12 | public long frontTime = 0;
13 | public long frontCpuApp = 0;
14 | public long frontCpuTotal = 0;
15 | public ArrayList frontCpuArray = new ArrayList<>();
16 | public ArrayList frontMemoryArray = new ArrayList<>();
17 | public long frontFlowUpload = 0;
18 | public long frontFlowDownload = 0;
19 |
20 | public long backTime = 0;
21 | public long backCpuApp = 0;
22 | public long backCpuTotal = 0;
23 | public ArrayList backCpuArray = new ArrayList<>();
24 | public ArrayList backMemoryArray = new ArrayList<>();
25 | public long backFlowUpload = 0;
26 | public long backFlowDownload = 0;
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/android/GT_SDK/gtrsdk/src/main/aidl/com/tencent/wstt/gt/GTRData说明.txt:
--------------------------------------------------------------------------------
1 |
2 | GUTData.data数据格式说明:
3 | Log.TAG = "PDM_DATA_TAG";
4 | data.separator = "_&&PDM&_";
5 |
6 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7 | 参数0 参数1 参数2 参数3 参数4 参数5 参数6
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | file_open tid fd path time
16 | file_read tid fd size time
17 | file_pread64 tid fd size time
18 | file_write tid fd size time
19 | file_pwrite64 tid fd size time
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/androidTest/java/com/example/p_svengong/gt_kp/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.example.p_svengong.gt_kp;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.example.p_svengong.gt_kp", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/GTRParam.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt;
2 |
3 | import android.os.Parcel;
4 | import android.os.Parcelable;
5 |
6 | /**
7 | * Created by p_hongjcong on 2017/7/11.
8 | */
9 |
10 | public class GTRParam implements Parcelable{
11 |
12 | public GTRParam(){
13 | }
14 | protected GTRParam(Parcel in) {
15 | }
16 | public static final Creator CREATOR = new Creator() {
17 | @Override
18 | public GTRParam createFromParcel(Parcel in) {
19 | return new GTRParam(in);
20 | }
21 |
22 | @Override
23 | public GTRParam[] newArray(int size) {
24 | return new GTRParam[size];
25 | }
26 | };
27 | @Override
28 | public int describeContents() {
29 | return 0;
30 | }
31 | @Override
32 | public void writeToParcel(Parcel dest, int flags) {
33 | }
34 |
35 |
36 |
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/service/GTPData说明.txt:
--------------------------------------------------------------------------------
1 |
2 | GUTData.data数据格式说明:
3 | Log.TAG = "PDM_DATA_TAG";
4 | data.separator = "_&&PDM&_";
5 |
6 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7 | 参数0 参数1 参数2 参数3 参数4 参数5 参数6
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | file_open tid fd path time
16 | file_read tid fd size time
17 | file_pread64 tid fd size time
18 | file_write tid fd size time
19 | file_pwrite64 tid fd size time
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/java/com/gtr/test/fragment/FragmentDemo3_V4.java:
--------------------------------------------------------------------------------
1 | package com.gtr.test.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | import com.tencent.wstt.gtr.sdkdemo.R;
11 |
12 |
13 | /**
14 | * Created by p_hongjcong on 2017/4/20.
15 | */
16 |
17 | public class FragmentDemo3_V4 extends Fragment {
18 |
19 |
20 | @Nullable
21 | @Override
22 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
23 |
24 | View view = inflater.inflate(R.layout.fragment_test, null);
25 |
26 | return view;
27 | }
28 |
29 | @Override
30 | public void onCreate(@Nullable Bundle savedInstanceState) {
31 | super.onCreate(savedInstanceState);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/APT_Eclipse_Plugin/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | APT_Eclipse_Plugin
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.pde.ManifestBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.pde.SchemaBuilder
20 |
21 |
22 |
23 |
24 | net.sourceforge.metrics.builder
25 |
26 |
27 |
28 |
29 |
30 | org.eclipse.pde.PluginNature
31 | org.eclipse.jdt.core.javanature
32 | net.sourceforge.metrics.nature
33 |
34 |
35 |
--------------------------------------------------------------------------------
/APT_Eclipse_Plugin/src/com/tencent/wstt/apt/chart/Observer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Tencent is pleased to support the open source community by making APT available.
3 | * Copyright (C) 2014 THL A29 Limited, a Tencent company. All rights reserved.
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
7 | */
8 |
9 |
10 | package com.tencent.wstt.apt.chart;
11 |
12 | import java.util.Date;
13 |
14 |
15 | public abstract class Observer {
16 |
17 | public abstract void update(Date time, Number []datas);
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/java/com/gtr/test/UserStrings.java:
--------------------------------------------------------------------------------
1 | package com.gtr.test;
2 |
3 | /**
4 | * Created by p_guilfu on 2018/1/15.
5 | */
6 |
7 | public interface UserStrings {
8 | // 出入参
9 | public static final String 并发线程数 = "并发线程数";
10 | public static final String KeepAlive = "KeepAlive";
11 | public static final String 连接超时 = "连接超时";
12 | public static final String 读超时 = "读超时";
13 | public static final String 下载耗时 = "下载耗时";
14 | public static final String NumberOfDownloadedPics = "NumberOfDownloadedPics";
15 | public static final String 实际带宽 = "实际带宽";
16 | public static final String singlePicSpeed = "singlePicSpeed";
17 |
18 | // 日志、性能的tag
19 | public static final String 下载完成后到UI展示 = "下载完成后到UI展示";
20 | public static final String 速度统计 = "速度统计";
21 |
22 | public static final String UI处理图片 = "UI处理图片";
23 | public static final String 线程内统计 = "线程内统计";
24 | public static final String Http响应耗时 = "Http响应耗时";
25 | public static final String 图片下载 = "图片下载";
26 | }
27 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/analysis4/analysis/LogAnalysis.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.analysis4.analysis;
2 |
3 | import com.tencent.wstt.gt.analysis4.GTRAnalysisResult;
4 | import com.tencent.wstt.gt.analysis4.GTRAnalysis;
5 | import com.tencent.wstt.gt.analysis4.obj.LogInfo;
6 | import com.tencent.wstt.gt.analysis4.util.LogUtil;
7 |
8 | public class LogAnalysis {
9 | GTRAnalysisResult gtrAnalysisResult = null;
10 |
11 | public LogAnalysis(GTRAnalysisResult gtrAnalysisResult) {
12 | this.gtrAnalysisResult = gtrAnalysisResult;
13 | }
14 |
15 | public void onCollectLog(String log, long time) {
16 | LogInfo logInfo = LogUtil.onCollectLog(log, time);
17 | if (logInfo == null) {
18 | return;
19 | }
20 | if (logInfo.grade.contains("A") || logInfo.grade.contains("E")) {
21 | gtrAnalysisResult.errorLogNum++;
22 | GTRAnalysis.refreshLogInfo();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/res/layout/activity_test_viewbuild.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
20 |
21 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/res/layout/activity_test_webview.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
20 |
21 |
--------------------------------------------------------------------------------
/android/GT_SDK/gtrsdk/src/main/java/com/tencent/wstt/gt/GTRParam.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt;
2 |
3 | import android.os.Parcel;
4 | import android.os.Parcelable;
5 |
6 | /**
7 | * @author p_hongjcong
8 | * Created by p_hongjcong on 2017/7/11.
9 | */
10 | public class GTRParam implements Parcelable {
11 | public GTRParam() {
12 |
13 | }
14 |
15 | protected GTRParam(Parcel in) {
16 |
17 | }
18 |
19 | public static final Creator CREATOR = new Creator() {
20 | @Override
21 | public GTRParam createFromParcel(Parcel in) {
22 | return new GTRParam(in);
23 | }
24 |
25 | @Override
26 | public GTRParam[] newArray(int size) {
27 | return new GTRParam[size];
28 | }
29 | };
30 |
31 | @Override
32 | public int describeContents() {
33 | return 0;
34 | }
35 |
36 | @Override
37 | public void writeToParcel(Parcel dest, int flags) {
38 |
39 | }
40 |
41 |
42 |
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/android/GTDemo/gradle.properties:
--------------------------------------------------------------------------------
1 | ## Project-wide Gradle settings.
2 | #
3 | # For more details on how to configure your build environment visit
4 | # http://www.gradle.org/docs/current/userguide/build_environment.html
5 | #
6 | # Specifies the JVM arguments used for the daemon process.
7 | # The setting is particularly useful for tweaking memory settings.
8 | # Default value: -Xmx1024m -XX:MaxPermSize=256m
9 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
10 | #
11 | # When configured, Gradle will run in incubating parallel mode.
12 | # This option should only be used with decoupled projects. More details, visit
13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
14 | # org.gradle.parallel=true
15 | #Tue Nov 07 10:09:48 CST 2017
16 | systemProp.https.proxyPort=45678
17 | systemProp.http.proxyHost=127.0.0.1
18 | org.gradle.jvmargs=-Xmx1536m
19 | systemProp.https.proxyHost=127.0.0.1
20 | systemProp.http.proxyPort=45678
21 |
--------------------------------------------------------------------------------
/android/GT_APP/gradle.properties:
--------------------------------------------------------------------------------
1 | ## Project-wide Gradle settings.
2 | #
3 | # For more details on how to configure your build environment visit
4 | # http://www.gradle.org/docs/current/userguide/build_environment.html
5 | #
6 | # Specifies the JVM arguments used for the daemon process.
7 | # The setting is particularly useful for tweaking memory settings.
8 | # Default value: -Xmx1024m -XX:MaxPermSize=256m
9 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
10 | #
11 | # When configured, Gradle will run in incubating parallel mode.
12 | # This option should only be used with decoupled projects. More details, visit
13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
14 | # org.gradle.parallel=true
15 | #Wed Nov 08 16:25:13 CST 2017
16 | systemProp.http.proxyHost=127.0.0.1
17 | systemProp.https.proxyPort=45678
18 | org.gradle.jvmargs=-Xmx1536m
19 | systemProp.https.proxyHost=127.0.0.1
20 | systemProp.http.proxyPort=45678
21 |
--------------------------------------------------------------------------------
/android/GT_SDK/gradle.properties:
--------------------------------------------------------------------------------
1 | ## Project-wide Gradle settings.
2 | #
3 | # For more details on how to configure your build environment visit
4 | # http://www.gradle.org/docs/current/userguide/build_environment.html
5 | #
6 | # Specifies the JVM arguments used for the daemon process.
7 | # The setting is particularly useful for tweaking memory settings.
8 | # Default value: -Xmx1024m -XX:MaxPermSize=256m
9 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
10 | #
11 | # When configured, Gradle will run in incubating parallel mode.
12 | # This option should only be used with decoupled projects. More details, visit
13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
14 | # org.gradle.parallel=true
15 | #Tue Nov 07 10:09:48 CST 2017
16 | systemProp.https.proxyPort=45678
17 | systemProp.http.proxyHost=127.0.0.1
18 | org.gradle.jvmargs=-Xmx1536m
19 | systemProp.https.proxyHost=127.0.0.1
20 | systemProp.http.proxyPort=45678
21 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/src/main/java/com/tencent/wstt/gt/datatool/analysis/AppAnalysis.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.datatool.analysis;
2 |
3 | import com.tencent.wstt.gt.datatool.GTRAnalysis;
4 | import com.tencent.wstt.gt.datatool.obj.AppInfo;
5 |
6 | /**
7 | * Created by p_hongjcong on 2017/7/31.
8 | */
9 |
10 | public class AppAnalysis {
11 |
12 | AppInfo appInfo;
13 |
14 | public AppAnalysis(GTRAnalysis gtrAnalysis, AppInfo appInfo) {
15 | this.appInfo = appInfo;
16 | }
17 |
18 | public void onCollectAppInfo(String packageName, String appName, String versionName, int versionCode, int gtrVersionCode, long startTestTime, int mainThreadId) {
19 |
20 | appInfo.packageName = packageName;
21 | appInfo.appName = appName;
22 | appInfo.versionName = versionName;
23 | appInfo.versionCode = versionCode;
24 | appInfo.gtrVersionCode = gtrVersionCode;
25 | appInfo.startTestTime = startTestTime;
26 | appInfo.mainThreadId = mainThreadId;
27 | }
28 |
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/android/GT_APP/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/src/main/java/com/tencent/wstt/gt/datatool/obj/FragmentLifecycleMethod.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.datatool.obj;
2 |
3 | /**
4 | * Created by elvis on 2017/2/16.
5 | */
6 |
7 | public class FragmentLifecycleMethod {
8 |
9 |
10 | public static final String ONATTACH = "onAttach";
11 | public static final String ONCREATE = "onCreate";
12 | public static final String ONCREATEVIEW = "onCreateView";
13 | public static final String ONACTIVITYCREATED = "onActivityCreated";
14 | public static final String ONSTART = "onStart";
15 | public static final String ONRESUME = "onResume";
16 | public static final String ONPAUSE = "onPause";
17 | public static final String ONSTOP = "onStop";
18 | public static final String ONDESTROYVIEW = "onDestroyView";
19 | public static final String ONDESTROY = "onDestroy";
20 | public static final String ONDETACH = "onDetach";
21 |
22 | public String methodName;
23 | public long methodStartTime;
24 | public long methodEndTime;
25 |
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/res/layout/activity_test_fragmentv4.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/analysis4/obj/FragmentLifecycleMethod.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.analysis4.obj;
2 |
3 | /**
4 | *
5 | * Created by elvis on 2017/2/16.
6 | */
7 |
8 | public class FragmentLifecycleMethod {
9 |
10 |
11 | public static final String ONATTACH = "onAttach";
12 | public static final String ONCREATE = "onCreate";
13 | public static final String ONCREATEVIEW = "onCreateView";
14 | public static final String ONACTIVITYCREATED = "onActivityCreated";
15 | public static final String ONSTART = "onStart";
16 | public static final String ONRESUME = "onResume";
17 | public static final String ONPAUSE = "onPause";
18 | public static final String ONSTOP = "onStop";
19 | public static final String ONDESTROYVIEW = "onDestroyView";
20 | public static final String ONDESTROY = "onDestroy";
21 | public static final String ONDETACH = "onDetach";
22 |
23 | public String methodName;
24 | public long methodStartTime;
25 | public long methodEndTime;
26 |
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/ios/GT/Sources/Kit/Common/Controller/popview/GTPopoverTableView.h:
--------------------------------------------------------------------------------
1 | //
2 | // GTPopoverTableView.h
3 | // GTKit
4 | //
5 | // Created on 13-4-2.
6 | // Copyright (c) 2013年 Tencent. All rights reserved.
7 | //
8 | #ifndef GT_DEBUG_DISABLE
9 | #import
10 |
11 | @class GTPopoverTableView;
12 |
13 | @protocol GTPopoverTableViewDelegate
14 |
15 | - (void) popoverTable:(GTPopoverTableView*)tableView didSelectRow:(NSUInteger)row;
16 |
17 | @end
18 |
19 |
20 | @interface GTPopoverTableView : UITableViewController
21 | {
22 | NSArray *_list;
23 | NSString *_selectedTitle;
24 | NSIndexPath *_lastIndexPath;
25 |
26 | id _popDelegate;
27 | }
28 |
29 | @property (nonatomic, retain) NSArray *list;
30 | @property (nonatomic, retain) NSString *selectedTitle;
31 | @property (nonatomic, retain) NSIndexPath *lastIndexPath;
32 | @property (nonatomic, assign) id popDelegate;
33 |
34 | - (id)initWithArray:(NSArray *)array;
35 |
36 |
37 | @end
38 | #endif
39 |
--------------------------------------------------------------------------------
/APT_Eclipse_Plugin/src/com/tencent/wstt/apt/data/PMAPDataItem.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Tencent is pleased to support the open source community by making APT available.
3 | * Copyright (C) 2014 THL A29 Limited, a Tencent company. All rights reserved.
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
7 | */
8 |
9 |
10 | package com.tencent.wstt.apt.data;
11 |
12 | public class PMAPDataItem {
13 | public String[] contents = new String[ITEM_COUNT];
14 | public static final int ITEM_COUNT = 2;
15 | public static final int NAME_INDEX = 0;
16 | public static final int VALUE_INDEX = 1;
17 | }
18 |
--------------------------------------------------------------------------------
/APT_Eclipse_Plugin/src/com/tencent/wstt/apt/data/PkgInfo.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Tencent is pleased to support the open source community by making APT available.
3 | * Copyright (C) 2014 THL A29 Limited, a Tencent company. All rights reserved.
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
7 | */
8 |
9 |
10 | package com.tencent.wstt.apt.data;
11 |
12 |
13 |
14 | public class PkgInfo {
15 |
16 | public String[] contents = new String[ITEM_COUNT];
17 | public static final int ITEM_COUNT = 2;
18 | public static final int NAME_INDEX = 0;
19 | public static final int PID_INDEX = 1;
20 | }
21 |
--------------------------------------------------------------------------------
/android/GT_SDK/yhook/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/opt/android-sdk-macosx/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/APT_Eclipse_Plugin/src/com/tencent/wstt/apt/stubanalysis/StubAnalysisUtil.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Tencent is pleased to support the open source community by making APT available.
3 | * Copyright (C) 2014 THL A29 Limited, a Tencent company. All rights reserved.
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
7 | */
8 |
9 |
10 | package com.tencent.wstt.apt.stubanalysis;
11 |
12 |
13 |
14 | public class StubAnalysisUtil {
15 |
16 | public static final String DETAIL_TAB_NAME = "详细视图";
17 | public static final String TOP_TAB_NAME = "统计视图";
18 | public static final String TREE_TAB_NAME = "树形视图";
19 | }
20 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/src/main/java/com/tencent/wstt/gt/datatool/analysis/GCAnalysis.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.datatool.analysis;
2 |
3 |
4 | import com.tencent.wstt.gt.datatool.GTRAnalysis;
5 | import com.tencent.wstt.gt.datatool.obj.GCInfo;
6 |
7 | import java.util.ArrayList;
8 |
9 | /**
10 | * Created by p_hongjcong on 2017/8/2.
11 | */
12 |
13 | public class GCAnalysis {
14 |
15 | ArrayList allGCInfos;
16 | ArrayList explicitGCs;
17 |
18 | public GCAnalysis(GTRAnalysis gtrAnalysis, ArrayList allGCInfos, ArrayList explicitGCs) {
19 | this.allGCInfos = allGCInfos;
20 | this.explicitGCs = explicitGCs;
21 | }
22 |
23 |
24 | public void onCollectGC(String gcTag, String gcString, long time) {
25 | GCInfo gcInfo = GCInfo.initGcInfo(gcTag, gcString, time);
26 | allGCInfos.add(gcInfo);
27 |
28 | //检测显示GC
29 | if (gcInfo.gcResult.contains("Explicit")) {//System.gc();引起
30 | explicitGCs.add(allGCInfos.size() - 1);
31 | }
32 |
33 |
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/APT_Eclipse_Plugin/README.md:
--------------------------------------------------------------------------------
1 | # 最新变动 #
2 | 1,获取进程的内存快照,并支持设定阈值自动dump。
3 |
4 | 2,支持对指定进程进行GC操作。
5 |
6 | 3,更新图标。
7 |
8 | 4,bugfix
9 |
10 | # 项目介绍 #
11 | APT是一个eclipse插件,可以实时监控Android手机上多个应用的CPU、内存数据曲线,并保存数据;
12 | 另外还支持自动获取内存快照、PMAP文件分析等,方便开发人员自测或者测试人员完成性能测试,快速
13 | 发现产品问题。
14 |
15 | # 功能摘要 #
16 | 1.支持多进程的CPU测试,并提供top和dumpsys cpuinfo两种方式.
17 |
18 | 2.支持多进程的内存测试,并支持9种内存类型,测试过程中可动态调整要显示的内存类型曲线.
19 |
20 | 3.支持自动获取内存快照.
21 |
22 | 4.支持PMAP内存分析对比.
23 |
24 |
25 | # 编译方法 #
26 | 下载Eclipse for RCP and RAP Developers版本的eclipse,将工程导入即可。
27 |
28 | # 使用方法 #
29 | 把下载的jar文件放到eclipse的plugins目录下面,重启eclipse,
30 | 执行下面的操作【Window】-》【Open Perspective】-》【Other】选择APT透视图。
31 |
32 |
33 | # 注意事项 #
34 |
35 | 1.APT中的DumpHprof和GC功能由于用到了DDMLIB的功能,所以有两个限制:
36 | 首先,确保手机系统或者被测应用是可调试的;
37 | 其次,DDMLIB不允许同时有多个工具获取被调试手机上的进程信息,所以如果想用APT的这两个功能,
38 | 最好把eclipse的透视图切换到APT,然后重启eclipse。
39 |
40 | 2.获取PMAP文件需要root权限,并且需要默认root。如果进入adb shell默认不是root权限,
41 | 可以优先执行adb root即可。
42 |
43 | 3.最好将adb路径加入到path中。
44 |
45 | 4.eclipse需要安装ADT插件
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/APT_Eclipse_Plugin/src/com/tencent/wstt/apt/data/Jiffies.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Tencent is pleased to support the open source community by making APT available.
3 | * Copyright (C) 2014 THL A29 Limited, a Tencent company. All rights reserved.
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
7 | */
8 |
9 |
10 | package com.tencent.wstt.apt.data;
11 |
12 | /**
13 | * @Description jiffies数据结构体
14 | * @date 2013年11月10日 下午5:55:47
15 | *
16 | */
17 | public class Jiffies {
18 |
19 | public long uTime;
20 | public long sTime;
21 | public Jiffies(long utime, long stime)
22 | {
23 | uTime = utime;
24 | sTime = stime;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/ios/GTKit.xcodeproj/xcuserdata/navyzhou.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | GT.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 | GTResources.xcscheme
13 |
14 | orderHint
15 | 2
16 |
17 | GTSDK.xcscheme
18 |
19 | orderHint
20 | 1
21 |
22 |
23 | SuppressBuildableAutocreation
24 |
25 | 91556DE7169FB62000492680
26 |
27 | primary
28 |
29 |
30 | 91556ECF169FBDDE00492680
31 |
32 | primary
33 |
34 |
35 | 919CC7D816DDE0570073830F
36 |
37 | primary
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/APT_Eclipse_Plugin/src/com/tencent/wstt/apt/data/PCInfo.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Tencent is pleased to support the open source community by making APT available.
3 | * Copyright (C) 2014 THL A29 Limited, a Tencent company. All rights reserved.
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
7 | */
8 |
9 |
10 | package com.tencent.wstt.apt.data;
11 |
12 | /**
13 | * @Description 保存当前PC环境信息
14 | * @date 2013年11月10日 下午5:57:20
15 | *
16 | */
17 | public class PCInfo {
18 |
19 | public static String adbPath = null;
20 | public static String adbShell = null;
21 | public static String hprofConv = null;
22 |
23 | public static String OSName = "none";
24 | }
25 |
--------------------------------------------------------------------------------
/android/GT_SDK/gtrsdk/src/main/java/com/tencent/wstt/gt/collector/util/ProcessUtil.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.collector.util;
2 |
3 | import android.app.ActivityManager;
4 | import android.app.ActivityManager.RunningAppProcessInfo;
5 | import android.content.Context;
6 |
7 | /**
8 | * Created by elvis on 2017/2/24.
9 | */
10 |
11 | public class ProcessUtil {
12 | /**
13 | * 判断进程是否包含Application主线程
14 | * @param context
15 | * @param pid
16 | * @return
17 | */
18 | public static boolean isUIProcess(Context context, int pid) {
19 | String processName = null;
20 | ActivityManager mActivityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
21 | for (RunningAppProcessInfo appProcess : mActivityManager.getRunningAppProcesses()) {
22 | if (appProcess.pid == pid) {
23 | processName = appProcess.processName;
24 | break;
25 | }
26 | }
27 |
28 | String packageName = context.getPackageName();
29 | return processName != null && processName.equals(packageName);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/APT_Eclipse_Plugin/src/com/tencent/wstt/apt/data/AbstractStatisticsDataInfo.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Tencent is pleased to support the open source community by making APT available.
3 | * Copyright (C) 2014 THL A29 Limited, a Tencent company. All rights reserved.
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
7 | */
8 |
9 |
10 | package com.tencent.wstt.apt.data;
11 |
12 | /**
13 | * 统计数据抽象类
14 | * @ClassName: AbstractStatisticsDataInfo
15 | * @Description: TODO
16 | * @date 2013-5-23 上午9:34:04
17 | *
18 | */
19 | public abstract class AbstractStatisticsDataInfo {
20 | public String itemName;
21 | public long []contents;
22 | public int valueNumber;
23 | }
24 |
--------------------------------------------------------------------------------
/android/GT_APP/datatool/src/main/java/com/tencent/wstt/gt/datatool/obj/NormalInfo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.datatool.obj;
2 |
3 | import java.util.ArrayList;
4 |
5 | /**
6 | * Created by Elvis on 2017/1/4.
7 | * Email:elvis@21kunpeng.com
8 | * 用于保存后台定时采集的数据(流量、内存、CPU、电量)
9 | */
10 |
11 | public class NormalInfo {
12 |
13 |
14 | //(cpuApp - lastCpuApp) * 100L / (cpuTotal-lastCpuTotal);//计算cpu占用率
15 |
16 | public long time;//时间
17 | public long memory;
18 | public long flowUpload;
19 | public long flowDownload;
20 | public long cpuApp;
21 | public long cpuTotal;
22 |
23 |
24 | public ArrayList threadCpus = new ArrayList<>();//所有线程的CPU占用
25 |
26 |
27 | public static class ThreadCpu {
28 | public ThreadCpu() {
29 |
30 | }
31 |
32 | public ThreadCpu(int threadId, String threadName, long threadCpu) {
33 | this.threadId = threadId;
34 | this.threadName = threadName;
35 | this.threadCpu = threadCpu;
36 | }
37 |
38 | public int threadId;
39 | public String threadName;
40 | public long threadCpu;
41 | }
42 |
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/android/GTDemo/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 |
5 | compileSdkVersion rootProject.ext.compileSdkVersion
6 | buildToolsVersion rootProject.ext.buildToolsVersion
7 |
8 | defaultConfig {
9 | applicationId "com.gtr.sdkdemo"
10 | minSdkVersion rootProject.ext.minSdkVersion
11 | targetSdkVersion rootProject.ext.targetSdkVersion
12 | versionCode 22067
13 | versionName "2.3.2.1"
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | lintOptions {
24 | checkReleaseBuilds false
25 | abortOnError false
26 | }
27 | }
28 |
29 |
30 |
31 | dependencies {
32 | compile fileTree(include: ['*.jar'], dir: 'libs')
33 | compile "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
34 | compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
35 | }
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/log/logcat/VersionHelper.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.log.logcat;
2 |
3 | import java.lang.reflect.Field;
4 |
5 | import android.os.Build;
6 |
7 | public class VersionHelper {
8 |
9 | public static final int VERSION_CUPCAKE = 3;
10 | public static final int VERSION_DONUT = 4;
11 | public static final int VERSION_FROYO = 8;
12 | public static final int VERSION_JELLYBEAN = 16;
13 |
14 | private static Field sdkIntField = null;
15 | private static boolean fetchedSdkIntField = false;
16 |
17 | public static int getVersionSdkIntCompat() {
18 | try {
19 | Field field = getSdkIntField();
20 | if (field != null) {
21 | return (Integer) field.get(null);
22 | }
23 | } catch (IllegalAccessException ignore) {
24 | // ignore
25 | }
26 | return VERSION_CUPCAKE; // cupcake
27 | }
28 |
29 | private static Field getSdkIntField() {
30 | if (!fetchedSdkIntField) {
31 | try {
32 | sdkIntField = Build.VERSION.class.getField("SDK_INT");
33 | } catch (NoSuchFieldException ignore) {
34 | // ignore
35 | }
36 | fetchedSdkIntField = true;
37 | }
38 | return sdkIntField;
39 | }
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/APT_Eclipse_Plugin/src/com/tencent/wstt/apt/data/TestTask.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Tencent is pleased to support the open source community by making APT available.
3 | * Copyright (C) 2014 THL A29 Limited, a Tencent company. All rights reserved.
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
7 | */
8 |
9 |
10 | package com.tencent.wstt.apt.data;
11 |
12 | import java.util.TimerTask;
13 |
14 | /**
15 | * @ClassName: TestTask
16 | * @Description: 描述测试任务的结构体
17 | * @date 2013-4-13 上午11:44:07
18 | *
19 | */
20 | public class TestTask {
21 | public TimerTask task;
22 | public long period;
23 | public TestTask(TimerTask task, long period)
24 | {
25 | this.task = task;
26 | this.period = period;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/res/layout/activity_test_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
16 |
17 |
18 |
19 |
25 |
26 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/APT_Eclipse_Plugin/src/com/tencent/wstt/apt/cmdparse/HprofConv.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Tencent is pleased to support the open source community by making APT available.
3 | * Copyright (C) 2014 THL A29 Limited, a Tencent company. All rights reserved.
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
7 | */
8 |
9 |
10 | package com.tencent.wstt.apt.cmdparse;
11 |
12 | import com.tencent.wstt.apt.data.PCInfo;
13 |
14 | /**
15 | * @Description 将Dalvik的hprof转化为JVM格式的
16 | * @date 2013年11月10日 下午5:50:19
17 | *
18 | */
19 | public class HprofConv {
20 | public static void run(String inputFilePath, String outFilePath)
21 | {
22 | //TODO 这里没有对程序执行的返回进行判断,默认都成功
23 | CMDExecute.runCMD(PCInfo.hprofConv + " " + inputFilePath + " " + outFilePath);
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/android/GT_APP/app/src/main/java/com/tencent/wstt/gt/analysis4/analysis/AppAnalysis.java:
--------------------------------------------------------------------------------
1 | package com.tencent.wstt.gt.analysis4.analysis;
2 |
3 | import com.tencent.wstt.gt.analysis4.GTRAnalysis;
4 | import com.tencent.wstt.gt.analysis4.GTRAnalysisResult;
5 |
6 | /**
7 | * Created by p_hongjcong on 2017/7/31.
8 | */
9 |
10 | public class AppAnalysis {
11 | GTRAnalysisResult gtrAnalysisResult = null;
12 |
13 | public AppAnalysis(GTRAnalysisResult gtrAnalysisResult) {
14 | this.gtrAnalysisResult = gtrAnalysisResult;
15 | }
16 |
17 | public void onCollectAppInfo(String packageName, String appName,
18 | String versionName, int versionCode,
19 | int gtrVersionCode, long startTestTime, int mainThreadId) {
20 | gtrAnalysisResult.packageName = packageName;
21 | gtrAnalysisResult.appName = appName;
22 | gtrAnalysisResult.versionName = versionName;
23 | gtrAnalysisResult.versionCode = versionCode;
24 | gtrAnalysisResult.gtrVersionCode = gtrVersionCode;
25 | gtrAnalysisResult.startTestTime = startTestTime;
26 | gtrAnalysisResult.mainThreadId = mainThreadId;
27 | GTRAnalysis.refreshAppInfo();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/android/GTDemo/app/src/main/res/layout/gt_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
12 |
13 |
19 |
32 |
33 |
--------------------------------------------------------------------------------